Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, exile, Ayumi), 1,085 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
First call of asset() affects the frequency of the bars #486943
11/22/22 11:19
11/22/22 11:19
Joined: Apr 2022
Posts: 18
Singapore
V
vinitrinh Offline OP
Newbie
vinitrinh  Offline OP
Newbie
V

Joined: Apr 2022
Posts: 18
Singapore
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 Files asset_hk33.pngasset_spx.png
Re: First call of asset() affects the frequency of the bars [Re: vinitrinh] #486951
11/28/22 14:48
11/28/22 14:48
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
The manual is your friend.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1