Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
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
4 registered members (AndrewAMD, SBGuy, TipmyPip, ozgur), 923 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Trading few minutes before market close #465440
04/27/17 16:21
04/27/17 16:21
Joined: Nov 2016
Posts: 66
GreenBoat Offline OP
Junior Member
GreenBoat  Offline OP
Junior Member

Joined: Nov 2016
Posts: 66
I have a basic question about testing and life trading.

I would like to trade only once per day, every day at 15:50-15:55, 5-10 minutes before the market close.

I want to check today's Close price and if the price meets my requirements, I want to enter the trade, for the same price (+- slippage). In real trading, I would check actual price from a broker, few minutes before the market closes and then send orders. When backtesting, I don't know what was the price 5 minutes before market close (I have only daily data), but for testing purposes, I can say that it was the close price.

Re: Trading few minutes before market close [Re: GreenBoat] #465466
04/29/17 08:19
04/29/17 08:19
Joined: Nov 2016
Posts: 66
GreenBoat Offline OP
Junior Member
GreenBoat  Offline OP
Junior Member

Joined: Nov 2016
Posts: 66
I was thinking about it and I think that I can answer the question:

Zorro manual: "The strategy script is run at the end of every bar, and buy or sell commands are executed at the price of the begin of the next bar."

And BarOffset: "Bar start time offset in minutes. For daily bars, BarOffset determines the UTC minute into the day when the candle opens, and can be used to shift the bar begin to a certain local or global time."

I believe that the thing I am trying to do (trade few minutes _before_ the end of every bar, not after the bar) might work by setting the BarOffset.

Something like this (for SPY):
BarPeriod = 1440; // 1 bar is 24 hours
BarZone = ET; // SPY is located in New York
BarOffset = 15*60 + 50; // set the bar end to 15:50, 10 minutes before the market close

I think that this solves the problem with live trading, but I don't think it solves the problem with backtesting. I think that when backtesting, Zorro starts the trade at the open price of the next bar. I am going to test it. Anyway, it is probably good enough for testing and trading.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1