NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 09-17-2011, 11:23 AM   #1
blar58
Senior Member
 
Join Date: Jun 2010
Posts: 218
Thanks: 1
Thanked 2 times in 2 posts
Default If market high and low trades at exact order price no fill

Hi

I have detected a problem in my orders which is quite weird.

I have EnterLongLimit and EnterShortLimit orders that don't get filled when bar High or Low hits exactly the price entry.

Looking at the order in the output window I see that the order was sent successfully but not executed.

If I change the price entry by 1 tick higher or lower ( + / - TickSize ) I get the execution but the problem is the same if the market trades at that exact price. Order sent but not filled !

The order stays there until the market trades at that price + - 1 Tick.

Example :
Code:
_entryBOrder1 = EnterLongLimit( 0, true, qty, PriceLevel , "B1");
Price Level in this example is 708.10 ( Russell ).

If BarLow = 708.10. Order sent. Not executed....!
If BarLow = 708.00. Order sent and executed.

Any idea for such a behavior ?


Thanks
blar58 is offline  
Reply With Quote
Old 09-17-2011, 12:52 PM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

blar, your order is most likely being submitted just fine, but when your order gets submitted it gets put in last place for execution. All exchanges operate on a first-in, first-out basis, which means that if 10 people all submit orders for 10 contracts each at 708.1, and then you place an order for one contract at the same price, all 100 contracts ahead of you would need to be filled before yours gets filled.

If you keep your order open long enough, it will be filled when all contracts ahead of you in line have been filled.

Please let me know if you have any other questions.
NinjaTrader_Austin is offline  
Reply With Quote
Old 09-19-2011, 01:07 PM   #3
blar58
Senior Member
 
Join Date: Jun 2010
Posts: 218
Thanks: 1
Thanked 2 times in 2 posts
Default

OK

I understand that it could happen real time but is NinjaTrader behave like that with historical data as well ?


Thanks
blar58 is offline  
Reply With Quote
Old 09-19-2011, 01:38 PM   #4
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,777
Thanks: 158
Thanked 565 times in 556 posts
Default

blar58,

Can you please clarify if this is happening in simulation real-time/market replay or in backtesting?

If backtesting are you using the default (conservative) or liberal fill type?
NinjaTrader_Matthew is offline  
Reply With Quote
Old 09-19-2011, 01:52 PM   #5
blar58
Senior Member
 
Join Date: Jun 2010
Posts: 218
Thanks: 1
Thanked 2 times in 2 posts
Default

Matthew

I am looking at backtesting and the Fill Type is set to Default
blar58 is offline  
Reply With Quote
Old 09-19-2011, 03:28 PM   #6
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,777
Thanks: 158
Thanked 565 times in 556 posts
Default

Hello,

Please try using Liberal and test again. Definitions from our Help Guide section on Understanding historical processing options

Default
An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.
•Limit orders only fill if the limit price was penetrated
•Limit orders are always filled at the limit price specified never better (for example, if a limit order is submitted on bar n, NinjaTrader will check if the order is filled on bar n+1, if this bar gaps down and the limit order was a buy, the order would be filled at the limit price and NOT the high of bar n+1)

Liberal
An algorithm that takes a liberal approach to filling limit and stop limit orders.
•Limit orders fill if the limit price was touched
•On gap down bars, buy limit orders will fill at the high of the gap down bar
•On gap up bars, sell limit orders will fill at the low of the gap up bar

http://www.ninjatrader.com/support/h...a_strategy.htm
NinjaTrader_Matthew is offline  
Reply With Quote
Reply

Tags
enterlonglimit, no execution

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestion: Open[], High[], Low[] and Close[] should always contains price data MikeInMA Suggestions And Feedback 4 01-11-2011 11:17 AM
Show the price marker in a different color when the price is a new low or a new high. vanguard_xie Charting 1 06-13-2010 07:35 AM
Order Fill Price RJay Strategy Development 19 04-17-2009 01:12 PM
Accessing order fill price and quantity NinjaTrader_Ray Strategy Development 2 01-03-2008 12:16 AM
Prior Bar High Or Low OCO Order jstockman Strategy Development 18 09-10-2007 08:09 PM


All times are GMT -6. The time now is 10:56 PM.