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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    128 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    117 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X