Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget works incorrectly

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

    SetProfitTarget works incorrectly

    I have a simple strategy which places few orders in the same directions(long only). When I have "Entries per direction" set to 1 it works ok, but when I set it to 5 (so I can have 2 or more positions open) I have exits on SetProfittarget signal with negative profit.

    As you can see the first profit target works as supposed (it exits with 0.0025 higher than entry point),
    but when the orders overlap it's not working.

    this is the SetProfitTarget I have:

    protected override void Initialize()
    {
    ClearOutputWindow();
    CalculateOnBarClose = true;
    lastFillPrice = 1000;

    TraceOrders=true;
    SetProfitTarget(CalculationMode.Ticks, 50);
    }

    I place long trades in OnBarUpdate event:

    nOrder++;
    EnterLong("entry"+nOrder);

    Please see screenshots attached.




    #2
    A few questions -

    - What NT version are you using?
    - In the OnBarUpdate() method, you have any more calls to SetProfitTarget()

    Thanks
    RayNinjaTrader Customer Service

    Comment


      #3
      I have NT 6.5.0.9,

      this is the OnBar method I have:

      protected override void OnBarUpdate ()
      {
      if (Price1 - Low[0] >= TP ||
      Position.MarketPosition == MarketPosition.Flat
      ) {
      nOrder++;
      EnterLong("entry"+nOrder);
      }

      }

      I setprofit target only once when the strategy iniatlizes.

      Comment


        #4
        Here is the orders tab screenshot,
        I think the problem is that the profit limit orders are not synchronised with the corresponding positions.

        Comment


          #5
          Would you be so kind to -

          - Export the strategy
          - Via Help > Mail To Support, send me the database and your strategy
          - In subject include "For Ray"

          I would like to run it here.

          Thanks in advance.
          RayNinjaTrader Customer Service

          Comment


            #6
            I have emailed you all the information,
            if more data is needed please let me know.

            Comment


              #7
              Nothing came into our Help Desk. Can you confirm that it was sent? Could you try again?
              RayNinjaTrader Customer Service

              Comment


                #8
                I have received the email,
                [Ticket #79158]
                will resubmit all the information

                Comment


                  #9
                  I have resubmited the information, [Ticket #79180]

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  582 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  338 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  554 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  552 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X