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

STOP Indicator HELP

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

    STOP Indicator HELP

    I have read through and tried Chandelier Stop; Chandelier Basic, TS Super Trend. Perhaps I am inputing wrong but it does not help me. Let me try to explain (Thanks everyone...relative inexperienced with programming code)

    What I am trying to accomplish is to create an indicator (OR A SET OF OFFSET RULES) to initiate an EXIT strategy:

    Take the High of Last Bar and subtract a multiple of ATR.1 from that high price.

    Take the LOW of last bar and ADD a multiple of ATR.1 to that LOW price.

    So my exit strategy would be:

    On SHORT Trade: Sell at Limt Order IF HIGH(0) >= HIGH(1) - (Mult.*ATR(1)), where limit order price would = HIGH(1) - (Mult.*ATR(1))
    On LONG Trade: Sell at Limit Order IF LOW(0) <= LOW(1) + (Mult. * ATR(1)), where limit order price would = LOW(1) + (Mult. * ATR(1))

    In strategy wizard, I thought I could do this by stating IF:
    HIGH(0) > HIGH(1) with Offset of HIGH = ATR(1) with ATR Period = User Defined and Offset of ATR = Percent and percent = User Defined Input of say -400 to +400 (is that right?? 100 because of percent?)

    then,
    sell at limit order

    Thanks to anyone that can steer me with this kind of simple programming expertise.

    #2
    Hello,

    Can you post screen shots of your strategy wizard conditions?
    DenNinjaTrader Customer Service

    Comment


      #3
      Position.MarketPosition == MarketPosition.Short
      High[0] >= High[1] + (ATR(MALengthShrt)[1]) * (1 + ATRMultShrt) * TickSize


      ExitShortLimit(High[1] + (ATR(MALengthShrt)[1]) * (1 + ATRMultShrt) * TickSize, "Close SHORT","

      Comment


        #4
        One more thing...I am trying to NOT let the calculated value INCREASE any stop. If a calculated value is FURTHER than previous value, then KEEP previous value.

        So, on a SHORT trade, if NEW calculated (Hi Minus ATR*Mult) <= PREVIOUS (Hi Minus ATR*Mult), then use NEW, Else KEEP Previous.

        On a LONG trade, if NEW calculated (LOW Plus ATR*Mult) >= PREVIOUS (Low Plus ATR*Mult), then use NEW, ELSE Keep Previous.

        I was hoping this could be accomplished in strategy wizard.

        Comment


          #5
          Hello,

          Try adding *(-1) next to (1 + ATRMultShrt) * TickSize and that will give you a negative number which will be subtracted. Or change the ATRMultShrt output so that it is negative and use that in you Wizard. Or, and most simple, change the "+" to a "-" after you are finished with the strategy. (Note once you change the code by hand you can no longer use the wizard, so I recommend that you save hand made changes until the end.)

          What you are trying to do, is not possible in the Wizard by default.

          Regarding the other post, you can do this by using the Set user defined variable option in the actions section.

          Your strategy is getting complex enough that you may be reaching the out ends of the Wizard functionality. If you can't program, I suggest requesting assistance from a ninjascript consultant:
          DenNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Kaledus, Today, 01:29 PM
          3 responses
          9 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frankthearm, Yesterday, 09:08 AM
          14 responses
          47 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by gentlebenthebear, Today, 01:30 AM
          2 responses
          13 views
          0 likes
          Last Post gentlebenthebear  
          Started by PaulMohn, Today, 12:36 PM
          2 responses
          17 views
          0 likes
          Last Post PaulMohn  
          Started by Conceptzx, 10-11-2022, 06:38 AM
          2 responses
          56 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Working...
          X