Hi, I am developing a system which takes into account among other criteria the strength of the price either in reference to the SP500 or to the respective market index.
To do this, for testing purposes I am calculating the static variables in the exploration for one or more markets and trying to reflect this in the chart template.
The problem occurs when I try to switch from one security to another on the chart as the chart does not update the security unless I double click on the respective tick in the exploration.
Does anyone know why this happens and what could be the solution.
More generally, you should avoid recalculating values when changing the active symbol, if the corresponding MarketID() is not different from the previous symbol.
Fixing these problems will probably also allow you to get the desired result for displaying the data on the chart (also take a look at the SelectedValue() function)
@antoniomartngarca, looking better at the code I wonder what the loop is actually for?
For a chart you can directly calculate and visualize the value without using any static variable (here keeping your calculations):