Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

virtual orders / start behavior

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

    virtual orders / start behavior

    My strategy does not turn green, it stays yellow. Start behavior is set to "wait until flat, synchronize account". From other posts here i have figured that there is a virtual order somewhere, but i can't find it, can't see it.
    How can I cancel that order(s) without having to access the code itself?
    Where can I see that order(s)?

    I can set start behavior to "immediately submit", that turns the strategy to green, but the sync column shows "false", and when I sync the strategy it immediately enters a position.
    Last edited by ajgoodhouse; 09-17-2024, 08:54 AM.

    #2
    Hello ajgoodhouse,

    This means the strategy calculated a historical position and it is waiting for this to close before submitting the first real-time order (and turning green).

    This is discussed on the support article linked below.


    The position is historical so will not show on the positions tab of the control center.

    Without access to the code, it will not be possible to close the historical position by submitting an exit order.

    Note, this would be a position opened by a filled entry order. (A filled order cannot be cancelled and is not the same thing as a position)

    You could instead choose to use the Immediately Submit Synchronize Account Start behavior.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hey, thanks,
      changing it to Immediately Submit Synchronize Account Start behavior opens a position as soon as I enable the strategy. That's not what I want.
      What do I have to insert into the code to close these historical positions?

      Comment


        #4
        Hello ajgoodhouse,

        You can use the suggested code from the support article I have linked in post # 2.

        if (State == State.Historical && CurrentBar == Count - 2)
        {
        if (Position.MarketPosition == MarketPosition.Long)
        ExitLong();
        if (Position.MarketPosition == MarketPosition.Short)
        ExitShort();
        }
        Chelsea B.NinjaTrader Customer Service

        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