Support Board
Date/Time: Wed, 19 Nov 2025 16:14:08 +0000
Post From: sc.GetTradePosition() returns PositionQuantity=0 in Simulation Mode with Symbol Mapping
| [2025-11-19 08:56:59] |
| User431178 - Posts: 813 |
|
Position quantity is clearly not zero, otherwise your positionInfo message would never be printed due to the early return on zero position... positionInfo.Format("Position Details: Quantity=%d, OpenPL=%.2f, DailyPL=%.2f, AverageFillPrice=%.2f", PositionData.PositionQuantity, PositionData.OpenProfitLoss, PositionData.DailyProfitLoss, PositionData.AveragePrice); The error is in how you format the positionInfo string. Position quantity is not integer type - Automated Trading From an Advanced Custom Study: [Type: double] PositionQuantity Change "Quantity=%d" to "Quantity=%f" (or cast PositionData.PositionQuantity to integer), problem solved. |
