Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 730 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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: 19
V
vicknick Offline
Newbie
vicknick  Offline
Newbie
V

Joined: Apr 2023
Posts: 19
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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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