I create a variable 'show', then by clicking on the chart I cause the variable to change from 'true' to 'false' and back again.
The problem I'm having is that when I add a new (different) indicator to the chart, my first indicator seems to 'reset' and the 'show' variable goes back to its default value. I want it to retain whatever value it had on the last click, even if I add or remove other indicators from the chart.
I tried making the variable 'static' but that then shares the variable between all charts with this indicator, which I specifically don't want.
I'd appreciate if someone could point me in the right direction.
Thanks

Comment