Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit target dinamic

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

    Profit target dinamic


    Hello, I am trying to establish a dynamic target based on the rank of a candle. I need that when my LONG signal is activated, the Open - Close range of that candle is stored, my target being that range O - C. Could you help me? Thank you

    #2
    Hello manueldecastro,

    Thanks for your post and welcome to the NinjaTrader forums!

    If I understand correctly, you want to save the value of the range of the entry candle and you define the range as Open minus Close. Typically an up bar would have the Close as a higher value than the open, so perhaps what you are looking for is Close[0] - Open[0]? The Close - Open would not describe the full length so you might want to consider High - Low?

    In either case you would create a double variable and at the time you place the order, you would save the value Close[0]-Open[0] (or High[0] - Low[0]) into that double variable.

    I'm not sure how you would intend to apply that value as a profit target as the value by itself would be less than the value of the instrument. For example using ES, if the bar high is 3020.5 and the bar low is 3019.75 then the saved value would be 3020.5 - 3019.75 which equals a value of 0.75.



    Comment


      #3

      Effectively, I want to save the value of the open / close range. I'm not interested in Low / higth for my strategy. Close [1] -Open [1] is the range of the candle that I want to keep the variable, that is, the last candle closed, but I do not know how to make it save that value using the builder. Could you help me? Assume CL, Open 55 close 55.5. I need you to keep that 0.5 range in ticks. What will be the profit for sailing 0. Thank you!

      Comment


        #4
        Hello manueldecastro,

        Thanks for your reply and clarification.

        Regrettably in the strategy builder you are limited in what math can be performed. You can save the Close[1]-Open[1] to a double type variable but you would not be able to convert that range into ticks.

        You could create the strategy in the strategy builder and then unlock the strategy and work directly in Ninjascript to add the division of the range by the tick size.

        Comment


          #5

          Thanks for the clarification. I will continue working on it

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          67 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          142 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          76 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          47 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          51 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X