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 Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                633 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                567 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X