Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 16:36:46 +0000



Post From: Disable Automated Trading After X Point Profit

[2024-05-13 14:39:29]
emmanuel - Posts: 57
const double DailyProfitTarget = x;
bool EnableTrading = true;
s_SCPositionData PositionData;

if(sc.GetTradePosition(PositionData) != SCTRADING_ORDER_ERROR) {
if(PositionData.DailyProfitLoss >= DailyProfitTarget) EnableTrading = false;
}

// Don't proceed beyond this point if the Daily profit loss is greater than daily target
if(!EnableTrading) return;

See Automated Trading From an Advanced Custom Study: [Type: double] DailyProfitLoss