I need some help. How can i put a value on a variable, and chage it when a new signal shows?
Let me explain a little bit more:
I have this code...
and i want that Flag = 1 until happens this (and vise versa):
The problem is that it only put 1 or 2 if the last bar is bigger/slower than the Envelopes channels indi, and i need it to maintain the value until it pass to 2 (if Flag = 1) or vise versa.
How can i do that?
Thanks in advance,
Regards and good trading
I already did that, but the issue maintains. That's why i ask how could i do that.... The issue is that if the next candle don't equals that function, returns 0 and not the value that it should have (1 or 2), until it reach the other function.
I think that it worked. Thanks a lot!