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!

Comment