![]() |
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 |
|
Member
Join Date: Mar 2012
Location: DFW, TX
Posts: 40
Thanks: 3
Thanked 7 times in 4 posts
|
I have a strategy that enters the market via Limit Order at a moving average.
As the strategy is set to calculate on each tick, it appears the strategy is constantly canceling an order then reentering it - even though the limit price has not changed Is this normal? Is there a way to stop this from happening? if (Signal[1] > 0 && Close[0] >= KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0] ) if(Position.MarketPosition == MarketPosition.Flat) // allows only 1 trade per direction EnterLongLimit(1,KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0], "ZLRe1"); |
|
|
|
|
|
#2 | |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello RodS7,
If a limit order is not filled on the bar to which it was submitted then the order is cancelled unless it is explicitly told not to do so. You can tell it by using the below overload and setting the liveUntilCancelled property to true. Quote:
Please modify your code as per below and see if the order remains live or not. Code:
if (Signal[1] > 0 && Close[0] >= KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0] ) if(Position.MarketPosition == MarketPosition.Flat) // allows only 1 trade per direction EnterLongLimit(0, true, 1, KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0], "ZLRe1");
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2012
Location: DFW, TX
Posts: 40
Thanks: 3
Thanked 7 times in 4 posts
|
That did it - thanks again
Is there somewhere that lists all functions that I need to address using "barsInProgressIndex" on MTF indicators / strategies? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello RodS7,
Glad to know everything is working fine at your end. To know more about BarsInProgress please refer to our help guide here http://www.ninjatrader.com/support/h...inprogress.htm To know more about multi-series, please refer here http://www.ninjatrader.com/support/h...nstruments.htm Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strategy with ATM and cancelling non-filled order at bar close | Baseheadz | Strategy Development | 4 | 08-11-2011 01:37 PM |
| Order not cancelling | kaywai | Strategy Development | 2 | 05-08-2011 03:03 AM |
| Strategy - Limit Order Not Cancelling | JayJoshi | Strategy Development | 7 | 03-17-2011 05:41 AM |
| Order Cancelling | occam | General Programming | 5 | 12-08-2010 08:30 AM |
| Error canceling and replacing a stop limit order | ppperkins | Strategy Development | 1 | 01-22-2010 02:43 PM |