Техническое задание
I am looking for an experienced MQL5 developer to convert a multi-timeframe Heiken Ashi trading strategy, currently written in Pine Script, into MQL5 for use in MetaTrader 5. The strategy involves multiple conditions across different timeframes and includes entry/exit signals, position tracking, and stop loss management.
I will be using this primarily for 15 minute charts on multiple different pairs. Also, as you are working on the conversion, if you see something that will cause the strategy to not preform as intended, you would fix it so it is performing correctly. I'm happy to have a quick video call to walk through the strategy as needed to make sure everything is working properly.
Details of the Pine Script Strategy:
-
Strategy Overview: The strategy utilizes Heiken Ashi candles across seven different timeframes (15m, 30m, 1h, 2h, 4h, 12h, and 1D) to determine the market trend and make trade decisions. A long position is taken when all Heiken Ashi bars are green, and a short position is taken when all are red.
-
Position Management: The script includes logic to avoid re-entries while in a position and switches between long and short positions based on the trend change. For example, when all of the Candle Timeframes turn green, it will close out of a short position and take a long position that is roughly 2% of the overall account size. It will then close out that position and take a short position when they all turn red. These orders will take place on the opening of the next candle after changing trend direction to make sure it doesn't get affected by repainted candles during that time frame.
-
Stop Loss: The strategy employs a stop loss mechanism set at 50% of the entry price for long positions and 150% for short positions.
-
Trade Visualization: The Pine Script plots shapes on the chart to indicate entry and exit points, which is a feature I would like to retain in the MQL5 conversion but isn't a strict requirement.
-
Alert System: The current script uses custom alert messages for trade entries and exits. The converted MQL5 code should include similar alert functionality that can be linked to MetaTrader's native alert system.
Specific Requirements:
-
Multi-Timeframe Analysis: The MQL5 script must accurately perform Heiken Ashi calculations across the specified timeframes and use these for trend determination (I believe there are already indicators that have been programmed that can be used just like TradingView).
-
Trade Execution: The script should execute buy and sell orders according to the strategy logic, with appropriate checks to prevent duplicate entries.
-
Stop Loss Management: The converted script should include a stop loss mechanism that triggers an exit at 50% below the entry price for long positions and 50% above the entry price for short positions.
-
Graphical Elements: Plot arrows or other graphical objects on the chart to visualize entry and exit points.
-
Notifications: Implement notifications within the MQL5 script that correspond to the strategy's trading actions. These should be configurable to send alerts within MT5
-
The script must be fully functional and tested in MetaTrader 5 for both backtesting and live trading.
-
The final product must adhere to best coding practices and performance optimization standards of MQL5.
Deliverables:
- A fully functional MQL5 script that replicates the provided Pine Script strategy.
- Documentation/commentary within the code explaining the function of each segment.
Optional:
- A brief user manual explaining how to apply the strategy in MetaTrader 5, including any necessary setup steps or parameters that need to be configured by the user.
- A test report showing the strategy being run in the MetaTrader 5 Strategy Tester, including any relevant performance metrics.
- A short video demonstration of the strategy being applied and running in a live environment.
Here is the Pine Script code for reference: