Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Points of Entry and Scale w Managed Order Handling

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

    Multiple Points of Entry and Scale w Managed Order Handling

    I am trying to understand if I am about to reach a dead end or I can proceed on this direction with Managed Order Handling
    Basically I want to be able to have two completely separate positions within the same strategy, same contract, have brackets, and be able to scale in and out each of them.
    Would it work? would setStopLoss&Target adapt to the change in contracts quantity?
    Is there a fundamental error in this code that you may notice or the approach basically correct.
    Thank you!.
    G

    Below is the basic structure of the would be code:
    Assuming a code for Long Entry Only.
    I am thinking to create a strategy based on this structure:
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    EntriesPerDirection = 2;
    EntryHandling = EntryHandling.UniqueEntries; // Hope I am correct on this one
    }

    OnOrderUpdate()
    {
    SetStopLoss("trade1", CalculationMode.Ticks, (stop1 * tickSize_), false ) ;
    SetStopLoss("trade2", CalculationMode.Ticks, (stop2 * tickSize_), false ) ;;

    SetProfitTarget("trade1", CalculationMode.Ticks, (target1 * tickSize_));
    SetProfitTarget("trade2", CalculationMode.Ticks, (target2 * tickSize_));

    If (condition1_for_trade1) EnterLong(1, "trade1") ;
    If (condition2_for_trade1) EnterLong(1, "trade1") ;

    ​If (condition1_for_trade2) EnterLong(1, "trade2") ;
    If (condition2_for_trade2) EnterLong(1, "trade2") ;

    ​If (condition3_for_trade1) Exit(1, "trade2") ;
    If (condition3_for_trade2) Exit(1, "trade2") ;

    If (condition4_for_trade1) ExitLong("", "trade2") ;
    If (condition4_for_trade2) ExitLong("", "trade2") ;
    }
    ​​

    #2
    Hello giogio1,

    You can have separate entries, and have exits that exit the specific entry by using the from entry signal of the entry signal name.
    Each quantity you want to scale out should be a unique entry order with a unique signal name.

    Below is a link to an example of scaling out of a position.


    However, a strategy cannot have multiple positions.
    An account can only have 1 position (either long or short with the quantity of all orders that contributed to the position) per instrument. A strategy also can only have 1 position per instrument.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    116 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    61 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    40 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    43 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    82 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X