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

Creating an ATR based stop and target using the strategy builder

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

    Creating an ATR based stop and target using the strategy builder

    Hi

    I've searched all through the forum & can see this questions asked a few times but I can't see a clear answer on how to do this sorry.

    Am I able to create an ATR based stop & profit target from within the strategy builder wizard or does this need to be created in the code?

    Thanks in advance

    #2
    Hello Gav_G,

    With the Strategy Builder, you would need to use Exit orders to set the price of an exit to an indicator..
    Below is a link to an example of controlling the prices of Exit orders.


    But I think you are wanting one more step which would be to do custom math. For example the current price minus the ATR price or something along those lines.
    For custom math, the script would need to be unlocked and coded by hand.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea

      So sorry I've just posted another question which is really a follow on from this, feel free to delete the new thread if need be

      basically the targets & stops are being set to entry price when I use the below

      Code:
      // Long Entries
                  if (rules are met)
                  {
                      // Setting stops & targets
      
      
                      EnterLong(Convert.ToInt32(DefaultQuantity), @"Buy_1");
      
                      SetProfitTarget(@"Buy_1", CalculationMode.Ticks, ATR1[0]);
      
                      SetStopLoss(@"Buy_1", CalculationMode.Ticks, ATR1[0], false);
      ​​​​​​​What am I doing wrong?

      Comment


        #4
        Hello Gav_G,

        This strategy cannot be made with the strategy builder.

        Are you certain this strategy has not been unlocked and coded by hand?

        Below are links to unlocked examples. Please note, set methods need to be set or reset before placing an entry, not after.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks I've got it sorted now & yes I've unlocked this one now as you suggested

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GLFX005, Today, 03:23 AM
          0 responses
          1 view
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          11 views
          0 likes
          Last Post XXtrader  
          Started by Waxavi, Today, 02:10 AM
          0 responses
          6 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by TradeForge, Today, 02:09 AM
          0 responses
          14 views
          0 likes
          Last Post TradeForge  
          Started by Waxavi, Today, 02:00 AM
          0 responses
          3 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Working...
          X