Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add two SetProfitTargets for one Entry order?

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

    How to add two SetProfitTargets for one Entry order?

    When I use a managed approach, I place one limit order 2 lots. Then I want to place two profit targets by 1 lot each. Can I do that using the Managed Approach?

    Can you provide me an example of code doing that?
    Thank you.

    #2
    Hello handlar,

    Thanks for your post.

    In the managed approach, the "set" methods will only deal with the total position (note that there is not a quantity field in the set method overloads), however this can be done through the use of "signal names" as described in the help guide for managed approach here: (See the section, " Order Entry Methods"): https://ninjatrader.com/support/help...d_approach.htm

    Using signal names would require you to place two entry orders with a different signal name, then you can create the set methods with those signal names and their respective target/stop values. The signal names also auto create the OCO relationship between SetProfit and SetStopLoss.

    Example:

    if (entry Condition)
    {
    SetProfitTarget("my1stentry, CalculationMode.Ticks, 10);
    SetProfitTarget("my2ndentry, CalculationMode.Ticks, 20);
    SetStopLoss(CalculationMode.Ticks, 10); // would apply to both entries if there there is no other signal named set stop loss.
    EnterLongLimit( 1, myLimitPrice, "my1stentry");
    EnterLongLimit( 1, myLimitPrice, "my2ndentry");
    }


    Please Note that this will also require you to change the setting of entries per direction or EntryHandling:


    Here is another example using multiple entry and exits (Not using set methods): https://ninjatrader.com/support/help..._exit_sign.htm

    Comment


      #3
      Thank you, PaulH! I'll try this approach.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X