jaguar1637
Активный участник
extern string News_SETTINGS="To get news, put AvoidNews to true";
extern bool AvoidNews = false;
extern bool AvoidHigh = true;
extern bool AvoidMedium = false;
extern int MinsBeforeNews = 15;
extern int MinsAfterNews = 1;
///////////////////////////////////////////////// in OnTick
///////////////////////////////////////////////
if(AvoidNews == true && numberoftrades == 0)
{
if(Minute()!=PrevMinute)
{
MinSinceNews = iCustom(symbol,PERIOD_M5,"FFCal_mini",AvoidHigh,AvoidMedium,false,true,false,0,true,5,10,true,false,false,4,true,6,DeepSkyBlue,Gray,Red,Orange,Khaki,2,false,true,1,0);
MinToNews = iCustom(symbol,PERIOD_M5,"FFCal_mini",AvoidHigh,AvoidMedium,false,true,false,0,true,5,10,true,false,false,4,true,6,DeepSkyBlue,Gray,Red,Orange,Khaki,2,false,true,1,1);
PrevMinute=Minute();
if(MinToNews<=MinsBeforeNews || MinSinceNews<=MinsAfterNews)
{
ContinueTrading=false;
return;
}
}
}
extern bool AvoidNews = false;
extern bool AvoidHigh = true;
extern bool AvoidMedium = false;
extern int MinsBeforeNews = 15;
extern int MinsAfterNews = 1;
///////////////////////////////////////////////// in OnTick
///////////////////////////////////////////////
if(AvoidNews == true && numberoftrades == 0)
{
if(Minute()!=PrevMinute)
{
MinSinceNews = iCustom(symbol,PERIOD_M5,"FFCal_mini",AvoidHigh,AvoidMedium,false,true,false,0,true,5,10,true,false,false,4,true,6,DeepSkyBlue,Gray,Red,Orange,Khaki,2,false,true,1,0);
MinToNews = iCustom(symbol,PERIOD_M5,"FFCal_mini",AvoidHigh,AvoidMedium,false,true,false,0,true,5,10,true,false,false,4,true,6,DeepSkyBlue,Gray,Red,Orange,Khaki,2,false,true,1,1);
PrevMinute=Minute();
if(MinToNews<=MinsBeforeNews || MinSinceNews<=MinsAfterNews)
{
ContinueTrading=false;
return;
}
}
}