Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exceeds account's maximum position quantity error

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

    Exceeds account's maximum position quantity error

    Hi could you please help me understand why this error keeps happening (my account position has *not* been exceeded)?

    I use NT8 managed orders: EnterLong("Long") and EnterShort("Short")
    the strategy is working with no errors until I enabled stops:
    SetStopLoss("Long", CalculationMode.Ticks, stopTicks, false);
    SetStopLoss("Short", CalculationMode.Ticks, stopTicks, false);

    The stop APIs are executed right after each EnterLong, or EnterShort respectively.

    From the log file (see included) see that the strategy is entering long filled:
    2025-04-15 02:38:04:801|1|32|Order='3f795fddd0844cc1a8f52308b 4e62a1e/Sim101' Name='Long' New state='Filled'
    ... then shortly after (milliseconds) the stop loss is Accepted:
    2025-04-15 02:38:04:978|1|32|Order='cb21d1d2bd5444b589d2f947e b7208a2/Sim101' Name='Stop loss' New state='Accepted'

    ... all is good until I want to flip this to a Short position with EnterShort("Short") signal:
    NT8 submits a Close Position order (automatically?):
    2025-04-15 07:36:50:030|1|32|Order='54b3150b90394d2580f52c3c1 6ac9180/Sim101' Name='Close position' New state='Submitted' Instrument='MES 06-25' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2025-04-15 07:36:50:031|1|16|NinjaScript strategy 'ErgProf2504/354858892' submitting order
    2025-04-15 07:36:50:033|1|32|Order='82ff2fb7dd40412b9669593e6 a0f16c2/Sim101' Name='Short' New state='Rejected' Instrument='MES 06-25' Action='Sell short' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='Unable to submit order' Native error='Order '82ff2fb7dd40412b9669593e6a0f16c2' can't be submitted: Exceeds account's maximum position quantity.'

    but the "Sell short" order immediately following is Rejected?

    Could you please help explain it?

    Thank you!
    Attached Files

    #2
    Hello momchi,
    • Disconnect from all connections.
    • Navigate to the Accounts tab of the Control Center.
    • Right-click the Sim101 account.
    • Set Max Position Size to 2.
    • Click reset.
    • Reconnect the connection.
    Let me know if this does not resolve the error.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,
      this did resolve it, thank you. But, could you please explain it?
      Why would there be a need for the position to be at 2 contracts in such a case?

      Best wishes,
      Momchil

      Comment


        #4
        Hello Momchil,

        This is to allow the two orders in the same direction.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        39 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 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