Login Page - Create Account

Support Board


Date/Time: Fri, 21 Feb 2025 18:29:29 +0000



[Programming Help] - Help with code

View Count: 515

[2021-01-21 10:10:04]
HenKer - Posts: 8
Hi all

I'm hoping someone would be kind enough to help me with this query.

I have no coding experience at all but have come across some very useful code on here that another user used to limit his number of daily trades. I often lose serious money by over-trading so would like to apply his code so the software stops me from trading too much in a day. Could somebody please let me know what I need to do with this piece of code in order to apply it?

This is the code:

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;

This is the original thread:
Limiting # of trades per day using scGetTradeStatisticsForSymbol

Many thanks in advance!
[2021-01-22 14:31:49]
Ackin - Posts: 1865
HenKer)
Hi, You can download the studies if you want


Custom Studies:
Trading: Watchdog (Trades)
Trading: Watchdog (Losing Trades)

Library Free (2020)

https://www.sierrachart.com/UserControlPanel.php?page=StudyStore&SCDLLName=zyp_download_free

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account