Add XAUUSD strategy Adaptation

This commit is contained in:
peter
2026-05-28 19:09:09 -04:00
parent 6208bbd9c5
commit fff49ea9da
5 changed files with 192 additions and 85 deletions
+10 -1
View File
@@ -83,7 +83,16 @@ public:
// Check if spread is acceptable
bool IsSpreadAcceptable()
{
return mp_market_data.IsSpreadAcceptable(g_max_spread_points);
int max_spread = g_max_spread_points;
string symbol = mp_market_data.GetSymbol();
// XAUUSD/gold normally trades with a much wider spread than forex
if(StringFind(symbol, "XAU") >= 0 || StringFind(symbol, "GOLD") >= 0)
{
max_spread = MathMax(max_spread, 200);
}
return mp_market_data.IsSpreadAcceptable(max_spread);
}
// Check if trading is allowed by time filter