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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X