Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Nymphodora, Quad), 923 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Multiple timeframes: prevent loading unnecessary data [Re: Petra] #486325
07/30/22 17:14
07/30/22 17:14
Joined: Jan 2022
Posts: 57
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 57
Using different datasets to the different timeframes would be exactly the solution I am looking for. Could you give me a clue how can I achieve this?

If I understand you well, I need to do the following, by two different scripts (because of the different BarPeriod)

Code
[loader.c]
- start a loader script, BarPeriod = 60*4, LookBack = X
- load the X H4 bar data by iterating every assets, from the broker
- save as file, as a CSV dataset
[trader.c]
- start the trading script: BarPeriod = 1, LookBack = X
- load the H4 dataset from file, and use the prices to analyze
- analyze M1 bars normally, make the decisions, make trading


And everytime I start trading, I need to first run the loader to download the H4 bars as datasets.
Am I correct?

I see the dataset help page,
https://zorro-project.com/manual/en/data.htm
but still can't figure out how can I use datasets it in the same way as backesting as realtime trading, because I need to update somehow the H4 dataset time-by-time, during the backtesting and also in the trading

Last edited by NorbertSz; 07/30/22 17:21.
Re: Multiple timeframes: prevent loading unnecessary data [Re: NorbertSz] #486326
07/31/22 08:16
07/31/22 08:16
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Suppose your H4 data is in column 1 of dataset H, then

var PriceH4 = dataVar(H,dataFind(H,wdate(0)),1);

Re: Multiple timeframes: prevent loading unnecessary data [Re: Petra] #486333
08/01/22 13:50
08/01/22 13:50
Joined: Jan 2022
Posts: 57
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 57
So a possible solution:

When I start the "trader.c" script (BarPeriod = 1), in it's INITRUN it executes another script, let's call it "loader.c":
The "loader.c" (BarPeriod = 60*4) does nothing else but downloads/saves the H4 bars to datasets. It should read a parameter somehow from the "trader.c", because it should work the same way as I run the "trader.c" as Test mode (via an old StartDate), as with Trade mode. So it reads the mode and the StartDate, it goes through the LOOKBACK period, then saves the datas of assets, then imediately just quit(), giving back the processor to the "trader.c" script.
Then the "trader.c" script loads the assets' H4 datas to vars, then uses it to the Testing or the Trading session. And of course, the whole process mentioned above is just for start the testing/trading - after start, the "trader.c" script should take care of updating the H4 vars in the future, everytime a new H4 bar arrives.

And this is the only way I can use exactly the X amount of H4, and X amount of M1, with avoiding the unnecessary bar loadings.

Petra, did you mean this process, or am I overcomplicating the whole thing?

Last edited by NorbertSz; 08/01/22 13:52.
Re: Multiple timeframes: prevent loading unnecessary data [Re: NorbertSz] #486334
08/02/22 10:32
08/02/22 10:32
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Yes it sounds complicated. I would not use 2 scripts but only one. Load the data at start with assetHistory in a dataset. You'll get H1, not H4, but you can then simply use only every 4th record.

Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1