Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Force strategy to 1h (close as possible) #482074
12/16/20 08:51
12/16/20 08:51
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Any ideas how to "force" a Barperiod = 60; strategy script as close as possible to the full hour Barzone = ET; ???
Assets are currencies only.

Re: Force strategy to 1h (close as possible) [Re: danatrader] #482075
12/16/20 13:03
12/16/20 13:03
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Can you give an example of what you are trying to accomplish?

Re: Force strategy to 1h (close as possible) [Re: danatrader] #482083
12/20/20 08:52
12/20/20 08:52
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
I see trades are opened not at the full hour, I want to make sure run function runs at the full hour to open the trades.
I just enter trades with run function, not with a TMF.

I assumed using some basic sttings like below would put the strategy to the full hour?

StartWeek = 10000;
EndWeek = 52200;
BarPeriod = 60;
BarZone = ET;

Re: Force strategy to 1h (close as possible) [Re: danatrader] #482087
12/21/20 21:12
12/21/20 21:12
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
But if your BarPeriod is 60, your default BarOffset is 0, which means your bars start at the beginning of any given hour. Unless you're changing BarOffset or using NumSampleCycles , I'm not sure how you are getting any other behavior.
Quote
BarOffset
Bar start/end time offset in minutes; 0 or a positive number smaller than BarPeriod. Bars and frames normally start at a date/time boundary; f.i. 60-minute bars start at every full hour, and daily bars normally start at UTC midnight. This can be changed with BarOffset. For daily bars, BarOffset can be used to shift the bar begin to a certain number of hours and minutes after midnight. This is normally used to trade at a certain time using daily bars. BarOffset is also automatically set up by NumSampleCycles by dividing a bar into equal time intervals and decreasing the offset by one interval per cycle; on the last cycle, BarOffset is 0. By default, BarOffset is 940 with daily bars, and 0 on any smaller bar period.

What time are your run() functions occurring? Maybe record the time in a log.

Re: Force strategy to 1h (close as possible) [Re: danatrader] #482099
12/23/20 17:09
12/23/20 17:09
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
BTW:
- StartWeek/EndWeek are times in the BarZone time (if it is set). So, set it in ET: 71800 and 51701.
- EndWeek=52200 will EXCLUDE the 2200 bar from the week (ask jcl for the rationale)....You have to set it to >2200 , say, 52201 to get the commonly expected behavior.

Last edited by Zheka; 12/23/20 17:30.

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