Conditional format - cell color based on the value of the cell above

How to set up cell color based on value (> or <) compared to last BIGGEST cell value, and make it apply to each value that will be writen in future.
Example:

A1= value

A2<A1 RED comapred to A1. A1 still the biggest value.

A3>A1 GREEN Value bigger than the last biggest value. SO next green or red compared to A3.

A4>A3 GREEN Value bigger than the last biggest value. next GREEN or RED compared to A4.

A5<A4 RED So next GREEN compared to LAST BIGGEST value A4. If value is bigger than A3 BUT NOT bigger than A4, still RED.

A6>A4 GREEN So next GREEN or RED comapred to A6 which is biggest value now.
and so…
and ao…
I hope it was clear…
Thank you!

It seems to me that you are looking for something similar to this - ConditionalFormatCompareBiggest.ods