Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position.MarketPosition

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

    Position.MarketPosition

    Code:
     
    If(mySignal && Position.MarketPosition == MarketPosition.flat)
                    EnterLong();
    I have two strategies running in Sim on the same instrument.
    These two strategies differ only in exit conditions; entry conditions are identical, and so they should both enter at the same time.
    But only one is entering; the other does not.
    Is this because the above condition is checking overall position for the instrument across all strategies, rather than just the position for the instrument under each strategy separately? So strategy A enters, and then strategy B sees account already has a position in the instrument, and so fails to enter?

    #2
    Hello AnotherTrader,
    Position.MarketPosition check for the current market position of the strategy only and not the overall market position.

    Say you are long in both strategy A and strategy B. Now say an exit is triggered in strategy A and so strategy A is not flat. Sometimes later an entry is triggered by the strategy. You will witness an entry order being submitted by strategy A, but strategy B will not submit any order since it is already in a position and internal order handling rules will reject any position in the same direction unless Entries per direction is defined accordingly.

    Further your code filters the entry orders as:
    If(mySignal && Position.MarketPosition == MarketPosition.flat)
    EnterLong()

    Since you are not flat in strategy B will ignore the entry orders.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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