Support Board
Date/Time: Sat, 22 Feb 2025 17:03:56 +0000
Post From: Limiting # of trades per day using scGetTradeStatisticsForSymbol
[2019-07-29 00:44:13] |
Yoda - Posts: 106 |
Using https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scGetTradeStatisticsForSymbol I'm trying to set the maximum number of trades per day. I have the following code which works if each trade only has one entry and one exit: s_ACSTradeStatistics TradeStatistics;
sc.GetTradeStatisticsForSymbol(0, 1, TradeStatistics); int DailyTotalTrades = TradeStatistics.TotalTrades(); int DailyTotalShortTrades = TradeStatistics.TotalShortTrades; int DailyTotalLongTrades = TradeStatistics.TotalLongTrades; // Allow up to 4 trades per day if (DailyTotalTrades < 4 && DailyTotalShortTrades < 4 && DailyTotalLongTrades < 4) // Then okay to trade; However, as soon as as trade has multiple targets / stops, SC counts each target/stop hit has a trade. So for example, my code stops trading for the day if the first trade of the day hits 4 targets. I'd like for SC to ignore the multiple child trades and only count the parent trade. Any suggestions on how I can do this? |