• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.



    Paul H.NinjaTrader Customer Service

    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.

        Paul H.NinjaTrader Customer Service

        Comment


          #5

          Thanks for the clarification. I will continue working on it

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by aviat72, 04-26-2020, 09:41 PM
          10 responses
          90 views
          0 likes
          Last Post kissandfly  
          Started by healthooa, Today, 01:28 AM
          0 responses
          7 views
          0 likes
          Last Post healthooa  
          Started by superkolleech, Today, 12:46 AM
          0 responses
          9 views
          0 likes
          Last Post superkolleech  
          Started by harjinderjit, Yesterday, 08:24 PM
          0 responses
          20 views
          0 likes
          Last Post harjinderjit  
          Started by Againmain1, Yesterday, 03:04 AM
          1 response
          27 views
          1 like
          Last Post NinjaTrader_ShawnB  
          Working...
          X