Iniciado por
jpalma
Hola amigos,
A ver si alguno de vosotros me puede ayudar.
Quiero poner un filtro de
noticias en un EA, alguna idea?
Gracias a todos.
Buenos dias jpalma:
Seguramente algun compañero que sepa de programacion te podra ayudar mejor, yo te adjunto dos versiones del indicador mas utilizado para lo que tu solicitas, se pueden utilizar otras herramientas, pero este indicador como te comenta el compañero striker es el mas utilizado para tal funcion. Tanto como filtro como disparador, dependiendo para lo que lo necesites, tu como dices seria como filtro.
Tambien adjunto parte del codigo de un EA que lo utiliza:
Código:
void NewsHandling()
{
static int PrevMinute = -1;
if (ImpactFilter > 0) {
if (Minute() != PrevMinute)
{
PrevMinute = Minute();
int minutesSincePrevEvent = iCustom(NULL, 5, "FFCal", IncludeHigh, IncludeMedium, IncludeLow, IncludeSpeaks, 1, 0);
int minutesUntilNextEvent = iCustom(NULL, 5, "FFCal", IncludeHigh, IncludeMedium, IncludeLow, IncludeSpeaks, 1, 1);
int impactOfPrevEvent = iCustom(NULL, 5, "FFCal", true, true, false, true, true, 2, 0);
int impactOfNextEvent = iCustom(NULL, 5, "FFCal", true, true, false, true, true, 2, 1);
NewsTime = false;
NewsTimeComment = "No News, Trading Allowed LVL " + impactOfPrevEvent + " " + minutesSincePrevEvent + " mins. ago, LVL " + impactOfNextEvent + " in " + minutesUntilNextEvent + " mins.";
if ((minutesUntilNextEvent <= MinsBeforeNews) ||
(minutesSincePrevEvent <= MinsAfterNews))
{
if ((impactOfPrevEvent >= ImpactFilter) || (impactOfNextEvent >= ImpactFilter)) {
NewsTime = true;
NewsTimeComment = "Ongoing News, Trading Disallowed LVL " + impactOfPrevEvent + " " + minutesSincePrevEvent + "mins. ago, LVL " + impactOfNextEvent + " in " + minutesUntilNextEvent + " mins.";
} else {
NewsTime = true;
NewsTimeComment = "Ongoing Light News, Trading Allowed LVL " + impactOfPrevEvent + " " + minutesSincePrevEvent + "mins. ago, LVL " + impactOfNextEvent + " in " + minutesUntilNextEvent + " mins.";
}
}
}
} else {
NewsTime = false;
NewsTimeComment = "Check Disabled Trading Allowed";
}
}//Void NewsHandling End
Espero que te sirva.
Un saludo
Hermo.
Foro de Forex Trading United