StaticVar question - same static variable name but in 2 AFL files

I have an indicator to display multiple charts. Static variable is used to move from one page to another. This indicator is in Sheet2.
multi_charts

I duplicate this indicator to another AFL file as I want to change from line chart to bar chart. I put this indicator in Sheet11. Once I have done this, the Prev Page and Next Page buttons in Sheet2 become unresponsive. Here is my question. Does static variable with similar name in different AFL file and Sheet cause conflict. I use StaticVarRemove( "*" ) and remove the AFL in Sheet11, fix the problem. Thanks in advance.

2 Likes

Amazing AFL., datafeed Fundamental from CVS ?

Yes, it's scraped from Yahoo Finance. This AFL is full of bugs e.g. the color is not working.

I answer my own question.:slightly_smiling_face: I insert the same formula in a different Sheet. When I make change in one Sheet, the static variable changes in another Sheet.
https://www.amibroker.com/guide/afl/staticvarget.html
In the first paragraph, "Static variables allow to share values between various formulas."
So, static variable is accessible to all formulas.

Consider using the Chart-ID as a "key" for your static variable name.