Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Clearing Stops?

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

    Clearing Stops?

    I'm experimenting with adjusting stops and targets dynamically, is there a way to clear profit targets without resetting them to a new value. Also is there a way to determine what the current stops and targets for the current position are in a script?

    TIA

    #2
    darckeen,

    Not sure what you mean by "clearing". You need to reset the value if you are modifying them throughout your trade. To know what the stop/targets are at throughout the trade I recommend you track it manually through your own variables at submission time.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Well the problem i'm encountering is that when i put on a trade i am specifying a stoploss for every trade. then at some point durring the trade i am specifying a target. it seems if the trade gets stopped out instead of hitting the target what happens is that if the next trade is in the opposite direction the profittarget from the old trade activates and the trade gets closed out immediately by the profittarget. This new trade only has had its stop loss set when the trade was put on, is there a way to clear the profittarget from the old trade with out setting a value for it?

      Comment


        #4
        darckeen,

        It sounds like you are using Set() methods. Remember, to attach stops/targets to an entry with Set() methods you need to call the set methods before you make the entry. Otherwise it will only attach to subsequent orders if you call it after you already acquired a position. This is exactly what you are experiencing.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Ah i see. So instead of using a SetProfitTarget() I should just place a limit order? And if so, can i attach it to my position so that if the trade gets stopped out rather then hitting the limit order the limit order will be cancelled?

          Also is there a ninja script API documentation available that is oriented to programmers and would give me a better understanding of these kinda nuances. I find the F1 help to be pretty limited as far as the ninja script and strategy programming goes?

          Comment


            #6
            darckeen,

            Your understanding is correct. You can cancel limit orders if it is still alive through CancelOrder(). The Help Guide is where all of our documentation resides. There are also reference samples on our forums you can check out.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Ok i looked at the advanced order management stuff and see how it can be done. Thanks.

              One more question, how does the trailing stop algorithm work? I read the docs but it doesn't specify exactly how it is calculated?

              Comment


                #8
                darckeen,

                As the trade goes up 1 tick in profit the trail goes up 1 tick. If the trade comes down 1 tick now, the trail will stay at the raised level.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by charlesugo_1, 05-26-2026, 05:03 PM
                0 responses
                59 views
                0 likes
                Last Post charlesugo_1  
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                143 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 05-11-2026, 05:56 AM
                0 responses
                161 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 05-10-2026, 08:12 PM
                0 responses
                97 views
                0 likes
                Last Post CarlTrading  
                Started by Hwop38, 05-04-2026, 07:02 PM
                0 responses
                276 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Working...
                X