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 MarianApalaghiei, Today, 10:49 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        8 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        46 views
        0 likes
        Last Post bill2023  
        Working...
        X