Gamestudio Links
Zorro Links
Newest Posts
history data for spy not work ?
by Grant. 06/10/23 17:58
Exact time of previous bar of higher timeframe
by AndrewAMD. 06/09/23 15:50
Enter Long Tomorrow at Open + Offset
by Groundhog. 06/09/23 08:50
server auto shutdown kill trades
by andy_trade. 06/08/23 08:52
New Zorro version 2.56
by phs. 06/07/23 20:16
simple question about if long is open
by faustf. 06/06/23 22:00
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (Grant, AndrewAMD, 7th_zorro, Quad), 1,166 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Vkvishal, Mishiwaka, frutza, BInnacle, androsa
18945 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Different BarPeriods #487483
05/12/23 21:08
05/12/23 21:08
Joined: May 2023
Posts: 1
T
tickserver Offline OP
Guest
tickserver  Offline OP
Guest
T

Joined: May 2023
Posts: 1
Hi,
I have a binary-option strategy that works quite well with BarPeriod=120. The problem is that run() is running now only at 0, 2, 4, 6... o'clock and I am missing additional trade opportunities at the full hours in between (1, 3, 5, ... o'clock).
I get the desired behavior by running my backtest once with BarOffset=0 and a second time with BarOffset=60. but I cannot find a way to put it together in one test-run.
I understand that changing BarOffset in run()-method does not work.
Next thing I tried was using BarPeriod=60 with TimeFrame=2 but this yields very different results (and even the documentation states that "...BarPeriod 60 and TimeFrame 1 is not the same as a script with BarPeriod 1 and TimeFrame 60...")

Any idea how to run a strategy based on H2-candles every hour (not only every 2 hours)?

Thx for your help!

Re: Different BarPeriods [Re: tickserver] #487488
05/15/23 13:46
05/15/23 13:46
Joined: Jul 2000
Posts: 27,956
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,956
Frankfurt
You need two overlapping time frames. Use BarPeriod = 60 and don't set Timeframe, but shift your series by script in alternating hours.


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