theforexedge » Sun Apr 12, 2015 7:03 pm wrote:Steve
I've been using the Daily FX indicator attached, as I remember you saying a few times that FFCal wasn't too reliable
Here's the code I've managed to cut and paste together that I'm currently using....
Code: Select all extern string Text_News = "----News Filter Settings >>>";
extern bool UseNews = false;
extern int MinsBeforeNews = 720;
extern int MinsAfterNews = 1; ;
string NN = "<<< News Handling Impact Filter: 0=Disabled, 1=Low, 2=Medium, 3=High >>>";
extern int ImpactFilter = 3;
bool ReportAllPairs = false;
bool ReportAllForUSD = false;
bool IncludeHigh = true;
bool IncludeMedium = false;
bool IncludeLow = false;
bool IncludeSpeaks = true;
bool NewsTime;
string NewsTimeComment = "";
Code: Select all void NewsHandling()
{
static int PrevMinute = -1;
if (ImpactFilter > 0) {
if (Minute() != PrevMinute)
{
PrevMinute = Minute();
int minutesSincePrevEvent = iCustom(NULL, 0, "FFCal_DailyFX", IncludeHigh, IncludeMedium, IncludeLow, IncludeSpeaks, 1, 0);
int minutesUntilNextEvent = iCustom(NULL, 0, "FFCal_DailyFX", IncludeHigh, IncludeMedium, IncludeLow, IncludeSpeaks, 1, 1);
int impactOfPrevEvent = iCustom(NULL, 0, "FFCal_DailyFX",IncludeHigh, IncludeMedium, IncludeLow, IncludeSpeaks, true, 0, true, -1, -1, ReportAllPairs, ReportAllForUSD, false, false, 4, true, 8, DeepSkyBlue, Gray,Red,Orange,Khaki, 2, false, false, 2, 0);
int impactOfNextEvent = iCustom(NULL, 0, "FFCal_DailyFX",IncludeHigh, IncludeMedium, IncludeLow, IncludeSpeaks, true, 0, true, -1, -1, ReportAllPairs, ReportAllForUSD, false, false, 4, true, 8, DeepSkyBlue, Gray, Red, Orange, Khaki, 2, false, false, 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)
{
NewsTime = true;
NewsTimeComment = "Ongoing News, Trading Disallowed LVL " + impactOfPrevEvent + " " + minutesSincePrevEvent + "Mins. Ago, LVL " + impactOfNextEvent + "in " + minutesUntilNextEvent + "Mins.";
status=status+" Trading Disabled By News.";
}
if (impactOfNextEvent >= ImpactFilter)
{
NewsTime = true;
NewsTimeComment = "UpComing News, Trading Disallowed LVL " + impactOfPrevEvent + " " + minutesSincePrevEvent + "Mins. Ago, LVL " + impactOfNextEvent + "in " + minutesUntilNextEvent + "Mins.";
status=status+" Trading Disabled By News.";
}
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
Hope it's useful
Jason
Thanks Jason. For now, Tommaso's thingy is doing the job I need it for, but I will look at your offering as well. Much appreciated, my friend.
 |