Support Board
Date/Time: Tue, 16 Dec 2025 00:52:54 +0000
Post From: Trade Statistics in ACSIL
| [2025-12-02 18:03:14] |
| jsandlan - Posts: 85 |
|
When I have Trade and Current Quote Symbol (Action) set to a different symbol than the current chart and Use As Trade Only Symbol set to yes in Chart Settings > Symbol the study below only returns trade stats for the Trade Only symbol. I’ve discovered that the trade statistics returned by ACSIL are not including all trades across all symbols. Is there a way to retrieve trade stats for all symbols, not just the chart symbol or the trade-only symbol? Here is the original implementation that returns only trades for the ticker the chart is set to trade from: SCDLLName("TradeLocker") SCSFExport scsf_TradeLocker(SCStudyInterfaceRef sc) { const int MaxTrades = 4; static int LastTradingDay = -1; static int TradesToday = 0; if (sc.SetDefaults) { sc.GraphName = "TradeLocker"; sc.AutoLoop = 0; sc.GraphRegion = 0; // ✅ Default to Chart Region 1 return; } int CurrentTradingDay = 0; sc.GetTradingDayDate(CurrentTradingDay); // Reset trade count at start of a new day/session if (LastTradingDay != CurrentTradingDay) { LastTradingDay = CurrentTradingDay; TradesToday = 0; sc.SetTradingLockState(0); SCString resetMsg; resetMsg.Format("New trading day detected: %d. Lock reset.", CurrentTradingDay); sc.AddMessageToLog(resetMsg, 0); } // Count completed trades since session start int completedTrades = sc.GetFlatToFlatTradeListSize(); if (completedTrades > TradesToday) TradesToday = completedTrades; s_SCPositionData PositionData; sc.GetTradePosition(PositionData); SCString msg; msg.Format("Completed Trades Today: %d / %d, Position Quantity: %.2f", TradesToday, MaxTrades, PositionData.PositionQuantity); sc.AddMessageToLog(msg, 0); // Lock/unlock logic if (TradesToday >= MaxTrades && PositionData.PositionQuantity == 0) sc.SetTradingLockState(1); else sc.SetTradingLockState(0); } Date Time Of Last Edit: 2025-12-02 18:26:29
|
