Support Board
Date/Time: Sat, 26 Sep 2026 08:52:22 +0000
GetTradePosition() reports non-flat position with zero corresponding activity in Trade Act
View Count: 245
| [2026-08-09 15:26:15] |
| User300970 - Posts: 2 |
|
Symbol: MNQU26-CME, Account: Sim1, Trade Simulation Mode: On Method: Trade >> AutoTrade System Replay BackTest (Accurate Trading System Back Test Mode) sc.SendOrdersToTradeService is confirmed set to 0 (matches Trade Simulation Mode On, re-asserted every calculation call outside SetDefaults). Sequence observed: 1. sc.SellEntry() is called with a Target1Price/Stop1Price attached bracket (SCT_ORDERTYPE_LIMIT / SCT_ORDERTYPE_STOP). Return value: 1 (success). 2. On a later bar, price trades through the Target1Price level. 3. sc.GetTradePosition().PositionQuantity continues to read -1 for the remainder of the backtest (6,600+ subsequent bars) -- it never returns to 0. 4. Trade Activity Log (All Activity, Sim, all symbols, date range from before the backtest start) shows ZERO records for this symbol/account in the entire window -- no order, no fill, no rejection. 5. Trade Service Log for the same window shows nothing either -- no ignored-order message of any kind. Expected: either the order should be visible somewhere in Trade Activity Log / Trade Service Log (accepted, filled, or rejected with a reason), or sc.GetTradePosition() should reflect 0 if no order was actually accepted. Right now sc.SellEntry() returning success, sc.GetTradePosition() reporting an open position, and Trade Activity Log / Trade Service Log showing literally nothing are all mutually inconsistent. Relevant sc.SetDefaults flags: sc.AutoLoop=1, sc.SupportAttachedOrdersForTrading=1, sc.AllowMultipleEntriesInSameDirection=0, sc.AllowOnlyOneTradePerBar=1, sc.CancelAllOrdersOnEntriesAndReversals=1, sc.MaximumPositionAllowed=default I'm sending the full Message Log via "Send for Analysis" since it's too large to paste (20MB+, full backtest run) -- noting that here per your posting instructions. |
| [2026-08-13 15:35:11] |
| Sierra_Chart Engineering - Posts: 24976 |
|
There must be at least one fill loaded in the chart, which is causing this position: 3. sc.GetTradePosition().PositionQuantity continues to read -1
Look at the Trade Statistics for Charts tab of the Trade Activity Log: Trade Activity Log: Trade Statistics for Charts (Chart Stats) Tab Do you see a row there for the particular chart containing the study, calling this function? You will need to make sure this option is enabled: Chart Settings >> Trading >> General >> Include Chart Trade List in Trade Statistics for Charts Window : Yes The field you want to look at on that tab at is: Order Fills Start Date-Time Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2026-08-13 15:36:00
|
| [2026-08-13 17:42:57] |
| User300970 - Posts: 2 |
|
Checked the Trade Statistics for Charts tab as requested (Include Chart Trade List in Trade Statistics for Charts Window enabled). Row for this chart shows: Fills Start Date: No Fills Open Quantity: 0 Total Fills (Daily): 0 So there's no pre-existing fill loaded for this chart/symbol/account -- the persistent fill record is empty. This is the state after using Clear Trade Simulation Orders & Data. The behavior in question happens *during* an AutoTrade System Replay BackTest run specifically: sc.SellEntry() returns 1, and sc.GetTradePosition().PositionQuantity reads -1 for the rest of that run -- but this Trade Stats for Charts view (and Trade Activity Log, checked with All Activity / wide date range) show nothing for that run either, before or after. Does "No Fills" here rule out a pre-loaded fill as the cause, or is there a different date/setting I should check specifically during an active backtest rather than after it completes? Thank you for your time! |
| [2026-08-13 18:04:16] |
| Sierra_Chart Engineering - Posts: 24976 |
|
This is very involved troubleshooting of what is happening in your case, which we do not do. We are sure there is nothing wrong on the Sierra Chart side. One thing to check is to see if there is any query count, at the time you notice this: Trade Activity Log: Trade Activity Not Displaying or Clearing (Improving Trade Activity Query Performance) Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2026-08-13 18:05:26
|
To post a message in this thread, you need to log in with your Sierra Chart account:
