Global var for each chart - afl in afl plugin

I want to create some environment variables in the afl plugin and use them for all the functions in the afl plugin, but I want to use each environment variable for each chart. What advice do you have for this method?

The way I think of is to create a function of init( .... ) in afl plugin and pass the variable I want to set to afl plugin .

Afl plung reuses the parameters in init to establish the overall variable usage, but there is a problem. When there are several charts that use init to establish environment variables, they will conflict with each other. Is there any way to do this for each afl - chart? Create different environment variables in afl plugin

Not tested myself but I guess you can work with ChartID which can be implemented by you to be unique.

https://www.amibroker.com/guide/afl/getchartid.html

Read the whole KB here:
http://www.amibroker.com/kb/2014/10/06/relationship-between-chart-panes/

If you want uniqueness per symbol, then you can make a complex form like ChartID+Symbol etc