I would like to have my EA show a buy arrow the first time a condition is met until a second condition appears. For example:
Condition 1 (Buy)
mov(c,12,s) > mov(c,24,s) and rsi(14) > 60
Condition 2 (sell)
mov(c,24,s) > mov(c,12,s) and rsi(14) < 60
I would like to see one arrow the first time a buy or sell is done and then when the opposite condition exists, the other arrow. But only once.
I tried placing the above logic into an EA and got multiple Buys/Sells.
I understand why that happened - I'm used to writting code in a linear fashion like:
if condition1 and not flag1
then
flag1 = true
place arrow
end if
but the environment is different and am having a tough time with this type of logic.