Gamestudio Links
Zorro Links
Newest Posts
Bulk-parse CSV files from whole directory
by jack_the_whack. 08/13/22 07:57
Zorro_setup.exe detected with virus
by Grant. 08/12/22 09:03
ARM support for Zorro?
by AndrewAMD. 08/11/22 19:54
DeepLearn script
by jcl. 08/10/22 12:58
New Zorro version 2.50
by hast29. 08/09/22 15:50
linux
by AndrewAMD. 08/08/22 14:23
AUM Magazine
Latest Screens
DEAD TASTE
Tactics of World War I
Hecknex World
Scheherazade's Journey
Who's Online Now
4 registered members (nerdkorea, Quad, jack_the_whack, Grant), 423 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
boony, jack_the_whack, MrMan, nerdkorea, marconius
18812 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: 24
N
NorbertSz Offline OP
Newbie
NorbertSz  Offline OP
Newbie
N

Joined: Jan 2022
Posts: 24
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: 556
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 556
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: 24
N
NorbertSz Offline OP
Newbie
NorbertSz  Offline OP
Newbie
N

Joined: Jan 2022
Posts: 24
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: 556
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 556
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