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
Implement the following:
A moving-average envelope with upper and lower bands
A 200-day trend filter
ATR-based position size calculation
Only take long trades
Price must be above the long-term trend filter
Price must close below the lower envelope band
Close the long position when price closes above the upper envelope band
Dynamic ATR-based sizing:
Uses portfolio equity, a risk percentage, and ATR.
I will provide the formula (implement exactly, no parameter inputs).
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
Enter long when:
Close > previous bar's Donchian high
Exit long when:
Close < previous bar’s Donchian low
ATR-based sizing using portfolio size × risk percentage
No external parameters shown to user
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