Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Aku_Aku, VoroneTZ, 11honza11), 376 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 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: 58
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 58
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: 58
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 58
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