This is a modified version of the popular news indicator FFCal which was published initially by DerkWehler to ForexFactory forum. Actually, I've modified the code to suit my needs but I found that it may be useful for others as well so I decided to share it. I have rewritten the indicator so you can consider it almost "build from scratch" of the original. Yet, it shares the same techniques and main style.
The indicator places a panel on your chart that shows 5 economic events listed on the Forex Factory Calendar. You can filter out/in the events of High, Medium, or Low impact, Speaks, Holidays or by specific keyword filter. Please see all modifications listed below.
Also, the indicator can be called within an EA using the iCustom() function by accessing 2 buffers:
You can call buffers in two ways:
Simple call: (default values will be applied)
int EventMinute = (int)iCustom(NULL,0,"FFC",0,0); if(EventMinute == 30) { .. YOUR CODE .. } // 30 minutes before the event int EventImpact = (int)iCustom(NULL,0,"FFC",1,0); if(EventImpact == 3) { .. YOUR CODE .. } // High impact event
Advanced call:
iCustom( string NULL, // symbol int 0, // timeframe string "FFC", // path/name of the custom indicator compiled program bool true, // true/false: Active chart only bool true, // true/false: Include High impact bool true, // true/false: Include Medium impact bool true, // true/false: Include Low impact bool true, // true/false: Include Speaks bool false, // true/false: Include Holidays string "", // Find keyword (case-sensitive) string "", // Ignore keyword (case-sensitive) bool true, // true/false: Allow Updates int 4, // Update every (in hours) int 0, // Buffers: (0) Minutes, (1) Impact int 0 // shift );
*Please note that the indicator does not have (at this stage) back-testing capabilities.
Suggested style:
Calendar legend:
Real Authors:
Credit:
* In order to use this indicator, you need to turn on DLL Imports in your MetaTrader 4 platform options.
* Please be aware that the code may have some bugs or other flaws, so if you see any bugs or suggestions, or even better code practice, please let me know.
* According to Forex Factory website, all event times are approximate and subject to change.
Continuously records tick data in format "DateTime, Bid, Ask, Volume" even after restart.
This script is used to calculate lot rebate.
Calculates profit (loss) of the current orders on the symbol.
PricePosition indicator provides the position of price in the point of angle when the price rises above (BUY) or falls below the angle section line (SELL).