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 NullPointStrategies, Today, 05:17 AM
        0 responses
        49 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        67 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X