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

Take profit the size /range of entry bar

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

    Take profit the size /range of entry bar


    Hello, I would like to know if it is possible to put my take profit on the size of my entry candle? If possible how I should proceed or if anyone has an idea I'm interested. Thank you in advance, any help is welcome.

    #2
    Hello janio973,

    When you say put the profit target on the size of the entry candle, what specifically do you mean? Are you asking how to put it at the high of that candle?

    JesseNinjaTrader Customer Service

    Comment


      #3
      hello,thx for your help,I attach a picture for better understanding
      I want to project this size as my take profit when my order trigger and put the stop loss 1 tick below entry candle
      Attached Files
      Last edited by janio973; 06-16-2022, 02:45 PM.

      Comment


        #4
        Hello janio973,

        From the image its hard to tell, is the space between the High of the bar and the top line the amount of price difference between the High and Low of the bar?

        If so you would need to subtract the Low from the High to know the difference in Price for that bar. With that difference you could use that to Add to the bars High price which would give you the High plus the difference.

        JesseNinjaTrader Customer Service

        Comment


          #5
          I make a line in red color ,maybe its better for you now
          Attached Files

          Comment


            #6
            I am at home now,I manage to make something better for you to understand.
            I have a strategy that shows me the entry(blue candle),
            I just need now set my take profit 100% of the size of that entry candle from its high,when the order is triggered
            and set stop loss at its low.
            Manually its easy to do all this,but I am looking a way to do this with builder or editor.
            The help I need is in this way ,
            Attached Files
            Last edited by janio973; 06-16-2022, 05:13 PM.

            Comment


              #7
              Hello janio973,

              What I mentioned in post 4 would be how to do that:

              You would need to subtract the Low from the High to know the difference in Price for that bar. With that difference you could use that to Add to the bars High price which would give you the High plus the difference.

              If you are using the strategy builder this type of math would require using a custom Series double to store the result of the High minus the Low. You can then use that series in conditions or for offset values. To add to an existing price you would select the High series for example and then in that series parameters it has the Offset parameter, you would use the custom series there to add to the high price.

              JesseNinjaTrader Customer Service

              Comment


                #8
                Hello NinjaTrader_Jesse , thanks for you help
                for example Its something like high1-low1=20ticks
                and set profit target high0+20
                thats what I understand but write this code is what I dont know to do,
                If someone can give me an hand with that code line ,it would be wonderful

                Comment


                  #9
                  Hello janio973,

                  In the builder when you do math between series that results in a price value so to set a target based on that dynamic price value you would have to use a Set and control the target using logic. There is a sample of that concept here:

                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Balage0922, Today, 07:38 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post Balage0922  
                  Started by JoMoon2024, Today, 06:56 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post JoMoon2024  
                  Started by Haiasi, 04-25-2024, 06:53 PM
                  2 responses
                  19 views
                  0 likes
                  Last Post Massinisa  
                  Started by Creamers, Today, 05:32 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post Creamers  
                  Started by Segwin, 05-07-2018, 02:15 PM
                  12 responses
                  1,786 views
                  0 likes
                  Last Post Leafcutter  
                  Working...
                  X