Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Loss Offset

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

    #16
    Thanks Dierk, that works!

    I have one other problem, it seems to give me results as if I have moved my stop...I am testing an exit at 60 pips, I have not put any trailing stop code in, but it seems to give me profit results which are positive based on exiting at the stop, i.e. not 60 pips but a variety of amounts below 60 pips. Is there an inbuilt trailing stop at work?

    Comment


      #17
      >> Is there an inbuilt trailing stop at work?
      No, unless you coded it. I suggest tracing your strategy as per here to understand what's going on: http://www.ninjatrader-support.com/v...ead.php?t=3627
      DierkNinjaTrader Customer Service

      Comment


        #18
        What I've found out is that it's reading the stop calculation as a moving stop - recalculating on every new bar update it so that it moves with price, similar to a trailing stop - I've looked at the charts and it stops out on a retracement, rather than continuing to the profit target. I guess this means a price action entry where you place stops one pip under/above the recent low or high is not possible to test for.

        Comment


          #19
          The reason your stop keeps moving while in the OnBarUpdate() is because it is constantly submitting modifications to your stop price. If this is not intended behavior you need to also have a limiting condition that only submits your stop once at given price for your entry.
          Josh P.NinjaTrader Customer Service

          Comment


            #20
            Yes Josh, that's what it looks like. What kind of limiting condition could I put in that "only submits your stop once at given price for your entry"? I only want the stop to do its calculations for the entry bar and stick there.

            Comment


              #21
              For one, you could throw it with the condition for entry.

              Code:
               if (some entry condition)
              {
                   if (Position.MarketPosition == MarketPosition.Flat)
                   {
                        SetStopLoss(...);
                        EnterLong();
                   }
              }
              Keep in mind that SetStopLoss line should be before the EnterLong line. This is untested code, but should work in theory.

              You may get some other ideas for other things you can do with this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=3222
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by minds2010, Today, 03:38 AM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by DTSSTS, Yesterday, 07:11 PM
              2 responses
              32 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by ntbone, Yesterday, 11:42 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by mr_trade, 11-26-2020, 05:01 PM
              5 responses
              59 views
              0 likes
              Last Post mr_trade  
              Started by evanp90, 01-14-2021, 07:03 PM
              4 responses
              33 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X