How to pass data series() to TMF without globals

Posted By: Raven478

How to pass data series() to TMF without globals - 09/14/21 11:57

Good day,

Is it possible to pass in a vars / series into the TMF without using globals?

The TMF uses a specific series to trail the stoploss. For context, I am running multi assets and algos in the same script hence why I can't use globals.
Posted By: Zheka

Re: How to pass data series() to TMF without globals - 09/14/21 22:34

You can declare a global array of vars and pass just the index of the needed series in that array to the tmf.
Posted By: Petra

Re: How to pass data series() to TMF without globals - 09/15/21 06:29

In asset loop:

AssetInt[0] = series(...);

In the TMF:

vars MySeries = AssetInt[0];
Posted By: Raven478

Re: How to pass data series() to TMF without globals - 09/15/21 08:35

Thanks for both replies @Zheka and @Petra. And the code sample is much appreciated @Petra. smile
© 2024 lite-C Forums