Job finished
Specification
I need to develop an MQL4 trading bot for Forex. Here is the specification.
Indicators
ATR H1, EMA: H4-100, H4-50, H4-18, H4-6, H1-6
Strategy
I will not be sharing my actual strategy but this is what we will spec and code to:
- When all of the EMA bars are stacked, ie: H4-100 > H4-50 > H4-18 > H4-6 > H1-6
- AND the H1-6 EMA has been declining for at least X hours
- AND price is not within a predefined support/resistance zone
- AND we are not within 2 hours of a Medium impact or higher news event
- AND M5 close > H1-6 plus threshold
- Open a BUY trade. Set SL to H1-ATR times a factor, set TP to H1-ATR times a factor.
- If price exceeds a take-profit level, convert to a trailing stop loss (another factor).
- Reverse all conditions for SELL trades.
- Don’t open trades after Friday 14:00 ET.
Each instance of the program will be attached to a chart and trade a single pair. The instances must be completely isolated and independent from each other - although they share common files as described below.
A single instance of the program must not open more than one trade at a time.
I will provide a file containing settings for each Pair and Trading Session (London, London-NY overlap, NY, Other). The program must re-read the settings whenever the Trading Session changes. We will negotiate the file format. The settings will include:
- The factors, thresholds, variables described above
- Zone width
- a few others
To correctly determine the current Trading Session the program must convert current time to ET and London times including DST / Summer time adjustments.
I will provide a file containing Support and Resistance zones for each Pair and Date. The program must read this in at the beginning of each day (5PM ET). We will negotiate the format.
I will provide a file containing news events in a CSV file (the format is as exported by forexfactory.com).
The program must be efficient: it must function only at the close of M5 bars, including adjusting TSL; it must determine trading session only on the hour; it must evaluate EMA alignment only at the close of H1 bars.
The program must be able to run in backtest mode, implementing all of the above functionality on historical data.
We may find MQL4 does not calculate the EMAs in exactly the same way my strategy requires. If that is the case the program must manually calculate all 5 EMAs.
I intend to modify and extend this program. So the code should be well documented and readable and all necessary source code must be provided. Build instructions should be provided.