Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to setprofittarget based on candle open

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

    How to setprofittarget based on candle open

    Hello! Need help ser

    #2
    Oops. Sorry. Meant to say I would like the target set to candle open instead of the entry price. Can someone help with the code for this? Thank you

    Comment


      #3
      Yes, but we need to know what we are looking at?

      Comment


        #4
        So a trade triggers long. The trade markets in but there is slippage of like 2 pts. The candle open is we'll say 18000 and entry is 18002. I want the target to be in ticks (we'll say 20 ticks) but to be from the candle open of 18000 not the entry of 18002. So the target should be 18005 here. Right now it is going based on the entry of 18002 with a target of 18007.

        Comment


          #5
          I think you're going to need some more conditions to filter if you're trying to build a strategy. Last candle was green? x distance form previous low, Rsi level, Rsi rising, etc. Any time you set a strategy in motion, it will execute, Something like this would put on a ton of trades and likely lose on commissions.

          Comment


            #6
            There are other conditions but the one I want to change is the setprofittarget. I tried this
            SetProfitTarget(CalculationMode.Price, Open[0] + (Profit * TickSize)) for long entry and SetProfitTarget(CalculationMode.Price, Open[0] - (Profit * TickSize)) for short entry

            But it enters and exits instantly

            Comment


              #7



              You need to define execution price, Execution.Price may do the trick but you should look over the page above.

              Comment


                #8
                Open[0] + the spread + slippage probably is larger than the profit target you're calculating for.

                Comment


                  #9
                  Hello Edress714,

                  Thanks for your notes.

                  I see you have posted this question in multiple times.

                  See the forum thread linked below for my reply on this matter.

                  <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Yesterday, 05:17 AM
                  0 responses
                  65 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  139 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  75 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  45 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  50 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X