Gamestudio Links
Zorro Links
Newest Posts
Links dont work
by HamzaAhmed. 05/19/22 08:07
Unable to make new structures
by vinitrinh. 05/19/22 06:04
C++ scripts
by AndrewAMD. 05/18/22 16:43
Help with sorting data array
by degenerate_762. 05/18/22 12:24
How to use dataFromCSV
by AndrewAMD. 05/16/22 16:43
MT4, handling requote issues
by Grant. 05/15/22 00:04
Lapsa's very own thread
by Lapsa. 05/14/22 22:59
AUM Magazine
Latest Screens
DEAD TASTE
Tactics of World War I
Hecknex World
Scheherazade's Journey
Who's Online Now
7 registered members (Quad, degenerate_762, 3run, HamzaAhmed, Grant, vinitrinh, alibaba), 262 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Abdou, quandr, SGB1962, QuadraQuant, IcairDap
18781 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Feature Request: more realism for Limit order execution #484613
11/19/21 13:48
11/19/21 13:48
Joined: Jul 2017
Posts: 749
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 749
To aid realism to backtesting fills of limit orders - be it from Entry or TakeProfit - it would be very useful to be able to specify the extent of "overshoot" over the limit price.

This can be a separate Fill (or Slippage) mode, where
e.g. setting Fill= -0.3*PIP will fill limit order when trade price goes beyond limit price by 0.3 pips.

Thank you in advance.

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #484641
11/23/21 10:12
11/23/21 10:12
Joined: Jul 2000
Posts: 27,777
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,777
Frankfurt
That makes sense. Will be implemented in a future version.

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #485039
01/11/22 09:56
01/11/22 09:56
Joined: Jul 2017
Posts: 749
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 749
jcl, can you pls elaborate on what you mean by a "flat fill price offset"?
Quote
A flat fill price offset is planned for the next release

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #485040
01/11/22 11:08
01/11/22 11:08
Joined: Jul 2000
Posts: 27,777
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,777
Frankfurt
>>Penalty
Alternative simulated slippage in counter currency units (default = 0), used in [Test] mode for entering and exiting trades and for entry and exit limits. Overrides Slippage and the limit fill algorithm (see Fill) when nonzero. Has no effect in [Train] mode. Orders are filled at the current price with Penalty either added or subtracted dependent on trade direction. <<

It is not the same as you proposed, but can be used for the same purpose.

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #485041
01/11/22 14:25
01/11/22 14:25
Joined: Jul 2017
Posts: 749
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 749
Hmmm...do i understand correctly that Penalty=-0.5*PIP will make fill price more advantageous then that set by Entry limit ? (and will allow setting a fixed 'slippage' in pips, rather than seconds, for stops?)

If so, then - for limits - this works counter to the 'realism' objective:
a) filling limits at better prices is a rare 'bonus' not to be counted on in development/evaluation and
b) the order will still fill (!)- even though at possibly a worse price...while it might not at all in reality...Which was the whole point of asking for a 'safety margin' on fill/no fill in testing...and training such a system.

What would be the way to use Penalty for such purpose?

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #485042
01/11/22 14:54
01/11/22 14:54
Joined: Jul 2000
Posts: 27,777
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,777
Frankfurt
It fills at worse prices. Which is why it's named 'penalty'. Otherwise we had called it 'bonus'.

If you just want an order not to fill at Entry, you need no extra variable. Simply add something to Entry.

Re: Feature Request: more realism for Limit order execution [Re: jcl] #485043
01/11/22 16:39
01/11/22 16:39
Joined: Jul 2017
Posts: 749
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 749
Originally Posted by jcl
It fills at worse prices. Which is why it's named 'penalty'. Otherwise we had called it 'bonus'.
This will simulate stop fills more realistically...but limits?

Originally Posted by jcl
If you just want an order not to fill at Entry, you need no extra variable. Simply add something to Entry.
This would not work you optimize an Entry limit. A "safety margin" would guard against picking the exact highs/lows.

Can negative Penalty be made to work the way I originally suggested? (in Train)

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #485048
01/12/22 08:11
01/12/22 08:11
Joined: Jul 2000
Posts: 27,777
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,777
Frankfurt
I understand your explanations so that you want to place a long order at $100 limit, but it should be triggered not at $100, but at $99, but fill still at $100. That would be Entry = -99, Penalty = 1. Otherwise please explain what you want to achieve and to what purpose, preferably with an example.

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #485049
01/12/22 10:00
01/12/22 10:00
Joined: Jul 2017
Posts: 749
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 749
Say, I want to see if entering at limit can help squeeze some extra performance.

The first easy step is Entry = - optimize(1, 1, 10, 1);

Say, 10% of trades have a MAE of 7 (sharp) and 10% - 7.1-7.5

Any combination of Entry and Penalty will result in the EXACT price level, and so the optimization will find Entry=-7 as the optimum (but will apply a Penalty to results).

But such trades entered at exact highs/lows - most probably responsible for a disproportionately big share of profit - are unrealistic.

So, it would be very useful to specify the extent of MINIMUM "overshoot" over the limit price (either from Entry or TakeProfit), meaning fills happen when price goes beyond limit price by AT LEAST X.

With Penalty= - 0.6, the optimum Entry in this example will be found in Train as -6.

Primary utility of such feature is in Train mode. (In Test - any desired limit entry can be simulated as you suggested).

Re: Feature Request: more realism for Limit order execution [Re: Zheka] #485052
01/12/22 12:16
01/12/22 12:16
Joined: Jul 2000
Posts: 27,777
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,777
Frankfurt
When 10% trades have MAE 7, the optimization result is unknown. When we assume that 100% trades have MAE of exactly 7, the optimized Entry is -7. The trade would then be filled at current price - 7 + Penalty. Since Penalty applies to all trades, it has no effect on the optimization. You would then set the live order limit at Entry + Penalty, because that is the fill price that you get from the broker. The live result will then match the backtest. The specified Penalty is your overshoot.


Page 1 of 2 1 2

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1