Termos de Referência
Dear Developer,
I am looking to develop both a MetaTrader 5 Indicator and a MetaTrader 5 Expert Advisor (EA) based on the swing depth logic shown in the Pine Script code attached below. The indicator and EA must be built as separate files but must follow the exact same signal logic so both display and execute identically.
Please carefully review the requirements below and confirm your understanding before starting.
Project Deliverables
You will develop two separate components:
-
MT5 Custom Indicator
-
MT5 Expert Advisor (EA)
Both must use identical swing point detection logic and produce the same buy and sell signals.
Core Logic (Source Code Reference)
The following Pine Script contains the exact signal logic that must be used as the foundation of both the Indicator and EA. This logic must be accurately converted into MQL5.
This logic defines the swing point detection and trade direction changes. This must be replicated exactly in MT5.
EA Trading Rules
The EA must operate under the following strict conditions:
One Position Only
-
Only one open trade at any time
-
When a new opposite signal appears:
-
Close current trade immediately
-
Open new trade in opposite direction
-
Entry Conditions
-
Buy when confirmed Buy-point appears
-
Sell when confirmed Sell-point appears
Stop Loss
-
Fixed stop loss of exactly $15 USD per trade
-
Stop loss must be calculated based on USD value, not points
-
Must work correctly on XAUUSD and forex pairs
Trailing Stop (Run More Mode)
-
Trailing activates only after trade reaches +$25 profit
-
Trail stop distance = $20 USD
-
Stop loss must only move forward, never backward
-
Update trailing only if improvement is at least $2 USD
No Fixed Take Profit
Trades must close only when:
-
Opposite signal appears, or
-
Stop loss is hit
Always In Market Requirement
The EA must always maintain an active trade.
If stop loss is hit:
-
Immediately open a new trade in the direction of the most recent confirmed signal
-
Continue operating normally until opposite signal appears
Indicator Requirements
The indicator must display:
-
Buy points at swing lows
-
Sell points at swing highs
And include a live dashboard table showing:
-
Account Balance
-
Profit Today
-
Total Profit/Loss
-
Current Stop Loss Value ($15)
-
Current Direction (BUY or SELL)
-
Open Trade Profit (if applicable)
EA Dashboard Requirements
The EA must display the same table plus:
-
Equity
-
Current Position Status (Buy / Sell / None)
-
Last Signal Direction
Table must update in real time.
Inputs Required in EA
-
Lot Size
-
DEPTH_ENGINE
-
DEVIATION_ENGINE
-
BACKSTEP_ENGINE
-
Stop Loss USD (default 15)
-
Trailing Activation USD (default 25)
-
Trailing Distance USD (default 20)
-
Trailing Step USD (default 2)
-
Magic Number
Symbols and Compatibility
The EA and Indicator must work correctly on:
-
XAUUSD (Primary)
-
Forex pairs
Must correctly calculate profit and stop loss based on contract size and tick value.
Final Requirements
Please confirm the following when replying:
-
You understand the swing logic and can convert it accurately
-
You will deliver both Indicator and EA separately
-
Dashboard table will be included
-
Stop loss and trailing will be based on USD value
-
EA will always re enter the market after stop loss
Please also include your timeline and cost.
Kind regards,