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

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 bee1943, Today, 09:55 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by FAQtrader, 04-25-2024, 12:00 PM
                7 responses
                99 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by giulyko00, Yesterday, 11:49 AM
                4 responses
                28 views
                0 likes
                Last Post giulyko00  
                Started by Sebastian - TwinPeaks, Yesterday, 01:31 PM
                4 responses
                25 views
                0 likes
                Last Post Sebastian - TwinPeaks  
                Started by NUVERSA, Today, 09:31 AM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X