Awesome!
Thanks guys. I was hoping it would be that way, but did not expect it would be the answer.
The indicator I have written can be called like any other, so programmers no longer really need my IsNewsTime() function/library.
But I did not want to make it too cumbersome to call with a dozen parameters..
With that all in mind, and so you all can test with it, I release version 01 of FFCal (Forex Factory Calendar).
Keep a couple things in mind:
1) It hasn't been tested much. There may be bugs.
2) You still have to give it the offset of your broker from GMT time. First parameter, defaulted to 1 (GMT+1).
3) It doesn't draw anything on the screen at this time. So what DOES it do?
It gets each news time for the currency pair on the chart its applied to. It puts the minutes until each event in the index zero buffer. In the index one buffer, at ExtMapBuffer1[
MinutesUntilLastNew
MinutesUntilNextNew
Also, it puts out a comment at the top left of the chart announcing the time until the next news event, as well as some additional info. Please note that for now, once an event has passed, the minutes until event will be negative. I was not sure how long I should post the info from the expired event, but decided for now to do so until the next event is closer than the previous one.
The indicator also does 2 optional alerts. These values are defaulted to -1. Change them to minutes if you want the alerts, e.g.:
setting....
Alert1MinsBefore = 15;
Alert2MinsBefore = 25;
...willl cause the EA to put up an alert 15 and 25 minutes before each event.
Please use, test, let me know what's wrong, or what else you would like it to do. If you want to change the code, PLEASE comment your changes well, increment the version number, ans send it back to me.
Best to all! Sorry it took so very long. Thanks to Ron for his support. Hope I haven't forgotten anything; it's late and I need to get some sleep.
-Derk
...
-
Parameters set (if necessary). The passed parameters and
their order must correspond with the desclaration order and the type of
extern variables of the custom indicator.
mode
-
Line index. Can be from 0 to 7 and must correspond with
the index used by one of SetIndexBuffer functions.
shift
-
Index of the value taken from the indicator buffer (shift
relative to the current bar the given amount of periods
ago).
It looks like I have the basic news
avoidance indicator about done.
One question for any programmer who can
answer though... when you make an iCustom call (which is what you can now do
to use the new indicator), it seems you have to send in all the parameters..
-Derk