i need script to disable auto trading if spread wide of x pips and enable it again if spread back to normal
i found this code on net
could you check it to see is this code correct?
regard
it script
Code: Select all
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+#property strict
#property show_inputsextern int MaxSpread=20; //Max Spread in pipettesvoid OnStart()
{
//---
if(MarketInfo(Symbol(), MODE_SPREAD)<MaxSpread){
Print("I can order");
}
else{
Print("Cannot order, spread is too high");
}
}
//+------------------------------------------------------------------+