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

How to reset a stoploss within OnBarUpdate()

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

    #16
    Hello Trader17,

    Thanks for your reply.

    "So resetting the Stop value will not hurt anything even if added under OnBarUpdate even though Chelsea mentioned it does reset if Stop is added above the Enter Long." I'm not sure what you are implying here but the reset is done in OnBarUpdate() and should be done before the next entry order is placed so what both Chelsea and I are saying is the same thing.

    Yes, you can mix Stoploss CalculationModes at any time. The point is that you are setting the stop loss to some value that needs to be appropriate for the next entry order.

    Please note that if you need your strategy coded for you, we can provide references to 3rd party programmers who have the competency needed to produce your strategy.
    Paul H.NinjaTrader Customer Service

    Comment


      #17
      Thanks. What I meant was if it were ok to do the reset under OnBarUpdate as well as set the Stop just above EnterLong which also resets the value of the Stop under OnBarUpdate. Just making sure it is code compliant.
      And was just making sure that the reset can have a different stop loss value than the "real" stop as long as you said they both are pretty close to each other.
      Thank you.

      Comment


        #18
        Hello Trader17,

        Thanks for your reply.

        Chelsea's example would be in the OnBarUpdate().

        In general, all of our examples would be inside the OnBarUpdate() method unless explicitly advised otherwise.

        Setting the value of the set method prior to an order is in effect "resetting" the set methods value from what it previously was. The main point here is to always ensure that the set method value is set to what you want to use prior to placing an entry order, it is really as simple as that.



        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by tonynt, Today, 01:48 PM
        0 responses
        1 view
        0 likes
        Last Post tonynt
        by tonynt
         
        Started by eladlevi, Today, 11:02 AM
        4 responses
        21 views
        0 likes
        Last Post eladlevi  
        Started by synthhokie, Today, 10:24 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by llanqui, 05-06-2024, 03:51 PM
        7 responses
        30 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by Lele2k24, Today, 01:32 PM
        0 responses
        3 views
        0 likes
        Last Post Lele2k24  
        Working...
        X