指定
The bot must be written in MQL5 and must meet the following requirements:
Core Logic
-
Range drawing
-
The bot should draw a range based on hours and minutes (for example, from 15:30 to 16:30).
-
-
Deviation levels
-
After drawing the range, it should calculate deviations of this range.
-
Example: if the price of the instrument moves in a range of $100, the bot should create 3 levels upward and 3 levels downward (a total of $300), drawn in $100 steps both above and below.
-
These will later serve as potential targets.
-
-
Sweep and FVG detection
-
The bot should monitor the price: when it sweeps above or below the range, it should search for a Fair Value Gap (FVG) on a configurable timeframe (e.g., 1-minute, 5-minute, etc.).
-
If the sweep is below, it should look for a bullish FVG. Once it is formed, on the 3rd candle it should immediately place a market buy trade, with the Stop Loss set at the bottom of the range.
-
For a sell, the logic is the same: if the price sweeps above the range, the bot should look for a bearish FVG on the chosen timeframe, and place a sell with the Stop Loss at the top of the range.
-
-
Take Profit (TP)
-
TP should be based on the deviation levels, and it must be possible to configure exactly which deviation level(s) to use.
-
-
Break Even (BE)
-
The bot should be able to move the Stop Loss to Break Even once a defined R multiple is reached.
-
Example: if from entry to SL the distance equals 1R = $5, then once the trade reaches $5 profit, the SL should be moved to BE.
-
This must be configurable.
-
Options inside the bot
-
Drawing and monitoring a range from specific start hour:minute to end hour:minute.
-
Ability to set risk as a percentage of account balance or a fixed amount in money.
-
TP placement based on deviation levels.
-
Option to move SL to BE at a specified R multiple from entry to stop.
-
Option to take partials (partial profits) at defined R multiples.
-
Day of the week filter — the bot must allow enabling/disabling trading on specific weekdays (e.g., only trade on Tuesday–Thursday).
-
Magic Number — all trades opened by the bot must use a configurable Magic Number for tracking.
-
FVG timeframe — the timeframe on which the bot will search for Fair Value Gaps should be configurable (e.g., M1, M5, M15, etc.).