Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit target

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

    Profit target

    I have tried to set a target profit for a strategy in the Wizard so once it goes long it should straight away put a limit order on the ask price, however after it enters long it doesnt put in the exit order....

    When the following conditions are true:

    Position.MarketPosition == MarketPosition.Long


    Do the following:

    ExitLongLimit(GetCurrentAsk().""."")

    Anyone had any luck with something similar??

    #2
    You sure its not just closing? In backtest, there is not ask so close price is subsituted.
    RayNinjaTrader Customer Service

    Comment


      #3
      I havent actually backtested this. ITs all from watching it on realtime data. It enters no problems and my fixed tick stoploss comes up ok, its jsut the sell limit doesnt come up on the ask price like I would expect it too ( I have also set the entries per direction to 2)

      Comment


        #4
        Try removing the check for being long and see if that makes a difference. ExitLongLimit() will just be ignored if a long position does not exist.
        RayNinjaTrader Customer Service

        Comment


          #5
          getting closer

          Ok, Ive removed the check for a long position and it seems to have fixed it. However it doesnt appear immediately.... It takes a while for the profit target limit order to appear after a new position is opened. Is it waiting for the next bar to start before it recognizes a new position?
          I would like the order to appear immediately after a new position is taken.

          Thanks

          Comment


            #6
            If the line of code is in the OnBarUpdate() method then yes it will wait till the next bar provided you are using CalculateOnBarClose = true. Otherwise it will do it on the next tick. If you want it immediately you will need to code it in the OnOrderUpdate() and OnExecution() methods. There is a reference sample available.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I would like to keep it in the wizard, so by unchecking calculateonbarclose in the wizard It comes in straight away.

              The problem that I am having now is that when I use a fixed tick stoploss my profit target doesnt come up at all. If I delete the Stoploss from the strategy it comes up fine. Is there a reason why the stoploss seems to be affecting the profit target rule?

              Comment


                #8
                Maybe your signal names are not the same? Leave them as blank.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  They are blank. Ive just checked and tested it again. But the same thing keeps happening. The profit target exit works fine if I dont add a stop loss. As soon as I do the profit target stops working and I jsut get the stop loss

                  Comment


                    #10
                    Make sure the only exit orders are then places in the stops/targets screen.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      but that then only gives the options of percent/ticks or price.......
                      and then why am I able to create an exit in the other section??

                      Comment


                        #12
                        That is correct, that's how it works.
                        RayNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        558 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        324 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        101 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        545 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        547 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X