Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 JonesJoker, 04-22-2024, 12:23 PM
        8 responses
        41 views
        0 likes
        Last Post JonesJoker  
        Started by timko, Today, 06:45 AM
        0 responses
        3 views
        0 likes
        Last Post timko
        by timko
         
        Started by Waxavi, 04-19-2024, 02:10 AM
        2 responses
        39 views
        0 likes
        Last Post poeds
        by poeds
         
        Started by chbruno, Yesterday, 04:10 PM
        1 response
        44 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        1 response
        25 views
        0 likes
        Last Post CactusMan  
        Working...
        X