Forums › ProRealTime English forum › ProOrder support › Highest high and highest low of previous days and of specific schedules › Reply To: Highest high and highest low of previous days and of specific schedules
Flags and conditions do both may qualify either as true or false, thus easily tracked using GRAPH, the difference is that a condition is a test between two (sometimes even more) data, such as “close > close[1]” or “close CROSSES OVER Rsi[14]”, while a flag is a signal such as “flag” in this example or “daysforbidden” in some strategies when you do not want to trade or “TradeON” and so on….
In the code
1 |
daysforbidden = OpenDayOfWeek < 1 OR OpenDayOfWeek > 5 |
“OpenDayOfWeek < 1 OR OpenDayOfWeek > 5” is the condition to be checked and you can graph it with
1 |
GRAPH OpenDayOfWeek < 1 OR OpenDayOfWeek > 5 |
it will yieald a True/False logical value assigned to DAYSFORBIDDEN, which is a flag (and you can GRAPH it by itself, without having to write the longer line above), like a traffic lights, they are a flag to signal that some time has passed (the condition previously set) since it changed colour and needs to be changed again, you see the flag changing colour.
It is a common variable that may be either true or false, you can use any name, flag is just a nickname to make it easier to understand that it signals something.
“pi = 3.14” is not a flag, PI is just a common variable holding a numeric value, not a logical value.
The above code could have been written
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
if time = 210000 then TradeOrNot = 1 endif . // IF NOT LongOnMarket AND TradeOrNot and time = 143000 THEN . . ENDIF . //later: if time = 203000 then TradeOrNot = 0 endif |
I hope I understood what you meant.