Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATR stop out on multipule orders

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

    ATR stop out on multipule orders

    Hello - My strategy has multiple entries and I'd like to pull my stop out up to one ATR below (or above on shorts) to my last entry. Can you point me in the right direction to program this? thanks

    #2
    titleistbb22, you would need to use unique entry names for the signals and then attach the SetStopLoss() as needed -





    You can for example calculate the ATR stop value as tried to price and then use SetStopLoss in price mode to set / update the stop.

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you - very helpful - I think the below code is what you are refering to in tying ATR to price

      //Breakeven stop
      if (Position.GetProfitLoss(Close[0], PerformanceUnit.Points) > ATR(15)[0])
      {
      SetStopLoss(CalculationMode.Price, Position.AvgPrice);

      }

      This seems to make sense but it kicks me out on some short positions with our hitting the 1 ATR in profit. Any thoughts? thanks
      Last edited by titleistbb22; 05-14-2010, 11:14 PM.

      Comment


        #4
        Hello titleistbb22,

        You will have to debug using print statements and / or TraceOrders output to verify values are what you expect.

        The following article can help with this approach:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Fair enough - a few questions for you on SetTrailStop and SetStopLoss.

          I understand that SetStopLoss takes precedence, but can I use multiple StopLoss and TrailStop entries together? Or does the StopLoss simply cancel out the TrailStop?

          Can I simply use either multiple StopLoss OR TrailStop orders on the same entry instead of using a mix of StopLoss and TrailStop orders?

          Also, what is the difference in how the TrailStop works vs the StopLoss?

          Thanks in advance for your time in answering these questions

          Comment


            #6
            If you don't use the advanced overload then SetStopLoss() is applied to all entries.

            You would have to use an advanced overload method that includes FromEntrySignal if you wanted to use both methods in the same strategy.
            SetStopLoss(string fromEntrySignal, CalculationMode mode,double value,bool simulated)

            You could then apply SetStopLoss() to one entry and SetTrailStop() to another.

            A stop loss submits a fixed order in relation to your entry price.

            A trailstop is ammended on a tick by tick basis in relation to the current traded price.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              thank you - so I read that I can not use Trailing and Set Stop loss on the same entry. Is that correct?

              Comment


                #8
                That's correct titleistbb22 - to have a static stop after entry and then a trail later as the trade progresses, please see the reference sample for adapting stop and target orders from one of my previous replies, this will be the way to go, there're also good starting points in the sharing section on custom trailing algorithms.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by andrewtrades, Today, 04:57 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by chbruno, Today, 04:10 PM
                0 responses
                6 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by josh18955, 03-25-2023, 11:16 AM
                6 responses
                436 views
                0 likes
                Last Post Delerium  
                Started by FAQtrader, Today, 03:35 PM
                0 responses
                7 views
                0 likes
                Last Post FAQtrader  
                Started by rocketman7, Today, 09:41 AM
                5 responses
                19 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X