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
2 registered members (Imhotep, opm), 785 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 does backtesting handle stops in the middle of a bar? #484955
01/04/22 21:52
01/04/22 21:52
Joined: Oct 2014
Posts: 42
DEVON
S
scotpip Offline OP
Newbie
scotpip  Offline OP
Newbie
S

Joined: Oct 2014
Posts: 42
DEVON
Hi

Evaluating Zorro for a new project. Trying to understand how the backtester handles the scenario where a resting stop is straddled by a bar during bar-resolution backtesting.

According to the docs:

Quote
When entry, stop, or profit limits are triggered by the high or low of a historical tick or by OrderDelay in realistic fill mode, positions are filled in this way:
Long Entry stop: max of Entry and tick end price.
...


https://manual.zorro-project.com/conversion.htm

Unless I'm misreading this, it doesn't seem to make sense.

Say price is at 0.01 and I have a long entry stop sitting at 0.02, and the next bar closes at 0.08.

I would expect the backtester to open the trade at 0.02 + the allowance for spread and slippage.

But "the max of Entry and tick end price" would open the trade at 0.08 + spread and slippage.

The docs call this "slightly pessimistic". But it's surely far too conservative, and would distort the backtest results? Especially if the entry stop was at the start of a large bar.

Can someone please clarify. Am I misunderstanding something?

Last edited by scotpip; 01/04/22 21:59.
Re: How does backtesting handle stops in the middle of a bar? [Re: scotpip] #484969
01/05/22 08:56
01/05/22 08:56
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Apparently. Believe me, when a price really rises by 800% in a single tick, you want a realistic backtest rather than a bad surprise in live trading.

Re: How does backtesting handle stops in the middle of a bar? [Re: scotpip] #484977
01/05/22 14:28
01/05/22 14:28
Joined: Oct 2014
Posts: 42
DEVON
S
scotpip Offline OP
Newbie
scotpip  Offline OP
Newbie
S

Joined: Oct 2014
Posts: 42
DEVON
Thanks for responding.

We have extensive experience of trading this system manually and aren't seeing anything remotely approaching that level of slippage in practice.

As this is central to the system it seems that Zorro won't be well suited to this automation project.

I'd urge you to consider making this configurable, so backtesting can be tuned to what we are experiencing in our trading venue...

Last edited by scotpip; 01/05/22 14:29.
Re: How does backtesting handle stops in the middle of a bar? [Re: scotpip] #485022
01/10/22 13:13
01/10/22 13:13
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
All is configurable, but the problem is maybe you simply confused ticks witrh bars?

Tick = price quote in historical data
Bar = Time period of a candle

I think the default settings are pretty good, the Zorro backtester is probably one of the most accurate on the market. But if you want more optimistic backtests, use naive fill mode, Fill = 0.

Re: How does backtesting handle stops in the middle of a bar? [Re: scotpip] #485023
01/10/22 13:25
01/10/22 13:25
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
jcl promised to implement this feature for limit orders: https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=484613#Post484613

The same setting can be made to work also for entry stops.

Try setting Slippage=0 and see if this gets you closer to the desired situation.

And check 'ticks' (be it M1 bars or real ticks) in the t6 file: is there indeed a gap at the time of entry?


Last edited by Zheka; 01/10/22 13:25.
Re: How does backtesting handle stops in the middle of a bar? [Re: scotpip] #485036
01/11/22 09:05
01/11/22 09:05
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
A flat fill price offset is planned for the next release. But indeed, when I see the title of this thread, it seems a confusion of ticks and bars - if it were bars, the complain would make some sense.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1