Support Board
Date/Time: Wed, 19 Nov 2025 16:15:06 +0000
Post From: sc.GetTradePosition() returns PositionQuantity=0 in Simulation Mode with Symbol Mapping
| [2025-11-18 23:52:57] |
| chikko - Posts: 3 |
|
I'm experiencing an issue with sc.GetTradePosition() returning incorrect position data when using Trade Simulation Mode with symbol mapping (charting one symbol while trading another). Setup: - Trade Simulation Mode: ON (not using Trade Evaluator) - Chart Symbol: NQZ25-CME/MNQZ25-CME[M] (charting NQ, trading MNQ) - Trades are correctly being placed on [Sim]MNQZ25-CME as shown in Trade Activity Log - Study using sc.SendOrdersToTradeService = !sc.GlobalTradeSimulationIsOn; s_SCPositionData PositionData; int result = sc.GetTradePosition(PositionData); if (PositionData.PositionQuantity == 0) { sc.AddMessageToLog("No open position. Cannot add TP/SL.", 1); sc.MenuEventID = 0; return; } SCString positionInfo; positionInfo.Format("Position Details: Quantity=%d, OpenPL=%.2f, DailyPL=%.2f, AverageFillPrice=%.2f", PositionData.PositionQuantity, PositionData.OpenProfitLoss, PositionData.DailyProfitLoss, PositionData.AveragePrice); sc.AddMessageToLog(positionInfo, 0); Actual Output: 2025-11-18 21:07:39.522 | Chart: NQZ25-CME/MNQZ25-CME[M] 5 Min #5 | Study: Smart Trade Manager | Position Details: Quantity=0, OpenPL=-103.50, DailyPL=442.20, AverageFillPrice=24675.00 Problem: PositionQuantity returns 0 despite having an active simulated position. However, other fields like OpenPL, DailyPL, and AverageFillPrice show correct data, indicating there IS a position AND i can clearly see the position open in the chart visually. The Trade Activity Log confirms trades are filling on [Sim]MNQZ25-CME, but sc.GetTradePosition() called from a chart with symbol NQZ25-CME/MNQZ25-CME[M] is not retrieving the position quantity. Attempted Solutions: 1. Used sc.GetTradePositionForSymbolAndAccount() with [Sim]MNQZ25-CME - still returns Quantity=0 2. Used sc.GetTradeSymbol() to get the trading symbol - correctly returns MNQZ25-CME, but querying [Sim]MNQZ25-CME or MNQZ25-CME both returns Quantity=0 Documentation Reference: According to https://www.sierrachart.com/index.php?page=doc/ACSILTrading.html#scGetTradePosition: "For simulated Trade Positions data, the data comes from the internal Trades list of a chart." Questions: 1. Is this expected behavior when charting one symbol but trading another in simulation mode? 2. How should sc.GetTradePosition() or sc.GetTradePositionForSymbolAndAccount() (the latter one probably doesn't even work in sim mode because we don't have an account?) be used to retrieve simulated position data when the chart symbol differs from the trading symbol? 3. Why does PositionQuantity return 0 while other position fields (OpenPL, AverageFillPrice) contain valid data? Is there a different approach needed for accessing simulated position data with symbol mapping, or is this a potential bug? Semi-Related, but same problem: Position quantity with GetTradePosition is 0 on Teton Order Routing It seems like the position quantity is broken in simulation mode. I can't switch to the trading evaluator service at the moment, because i am still relying on delayed EUREX data and your docs are saying this won't work. Thank you for your assistance. |
| Attachment Deleted. |
