backtesting: order not filled

Questions about MultiCharts and user contributed studies.
ts2mc
Posts: 122
Joined: 12 Jan 2009
Been thanked: 1 time

backtesting: order not filled

Postby ts2mc » 10 Mar 2010

Hello,
in my backtest , i have intrabar order generation enabled
for 1 min 6EH0 bars.
Each script call is written to a logfile [LOGFILE] (see below).
Also each action.
As you can see, my mc script initiates a short trade at 1.510000

the script command is:
SellShort ("Short") NbrContracts contracts next bar at 1.510000 limit;

But this order gets not filled (marketposition remains 0), but it should because a subsequent tick
is above my limit [The Tick] (see below).

[LOGFILE]
01.12.2009 11:36:00 Short open=1.509800 close=1.509800 high=1.509800 low=1.509800 #=82 price=1.510000
01.12.2009 11:36:00 TICK open=1.509800 close=1.509800 high=1.509800 low=1.509800 #=82
01.12.2009 11:36:00 TICK open=1.509800 close=1.509800 high=1.509800 low=1.509800 #=82
01.12.2009 11:36:00 TICK open=1.509800 close=1.509800 high=1.509800 low=1.509800 #=82
[The Tick which should cause simulation to fill order]
01.12.2009 11:37:00 TICK open=1.510200 close=1.510200 high=1.510200 low=1.510200 #=83
01.12.2009 11:37:00 TICK open=1.510200 close=1.510200 high=1.510200 low=1.510200 #=83
...no fill
Anyone know, why my limit order was not filled, even market goes over
its limit price ?

(# for barnumber)
thank you

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 10 Mar 2010

did you enable precision?
at what level?

ts2mc
Posts: 122
Joined: 12 Jan 2009
Been thanked: 1 time

Postby ts2mc » 10 Mar 2010

Hello TJ,
each time i enable precision 1 tick (magnifier)
i get an error and this feature is disabled.

the tick that should give the fill, is an open tick.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 11 Mar 2010

Hello TJ,
each time i enable precision 1 tick (magnifier)
i get an error and this feature is disabled.

the tick that should give the fill, is an open tick.
if you have not enabled precision backtesting,
you would not get an intrabar order fill.


it is most likely that your tick data is not complete.

ts2mc
Posts: 122
Joined: 12 Jan 2009
Been thanked: 1 time

Postby ts2mc » 11 Mar 2010

i have no ticks for this symbol as IB gives only historical
timebased data (1 min).
i thought that exactly this, testing min bars like tick data,
is the purpose of intradbar order generation.

it is really not much want i want: to be able triggered an order or
get a filled within High and Low of current (historical) Bar.

Do you have an idea how to do this ?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 11 Mar 2010

i have no ticks for this symbol as IB gives only historical
timebased data (1 min).
i thought that exactly this, testing min bars like tick data,
is the purpose of intradbar order generation.

it is really not much want i want: to be able triggered an order or
get a filled within High and Low of current (historical) Bar.

Do you have an idea how to do this ?
you can only use PRECISION backtesting IF you have a finer resolution data.
e.g testing 5min with 1min.

otherwise you have to use regular backtesting,
which is executed at EOB (end of bar).


note:
Backtesting is not perfect, even if you have tick data.
Backtesting is not a 100% simulation of the real world.

understanding and accepting the fact that backtesting is not perfect,
you just have to find a median where a testing method/procedure can be used to validate your trading concept.


Return to “MultiCharts”