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 andrewtrades, Today, 04:57 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          3 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