Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
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
2 registered members (ozgur, TipmyPip), 722 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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