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

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.

                  Brandon H.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jxs_xrj, 01-12-2020, 09:49 AM
                  6 responses
                  3,290 views
                  1 like
                  Last Post jgualdronc  
                  Started by Touch-Ups, Today, 10:36 AM
                  0 responses
                  9 views
                  0 likes
                  Last Post Touch-Ups  
                  Started by geddyisodin, 04-25-2024, 05:20 AM
                  11 responses
                  62 views
                  0 likes
                  Last Post halgo_boulder  
                  Started by Option Whisperer, Today, 09:55 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post Option Whisperer  
                  Started by halgo_boulder, 04-20-2024, 08:44 AM
                  2 responses
                  25 views
                  0 likes
                  Last Post halgo_boulder  
                  Working...
                  X