It can definitely be done with static variables.  Details and best way to reach 
your goal may depend on exactly what data you want to pass.

One thing that slowed me down when I first tried to do this sort of thing was 
not properly recalling the context of phase 2 of the backtest.  The symbol 
price data and your per-symbol TA calcs are gone in phase 2, the active symbol 
is ~~~EQUITY, and what you have to work with are the signal and trade lists 
which were constructed in phase 1.

Of course, if you've saved something as a static, it will be there also.

If your desired data-to-pass is per-symbol data, be sure to name your statics 
that way.  Then, in the CBT, you can determine the symbol being processed via 
trade.symbol or signal.symbol, re-construct the correct static name, and access 
the saved static data.


--- In [email protected], "Pmxgs" <pm...@...> wrote:
>
> Hi,
> 
>  I need to pass some data from the first phase of the baktest to the 2nd 
> phase.
> 
>  I think that both addtocomposit and static variables can do this, but I'm 
> not sure.
> 
>  What is the best way do do it?
> 
>  thanks
>


Reply via email to