First call of asset() affects the frequency of the bars

Posted By: vinitrinh

First call of asset() affects the frequency of the bars - 11/22/22 11:19

Hello,

The number of bars fed into Zorro changes and depends on the first asset call.

If asset("HK33") precede asset("SPX500"), the printed SPX500 bars last from 0100 UTC to 0830 UTC, otherwise SPX500 bars covers virtually the whole day as it should. (these are OANDA tickers) (images of the printed bars attached) This directly affects my standalone SPX500 trading strategy.

Is this a feature or a mistake?
What are some other implications if we place SPX500 in front, would it affect my algo trading HK33?

I'd like to run a trend following strategy on multiple index tickers as well and keep them into a single script.
Seeing this, should we separate them by instruments then?

Thank you.

Code
#include <profile.c>
#include <CustomIndicators.c>
#include <IndicatorIO.c>

function run() 
{
    // ===========
    // BACKTEST PARAMETERS
    // ===========

    // backtest parameters
	BarPeriod = 60;

    StartDate = 20110421;
    EndDate = 20110428;

    // Spread = 0;
    // Slippage = 0;
    LookBack = 450;
    set(LOGFILE,PLOTNOW); // log all trades
    setf(PlotMode, PL_FINE);

    // instrument parameters
    assetList("AssetsOanda.csv");
    // asset("HK33");
    asset("SPX500");
    
    
    asset("SPX500");
    printf("|%02i/%02i/%02i %02i:%02i| %f | \n", day(),month(),year()%100,hour(),minute(), priceClose());
    asset("HK33");

    // plot the necessary components
	PlotWidth = 800;
}


Attached picture asset_hk33.png
Attached picture asset_spx.png
Posted By: Spirit

Re: First call of asset() affects the frequency of the bars - 11/28/22 14:48

The manual is your friend.
© 2024 lite-C Forums