|08-21-2008, 12:05 PM||#1|
Join Date: Feb 2007
Location: , ,
Thanked 0 times in 0 posts
I have a strategy that enters and exits with limit orders, but always bids and offers 1 tick better to guarantee the fill. However, the trades are not always being filled on the back-test. For example, this is the code I am using for the exit order:
exit_price = Open - TickSize;
exit_order_id = generate_tag(0) + "_exit";
exit_order = ExitLongLimit(exit_price, entry_order_id);
As you can see, this code should pretty much always get the fill since it is exiting at a one tick premium to the market. However, the trade sometimes does not execute on the chart for the back-test until about 3 bars after it should. Any reason for this or have I just made a coding error? I would use market orders but that significantly throws off the back-test results. If it makes any difference, all of the variables used above have been declared earlier in the strategy which is why i don't have it written as "string exit_order_id = " and so forth.
|08-21-2008, 12:14 PM||#2|
Join Date: Nov 2004
Location: Denver, CO, USA
Thanked 45 times in 32 posts
Why do you think the order is filled three bars later than it should? I would print out the price of the ordernand the Time of the bar where the order is initially placed, then check the chart and determine how the order is filled based on the following fill type selected during backtest.
The two system fill algorithms are:
An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.
An algorithm that takes a liberal approach to filling limit and stop limit orders.
NinjaTrader Customer Service
|Thread||Thread Starter||Forum||Replies||Last Post|
|Partial Fills||SystemTrading||Miscellaneous Support||1||08-20-2008 08:43 AM|
|Partial Fills||Harry||ATM Strategies (Discretionary Trading)||5||02-26-2008 06:25 AM|
|simulated fills||andrewbee||Strategy Development||1||12-27-2007 12:08 PM|
|deleting spurious trade from sim trade list||Arbitrageur||Miscellaneous Support||2||09-12-2006 03:59 AM|
|External fills||tonchi||Miscellaneous Support||3||07-20-2006 06:04 AM|