Add XAUUSD strategy Adaptation
This commit is contained in:
+10
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user