Hi pdrh – The base of the solution you ask for is chaning the first line into
1
OnceLFlag=0
Now its value will stay because only at the first call of your code it is set to 0.
This is not the complete solution, because somewhere you will need to reset it. This will come down to
1
2
3
IfOnMarketthen
LFlag=0
endif
I think this is still not correct, because you’d want to set FLag each new call, which could be done like this :
1
LFlag=closecrosses overindicator1
Of course you’d need to adjust the remainder somewhat. This is not easy to see because it depends on what you want. For example, letting LFlag be on lways after this crssing happened once, does not seem the correct solution to me. This would rather be to reset LFlag at each call … but … (this is what the last by me shown line does and which makes the first line’s adjustment redundant).
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.