Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to program different profit targets for contracts purchased at the same time?

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

    How to program different profit targets for contracts purchased at the same time?

    Hello,
    I would like to submit an order for 2 ES contracts when something happens, e.g. price closes above 50 period SMA. I am fine programming it.

    But once the order is submitted I want to have different profit targets for both the contracts. Eg. for the first contracts I want to place profit target of 10 ticks whereas for the remaining one I want to place profit target of 20.

    Can someone please guide me how this can be done in NT?
    Thanks

    #2
    Hello pandyav,

    Thank you for your post.

    You will need to submit two separate orders with individual entrySignalNames that are then referenced in the SetProfitTarget() method.

    For example:
    Code:
    EnterLong(1, "mylong1");
    EnterLong(1, "mylong2");
    
    SetProfitTarget("mylong1", CalculationMode.Ticks, 10);
    SetProfitTarget("mylong2", CalculationMode.Ticks, 20);
    For information on SetProfitTarget please visit the following link: http://www.ninjatrader.com/support/h...ofittarget.htm

    Comment


      #3
      Thanks PatrickH,
      This was very helpful.

      Comment


        #4
        Hello There,
        So I created a part of the strategy and it compiles without any error messages. The challenge is it goes on and takes a trade on every single bar, what could be wrong?
        if (CurrentBar < 500)
        return;
        if ((CrossAbove(T3(14,1,0.7),VMA(high_vma_vol,high_vm a_period),1)))
        EnterLong(1,"Long 1");
        EnterLong(1,"Long 2");

        if ((CrossBelow(T3(14,1,0.7),VMA(high_vma_vol,high_vm a_period),1)))
        ExitLong(1,"Long 1 Exit","Long 1");
        ExitLong(1,"Long 2 Exit", "Long 2");

        Comment


          #5
          Hello pandyav,

          Thank you for your response.

          Please try setting EntriesPerDirection to 2 and then test the strategy once more.

          For information on EntriesPerDirection please visit the following link: http://www.ninjatrader.com/support/h...rdirection.htm

          Please let me know if I may be of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          108 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          55 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          37 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          38 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          75 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X