![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2010
Posts: 218
Thanks: 1
Thanked 2 times in 2 posts
|
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"); If BarLow = 708.10. Order sent. Not executed....! If BarLow = 708.00. Order sent and executed. Any idea for such a behavior ? Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
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.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jun 2010
Posts: 218
Thanks: 1
Thanked 2 times in 2 posts
|
OK
I understand that it could happen real time but is NinjaTrader behave like that with historical data as well ? Thanks |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,777
Thanks: 158
Thanked 565 times in 556 posts
|
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?
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2010
Posts: 218
Thanks: 1
Thanked 2 times in 2 posts
|
Matthew
I am looking at backtesting and the Fill Type is set to Default |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,777
Thanks: 158
Thanked 565 times in 556 posts
|
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 up bars, sell limit orders will fill at the low of the gap up bar •On gap down bars, buy limit orders will fill at the high of the gap down bar http://www.ninjatrader.com/support/h...a_strategy.htm
Matthew
NinjaTrader Customer Service |
|
|
|
![]() |
| Tags |
| enterlonglimit, no execution |
| Thread Tools | |
| Display Modes | |
|
|
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 |