AleXParticipant
Senior
Hi, I want to know if I can use Variables that once defined maintain a certain value.
Example, control=0 but if the price falls below the lower band of Bollinger then control = 1. When the price rises above the lower band of bollinger I wish the variable “control” to remain “1” and not been changed to 0. It’s possible? Thank you
If you define a value to a variable, this value remain the same until a new one is saved into it.
However, you’ll need to set your variable with a conditional statement like this:
if close crosses under bollingerdown[20] then
var = 1
endif