Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need to cancel pending order once any of placed order executed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need to cancel pending order once any of placed order executed

    Hi ,
    As i will be placing multiple order based on strategy i need to cancel any pending order as soon as any one order executed , i tried with onexecutionupdate() but this method is not called when
    order is executed so please help me asap

    // Example
    protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
    {
    Print("OnExecutionUpdate="+executionId+"quantity=" +quantity+"marketPosition="+marketPosition+"orderI d="+orderId+"time="+time);
    Print(execution.ToString());
    if ( stv2atmStrategyId.Length != 0 ) { AtmStrategyClose(stv2atmStrategyId);stv2atmStrateg yId = string.Empty ; stv2orderId= string.Empty;}
    if ( atmStrategyId.Length != 0 ) { AtmStrategyClose(atmStrategyId);atmStrategyId = string.Empty ; orderId= string.Empty;}
    if ( sqsatmStrategyId.Length != 0 ) { AtmStrategyClose(sqsatmStrategyId);sqsatmStrategyI d = string.Empty ; sqsorderId= string.Empty;}
    if ( sqlatmStrategyId.Length != 0 ) { AtmStrategyClose(sqlatmStrategyId);sqlatmStrategyI d = string.Empty ; sqlorderId= string.Empty;}
    }

    #2
    Hello shankar.deshapande,

    Thanks for your post.

    Atm strategies are separate strategies from NinjaScript strategies.

    You could consider using the Account class with Account.ExecutionUpdate since that is tied to the account, and the NinjaScript strategy is not actually submitting orders.

    See the help guide documentation below for more information.

    Account: https://ninjatrader.com/support/help...ount_class.htm
    Account.ExecutionUpdate: https://ninjatrader.com/support/help...tionupdate.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    63 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    40 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    22 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    25 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X