Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stoploss

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

    stoploss

    Hello,

    it works fine with NinjaTrader using stoplosses with variables (eg Donchain or ATR). But I can´t find out how to use the close as stoploss if close<open. I can´t solve this with boolean as I need the price-value then if the condition is true. How can I do this to use in my stoploss?

    Thanks
    Tony

    #2
    Hi Tony,

    You can conditionally set the value of your stop loss. We have a sample that shows this technique here to create a breakeven stop strategy after a profit trigger. You could modify for your conditionals and stop loss levels.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      thank you for your reply. I know this sample and I used this way for stops. But the question is different and refers to
      SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool simulated)

      The way to code the stoploss with variable is different from the sample, isn´t it? I don´t want to move the stop afterwards to a certain price. Would you do in your coding

      if (Close[0] < Open[0] && Close[0] < ATR. Lower - 2 * TickSize)
      {SetStopLoss(CalculationMode.Price, "Close<ATR")

      How would you do this?
      What is the difference between the samplepricemodification and the stoploss with double variable?

      Thanks
      Tony

      Comment


        #4
        I'm not sure exactly what you're going for, but the first thing I'd look at is the condition you're trying to express. Except for markets that trade at really small values, your condition will never be true. An example with today's ES:
        Close = 1351
        14 period ATR = 17.48

        Can you please clarify what your goal is here?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Tony,

          I believe you're looking for a strategy with SuperTrend or ATR as a trailing stop.

          If you google it, I'm sure you'll find it.

          HTH,
          kz

          Comment


            #6
            Thanks,

            yes, this is what I mean. I have this but the problem is that there is only one output value and therefore it occurs sometimes that the wrong value (or on the wrong side) is triggered.

            Best
            Tony
            Originally posted by zeller4 View Post
            Tony,

            I believe you're looking for a strategy with SuperTrend or ATR as a trailing stop.

            If you google it, I'm sure you'll find it.

            HTH,
            kz

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,610 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            9 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            19 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            6 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            16 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X