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 ScottWalsh, Today, 04:29 PM
        0 responses
        3 views
        0 likes
        Last Post ScottWalsh  
        Started by rtwave, 04-12-2024, 09:30 AM
        2 responses
        21 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by tsantospinto, 04-12-2024, 07:04 PM
        5 responses
        69 views
        0 likes
        Last Post tsantospinto  
        Started by cre8able, Today, 03:20 PM
        0 responses
        7 views
        0 likes
        Last Post cre8able  
        Started by Fran888, 02-16-2024, 10:48 AM
        3 responses
        49 views
        0 likes
        Last Post Sam2515
        by Sam2515
         
        Working...
        X