![]() |
|
|||||||
| ATM Strategies (Discretionary Trading) Support for Advanced Trade Management, AutoTrail, AutoBreakeven, Stop Strategy and Simulated Stops etc... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2009
Posts: 55
Thanks: 0
Thanked 0 times in 0 posts
|
Just needing a slight bit of help in creating a cancellation of the current order if the price moves 4 ticks away before being filled using the SampleATMStrategy.
Here is some of the Code. Any help would be greatly appreciated. if ( orderId.Length == 0 && atmStrategyId.Length == 0 Blah Blah ) { atmStrategyId = GetAtmStrategyUniqueId(); orderId = GetAtmStrategyUniqueId(); AtmStrategyCreate(Cbi.Action.Buy, OrderType.Limit, Close[0] -1 * TickSize, 0, TimeInForce.Day, orderId, "Blah", atmStrategyId); } elseif ( orderId != null && Close[0] == orderId.LimitPrice + 4 * TickSize) { CancelOrder(orderId); } if ( orderId.Length == 0 && atmStrategyId.Length == 0 blah blah) { atmStrategyId = GetAtmStrategyUniqueId(); orderId = GetAtmStrategyUniqueId(); AtmStrategyCreate(Cbi.Action.Sell, OrderType.Limit, Close[0] -1 * TickSize, 0, TimeInForce.Day, orderId, "blah", atmStrategyId); } elseif ( orderId != null && Close[0] == orderId.LimitPrice - 4 * TickSize) { CancelOrder(orderId); } |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
CancelOrder is for NinjaScript orders only, not ATM orders. If you want to cancel an ATM order you need to use this: http://www.ninjatrader-support.com/H...StrategyActive
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CancelOrder() problem | boreland | Strategy Development | 1 | 12-28-2009 05:33 AM |
| SampleATMStrategy and AtmStrategyChangeStopTarget | MXASJ | Strategy Development | 1 | 07-30-2009 06:12 AM |
| How CancelOrder() work? | xewoox | Strategy Development | 6 | 02-18-2009 02:21 PM |
| Simple Limit Strategy with CancelOrder | stefy | Strategy Development | 7 | 11-10-2008 07:44 AM |
| CancelOrder() problem | John833 | Strategy Development | 41 | 10-31-2008 03:15 PM |