Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to buy tomorrow at open? #487534
06/01/23 19:58
06/01/23 19:58
Joined: Jun 2023
Posts: 3
F
frutza Offline OP
Guest
frutza  Offline OP
Guest
F

Joined: Jun 2023
Posts: 3
During backtesting, it seems that the enterLong() or enterShort() functions enter trades at the CLOSE of the next day (after a buy or sell signal was generated today by whatever strategy is used).
How can I enter a trade at the OPEN of the next day?

Thank you in advance! Any answer and/or example is highly appreciated, as I couldn't find anything in the manual or this forum.

Last edited by frutza; 06/01/23 20:00.
Re: How to buy tomorrow at open? [Re: frutza] #487536
06/02/23 03:19
06/02/23 03:19
Joined: Apr 2023
Posts: 18
V
vicknick Offline
Newbie
vicknick  Offline
Newbie
V

Joined: Apr 2023
Posts: 18
Maybe you could run tick() once at the end of each bar? This will trigger the function upon the next incoming price tick (which should be the open of the new bar).

Re: How to buy tomorrow at open? [Re: vicknick] #487551
06/04/23 21:06
06/04/23 21:06
Joined: Jun 2023
Posts: 3
F
frutza Offline OP
Guest
frutza  Offline OP
Guest
F

Joined: Jun 2023
Posts: 3
Sound interesting, although a bit complicated. Can you please provide a code example? Thank you, much appreciated!

Re: How to buy tomorrow at open? [Re: frutza] #487554
06/05/23 09:21
06/05/23 09:21
Joined: Jun 2023
Posts: 8
Denia
Mishiwaka Offline
Newbie
Mishiwaka  Offline
Newbie

Joined: Jun 2023
Posts: 8
Denia
Hard to say without seeing a code, but my suggestion will be to go to the lower timeframes and apply something like
if (hour(0)==0) cycle, but anyway if a signal would not be generated before the day opening that will be no deal.

Re: How to buy tomorrow at open? [Re: frutza] #487558
06/05/23 14:16
06/05/23 14:16
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
You need normally no complex code. For simply entering at the next bar open, set Fill = 3.

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

Re: How to buy tomorrow at open? [Re: jcl] #487566
06/06/23 02:26
06/06/23 02:26
Joined: Jun 2023
Posts: 3
F
frutza Offline OP
Guest
frutza  Offline OP
Guest
F

Joined: Jun 2023
Posts: 3
Thank you all for your replies. Interesting, and much appreciated!

JCL, thank you for coming to the rescue. Fill = 3 is EXACTLY what I was looking for. Does this work the same on any bars, or only on daily bars? I couldn't figure out the answer by reading the page you indicated. Thanks in advance!

Last edited by frutza; 06/06/23 02:27.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1