명시
I need two simple trading strategies translated into MQL5.
Both systems already work in ProRealTime; I only need them rebuilt exactly the same in MT5.
When accepted you will see the exact parameters.
Please follow these rules:
-
No discretionary logic
-
No optimization
-
Clean, readable MQL5 code
-
Both strategies must run on Daily timeframe
-
Position sizing should follow the formulas I provide
-
Long-only
-
One position at a time
-
Market orders only
-
No trailing stop, take profit, or stop loss
-
Code must compile with zero warnings or errors
📌 Strategy 1 – Mean Reversion with MA Envelope (Daily, Long-Only)
Implement the following:
Indicators
-
A moving-average envelope with upper and lower bands
-
A 200-day trend filter
-
ATR-based position size calculation
Entry
-
Only take long trades
-
Price must be above the long-term trend filter
-
Price must close below the lower envelope band
Exit
-
Close the long position when price closes above the upper envelope band
Position Sizing
-
Dynamic ATR-based sizing:
Uses portfolio equity, a risk percentage, and ATR.
I will provide the formula (implement exactly, no parameter inputs).
📌 Strategy 2 – Donchian Breakout (Daily, Long-Only)
Indicators
-
Donchian breakout channel (Entry based on X-day high, Exit based on Y-day low)
-
ATR-based position size calculation following my formula
-
Uses previous bar values for breakout levels
Entry
-
Enter long when:
Close > previous bar's Donchian high
Exit
-
Exit long when:
Close < previous bar’s Donchian low
Position Sizing
-
ATR-based sizing using portfolio size × risk percentage
-
No external parameters shown to user
📌 General Requirements
-
Build both strategies as two separate EA files
-
Should run on Daily-chart symbol
-
One position at a time
-
Clean code
-
Must work live and in backtesting
-
I provide logic → you translate exactly, MQL5-standard code quality expected
-
Deliver full MQ5 source code