good job BG.regarding the time,still prefer it display as countdown timer instead of date and GMT time
MT4 News Calendar Indicator 898 replies
MT4 calendar indicator link request 33 replies
News impact in forex - Need calendar data for my indicator 6 replies
DislikedHeya Derk,
I made some more bug fixes and improvements. I hope the folks at ForexFactory dont mind some of my fixes, it will generate a bit more traffic to/from thier website when indicator is deleted/removed.
Here's a changelog of what I did:
-Added ability to disable Web/URL updates. This is so that the multiple instances of the indicator used by other charts or EAs dont fight with each other (Error code 4103)
-Fixed deleting OBJ_TREND, only deletes its own Trend Lines objects instad of all OBJ_TREND objects
-Fixed deleting OBJ_TEXT , only deletes its own Headlines instead of all text
-Made file name global and indicator now deletes the xml file each time the indicator is put on or removed from chart. Fixed one case of divide by zero where multiple charts indicator is on was trying to overwrite the same file (forces a new download of the xml)
Enjoy folks!
MikeIgnored
Dislikedgood job BG.regarding the time,still prefer it display as countdown timer instead of date and GMT timeIgnored
DislikedHi Derk,
I have attached the indicator to my chart and it does not work. I checked the code and fond that you read the data from an xml file "http://www.forexfactory.com/weekly_calendar.xml"
but the link is missing.
Do I have to do anything else or just compile the FFCal_v01.mq4?
Thanks ,
BluewaveIgnored
DislikedHeya Derk,
I made some more bug fixes and improvements. I hope the folks at ForexFactory dont mind some of my fixes, it will generate a bit more traffic to/from thier website when indicator is deleted/removed.
Here's a changelog of what I did:
-Added ability to disable Web/URL updates. This is so that the multiple instances of the indicator used by other charts or EAs dont fight with each other (Error code 4103)
-Fixed deleting OBJ_TREND, only deletes its own Trend Lines objects instad of all OBJ_TREND objects
-Fixed deleting OBJ_TEXT , only deletes its own Headlines instead of all text
-Made file name global and indicator now deletes the xml file each time the indicator is put on or removed from chart. Fixed one case of divide by zero where multiple charts indicator is on was trying to overwrite the same file (forces a new download of the xml)
Enjoy folks!
MikeIgnored
//Global
#define RETVALUE_CACHE 5 // Minutes since last function call to simply return previous value
#define NOTRADE_PRIOR 30 // Minutes prior to news release during which it's considered "news time"
#define NOTRADE_POST 30 // Minutes since news release during which it's considered "news time"
static bool NewsTime = false;
static datetime dtLastCall = 0;
//The Function
bool TradeNews() {
// if it's been less than 'x' minutes since this function was last
// called, simply return previously determined value.
if (dtLastCall + RETVALUE_CACHE*60 >= TimeCurrent())
return(NewsTime);
// check the calendar
int minsSinceEG = iCustom("EURGBP", 0, "FFCAL_v05", true, false, false, true, 1, 0);
int minsUntilEG = iCustom("EURGBP", 0, "FFCAL_v05", true, false, false, true, 1, 1);
int minsSinceUJ = iCustom("USDJPY", 0, "FFCAL_v05", true, false, false, true, 1, 0);
int minsUntilUJ = iCustom("USDJPY", 0, "FFCAL_v05", true, false, false, true, 1, 1);
Print("minsSinceEG = ", minsSinceEG);
Print("minsUntilEG = ", minsUntilEG);
Print("minsSinceEG = ", minsSinceUJ);
Print("minsUntilEG = ", minsUntilUJ);
// see if the return value should be tripped to true
if (minsUntilEG <= NOTRADE_PRIOR || minsSinceEG*(-1) <= NOTRADE_POST) NewsTime = true;
if (minsUntilUJ <= NOTRADE_PRIOR || minsSinceUJ*(-1) <= NOTRADE_POST) NewsTime = true;
// update the last call timestamp and return a value
dtLastCall = TimeCurrent();
return (NewsTime);
}
int RefreshTime = 0; //ensure that 1st time will run start () { If (TimeLocal() > RefreshTime) { RefreshTime = TimeLocal() + (Ask / Point) + 1800; GrabWeb save this xml file } }
DislikedHeya Derk,
If you have FFCal_v05 loaded on two GBPUSD 5min charts, they will try to read/write to the same file. So the solution is to have FFCal_v05a on one chart be able to update/retrieve the xml file while having the second FFCal_v05a on the second chart only be able to read the xml file and not update it.
I was getting wierd divide by zero (not related to the mod operator one) errors and wierd behavior of the two charts with the two copies of FFCal_v05a running butting heads.
So that's why on the second chart you would set AllowWebUpdates=false, this would be useful to have two different EA's working on two GBPUSD 5min charts using two different FFCal_V05
Thanks!
MikeIgnored
DislikedKurka:
Do the Print statement you have in there print out the right values?
If you add a 5th boloean in each call, set to false, it will not display info on screen, but that should not matter for functionality. Do you have the FFCall loaded on the chart (running the EA) and is it working correctly?
We'll get this working.... :-)Ignored
DislikedKurka:
I've been thinking about it, and I have a bit of free time in the next day or two. If you want to just send me the .mq4 file, I can try to get it working...
If you want me to look at it, let me know which broker you are using, and send the code to me at [email protected], and I'll see if I can't get ya goin'. It shouldn't really matter, but you might also include which currency and TF yo uare using.
-DerkIgnored
DislikedHow about just a function with a NewsTime variable that can be copied and pasted into my EA's. I have 4 EA's currently running. Would like to turn them all off 30 min prior and 30 min after an announcement. Currently doing this manually.
I just trade the EUR/USD, USD/JPY and Cable
It would be nice to monitor all 4 currencies and filter out the high and med announcements.
It would be a good function for everyone to add to there EA's.
Thanks,
KevinIgnored