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

Order cancellation

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

    Order cancellation

    Hi NT experts,

    Assume the following: I have a target and stop loss orders submitted after entry fill. And neither the target nor the stop loss is hit yet.

    Then I exit my position with market order. Will NT internal logic cancel the target and stop loss orders associated with the position after position close?

    If I also do CancelOrder after position close, will it cause conflict with NT's internal logic?

    Regards,

    #2
    binwang2, which methods are you using? Exit's or Set's?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I use Exit such as ExitLong();

      Comment


        #4
        binwang2, thanks - so how do you place your exits? If you placed them with the Set() methods, those would be cancelled as the associated position would be close, Exit methods such as for example ExitLongLimit you would need to cancelOrder() as needed.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks Bertrand.
          I have a question on teh set() method.

          But i would like to change stoploss or target price dynamically. The online help guide indicates the price value has to be reset for Set() method. Suppose it is not reset but the position is closed and the strategy is stopped and restarted. Will the stoploss/target price be reset automatically by restating the startegy?

          Regards,

          Comment


            #6
            It would be 'initialized' then as it cycles through the historical OnBarUpdate() portion, best would be resetting to a default value when there's no strategy position (as also done in our sample below) -

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mattbsea, Today, 05:44 PM
            0 responses
            4 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            31 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            2 views
            0 likes
            Last Post tkaboris  
            Started by GussJ, 03-04-2020, 03:11 PM
            16 responses
            3,282 views
            0 likes
            Last Post Leafcutter  
            Started by WHICKED, Today, 12:45 PM
            2 responses
            20 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Working...
            X