Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
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
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 770 guests, and 6 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
Creating sub 1 second bars #487435
04/20/23 19:36
04/20/23 19:36
Joined: Apr 2023
Posts: 3
T
thumper14 Offline OP
Guest
thumper14  Offline OP
Guest
T

Joined: Apr 2023
Posts: 3
Hello all!

I am trying to develop a strategy that trades based on bars that are less than one second. Per the user manual, "...and since Zorro allows bar periods down to 1 millisecond..."

I cannot figure out how to take advantage of this feature. For example, in my script:

History = "*.t1";
BarPeriod = 60./60;
set(TICKS);
This yields 60 second bars.

History = "*.t1";
BarPeriod = 1./60;
set(TICKS);
This yields 1 second bars

History = "*.t1";
BarPeriod = 0.1/60;
set(TICKS);
This appears to round bars up to 1 second. I also tried ".1/60" as well, same apparent result.

How do I generate, for instance, 10ms bars?

Cheers!

Re: Creating sub 1 second bars [Re: thumper14] #487436
04/20/23 20:39
04/20/23 20:39
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
By using 'BarPeriod = 0.01/60', I believe.

https://zorro-project.com/manual/en/barperiod.htm

Re: Creating sub 1 second bars [Re: thumper14] #487437
04/21/23 15:25
04/21/23 15:25
Joined: Apr 2023
Posts: 3
T
thumper14 Offline OP
Guest
thumper14  Offline OP
Guest
T

Joined: Apr 2023
Posts: 3
Grant, thanks for the reply.

Yes, that is correct, but after more digging, that's only the first step. Fill mode must be set to "8"

"Order filling and HFT Simulation"
https://zorro-project.com/manual/en/fill.htm

"Zorro can be used for testing HFT systems in Fill mode 8."

So, even though my original post had the correct syntax for "BarPeriod" I did not have the Fill Mode set to 8. This is what I was able to get to run to generate 10ms bars:
History = "*.t1";
BarPeriod = .01/60;
Fill = 8;
set(TICKS);

I missed this originally because, for the purpose of my work, I'm not attempting to do an "HFT" strategy, but instead, taking traditional strategy ideology (using candles and an indicator soup approach) and doing it fast.

NOTE - it would appear that, in this case, it's not "building" 10ms bars, as in accumulating the price changes across those 10ms (there's no Open, High, Low, Close like a traditional candle), but instead, getting the last price every 10ms and just plotting that. This begs the next question, what is the 10ms time change based on? Every 10ms since the market open, the backtest start period/time, systematically stepping through every 10ms (i.e. 10:00:00.010; 10:00:00.020;10:00:00.030...) or some other method, I don't know, but that is a future problem to solve.

Bottom Line, with Fill = 8, you can chart and backtest with sub one second bars, even if you're not doing an "HFT simulation." Fun facts!

Re: Creating sub 1 second bars [Re: thumper14] #487438
04/21/23 19:34
04/21/23 19:34
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
A .t1 data set is based on bid / ask tick data, which has no linear intervals, so there's no open-high-low pricing. A 10 ms interval simply checks the last bid or ask, so sometimes there's a price change, sometimes there isn't.

https://zorro-project.com/manual/en/history.htm

Last edited by Grant; 04/21/23 19:34.

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1