I have also tried with ParamList function but its the same result.
If I change the option in Parameters, nothing happens. I have to press Explore again to change the columns.
Is it possible to make it so that when I change the Parameters, the columns change automatically without having to run Explore again? I'm not sure if I explained myself correctly.
In your case, especially when you have different variables in AddColumn() for IF-Else, you have to click explore again because that forces the AFL to be executed to get new results.
If you want to compare, you can export results > right click > select all > copy
paste in spreadsheet like MS Excel etc
OR File > export html/csv ( again use windows tile for apps side-by-side )
OR You can open 2 analysis windows side by side also, with same AFL. Use AB > window > tile vertically
( *but note, you cannot open the same apx twice, you could use 2 different files )
An active chart appears to be continuously running , so there is no run button and that is why parameters seen to automatically update.
Analysis window is triggered by scan, explore, optimize, backtest buttons etc or by periodic auto-run from settings.
If you want more complexity, clicking the analysis parameter button does run the AFL but it does not update the output.
You can check by making an error in AFL and click parameter button (you will see error message box)
Obviously, you need to actually EXECUTE the code to have any effect.
How could anyone think it would happen without execution, I don't know. It is like expecting car to go anywhere without turning on the engine.
Having said that Analysis can be re-run periodically Net effect would be that any changes to parameters would be reflected automatically (in next rerun). It is just a matter of using built-in auto-repeat option, that is obviously described (like everything else) in the Users' Manual:
Auto-repeat interval can be entered in the Interval field. Note that plain numbers (like 5) represent minutes. To get seconds you need to enter 5sec or 5s and press ENTER
It is worth reading the manual. If you don't want to read it at least upload the manual to ChatGPT and ask AI, it is way better than making assumptions on how things work or don't work.
Finally, it makes very little sense to use the code as presented in this thread anyway. It is way better just to OPEN TWO ANALYSIS WINDOWS (File->New->Analysis) at once and run TWO different formulas. You will get BOTH results at once easily switchable using TAB.
I wonder why most obvious and best solutions are never used.