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

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 PaulMohn, Today, 12:36 PM
          0 responses
          2 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          38 views
          0 likes
          Last Post love2code2trade  
          Started by alifarahani, Today, 09:40 AM
          2 responses
          14 views
          0 likes
          Last Post alifarahani  
          Started by junkone, Today, 11:37 AM
          3 responses
          20 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by frankthearm, Yesterday, 09:08 AM
          12 responses
          44 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X