Add AUX1 and AUX2 Fields using AFL


I’d like to add certain calculations that take a lot of time to calculate…I’m using AddToComposite for this purpose but that has resulted in doubling the symbols in my database and I need to use Foreign always to retreive those metrics.

The Workaround would be ripping it to csv and Importing backk…is that the only way ?

Please let me know…


Alternative to AddToComposite is StaticVarAdd

…which is also generally faster :wink:

But i would like to add in Aux fields as static variables are erased from memory


Have you actually read the link carefully?
Have you read about persistency setting?
Obviously not.

BTW, persistency setting is part of all static var functions!
So if you would have clicked the further links at the bottom of staticvaradd link there then you would have come to here for example and would have read more about persistency setting.


Starting from version 5.80 there is a new parameter persist. If it is set to True then static variable will be stored in PersistVars.bin file when AmiBroker is closing and reloaded automatically on next startup, preserving the values of static variables between application runs). In addition to saving them automatically on exit, persistent static variables can be auto-saved at user-specified intervals using SetOption(“StaticVarAutoSave”, interval );

As noted static variables are generally better idea, but to answer original question you can use “1” and “2” in AddToComposite field to write to Aux1 and Aux2.
It is documented in the manual:

1 Like

perfect…got that…