Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

onorderupdate orderchange

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

    onorderupdate orderchange

    Hello,

    I cant find somewhere a sample how I can work in onorderupdate to check if orders are changed (not cancelled or filled) like "if (order.OrderState == OrderState.Cancelled)"

    How can one verify this please? I´m referring to entrylimitorders from an ATM moved with conditions in a NT-script.

    Thank you
    Tony
    Last edited by tonynt; 04-18-2017, 06:17 AM. Reason: translation error

    #2
    Hello tonynt,

    Thank you for writing in.

    Have you considered using a bool variable and setting it to true when your change order conditions are met?

    For example,
    Code:
    private bool aTMSubmitted;
    private bool aTmModfied;
    
    if(entry condition true)
    {[INDENT]<Submit ATM Entry Order>
    aTMSubmitted=true;	[/INDENT]
    }
    
    if(aTMSubmitted ==true && (Close[0]>0)) //Change order condition
    {[INDENT]<Change ATM Entry Order Price>
    aTmModfied =true; //Set order modified bool to true.[/INDENT]
    }
    If(aTmModfied==true)
    {[INDENT]Print(“Order Has Been Modified”);[/INDENT]
    }
    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. OK, but it should be moved depending from marketconditions sometimes more than 1 time. With first move the bool is true and what should I do then?

      Thanks
      Tony

      Comment


        #4
        Hello Tony,

        You could use a int variable and have 1 added to it each time it was moved, that way you'd know exactly how many times it was moved.

        Code:
        private int counter++;
        
        if(<Condition to Move>)
        {[INDENT]<Move Order>
        counter++;[/INDENT]
        }
        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        49 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        141 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        275 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X