Смотри, как бесплатно скачать роботов
Ищи нас в Telegram!
Ставь лайки и следи за новостями
Интересный скрипт?
Поставь на него ссылку - пусть другие тоже оценят
Понравился скрипт?
Оцени его работу в терминале MetaTrader 5
Советники

Prop Drawdown Guard - эксперт для MetaTrader 5

Yury Muryn
Yury Muryn
Разработка торговых роботов, индикаторов и утилит для MetaTrader 5 на MQL5.
Просмотров:
46
Опубликован:
\MQL5\Include\PropGuard\
MQL5 Фриланс Нужен робот или индикатор на основе этого кода? Закажите его на бирже фрилансеров Перейти на биржу


Prop Drawdown Guard is a read-only monitoring panel for prop-firm accounts. It performs no trading operations: it only reads account equity and symbol properties and draws a panel.


METRICS
- Daily budget Bd = E0 * Ld / 100, where E0 is equity at 00:00 server time (or a manual value).
- Daily usage Ud = 100 * max(0, E0 - E) / Bd.
- Total usage Ut = 100 * max(0, P - E) / (P * Lt / 100), where P is the peak equity of the current day.
- Remaining daily budget Rd = max(0, Bd - Dd).
- Max lot = floor(min(E * R / 100, Rd) / (S * V) / LotStep) * LotStep, capped by broker volume max/step. If the result is below the broker minimum, 0.00 is shown instead of raising the lot above the budget. If the point value V is unavailable, "n/a" is shown.

STATES
SAFE (<50%), WATCH (50-80%), WARN (80-100%), LOCK (>=100%) of max(Ud, Ut). Escalation is immediate; de-escalation requires usage below the threshold minus hysteresis (2% by default). Each transition writes one log record and sends at most one push notification per 60 seconds.

PERSISTENCE
E0, peak and the day stamp are stored in terminal global variables PDG_<login>_E0, PDG_<login>_PEAK, PDG_<login>_DAY. Values survive terminal restarts and are shared by all charts of the account. At 00:00 server time the daily budget resets.

INPUTS
InpDayStartEquity - day start equity, 0 = auto (0)
InpDailyLimitPct - daily limit %, 0.1..20 (3.0)
InpTotalLimitPct - total limit %, 0.5..30 (6.0)
InpRiskPerTradePct - risk per trade %, 0.05..5 (0.5)
InpStopPoints - stop distance in points, >=1 (250)
InpLotStep - lot step (0.01)
InpWarnLevel1 - WATCH threshold, % (50)
InpWarnLevel2 - WARN threshold, % (80)
InpHysteresisPct - de-escalation hysteresis, % (2.0)
InpAlertPush - push notifications (true)
InpRefreshMs - refresh period, ms, 100..5000 (500)
InpPanelCorner - panel corner (upper right)

FILES
Experts/PropGuard.mq5; Include/PropGuard/RiskModel. mqh, State.mqh, Panel.mqh; Scripts/PropGuardSelfTest.mq5 (control vectors, prints PASS/FAIL and the measured calculation cost).

NOTES
Works on netting and hedging, any timeframe; one expert per chart (platform limit). In visual Strategy Tester the panel is active; during optimisation it is completely disabled. Attach to the symbol you trade: the point value is taken from that symbol. The total limit is measured from the intraday peak; if your firm uses a different anchor, set InpDayStartEquity manually. This is a monitoring aid, not a trading blocker.

Пример советника FxCraft — прорыв диапазона с отложенными ордерами Пример советника FxCraft — прорыв диапазона с отложенными ордерами

Обучающий эксперт: прорыв дневного диапазона с отложенными ордерами BuyStop/SellStop, соотношением риска и прибыли, тейк-профитом и торговыми днями. Четкий, прокомментированный код на MQL5 с проверками маржи и уровня стопа. Только для демо-счета и Тестера стратегий.

Spread Monitor Spread Monitor

Spread Monitor — это советник MQL5, который выводит на график панель с цветовой маркировкой. На панели отображается текущий спред выбранного символа в пунктах, а также среднее, минимальное и максимальное значения за скользящий период. Кроме того, он подсчитывает, сколько сохраненных значений превышало уровень предупреждения, и окрашивает строку статуса в красный цвет, когда текущий спред превышает этот уровень. Утилита не размещает ордеров. Параметры позволяют настраивать уровень предупреждения, размер истории, интервал обновления и положение панели. Объекты панели удаляются при отсоединении советника.

Risk Lot Panel Risk Lot Panel

Панель на графике, которая преобразует настройку риска в размер лота и показывает, как шаг объема и минимальный лот брокера влияют на этот риск. Только для просмотра — она никогда не размещает, не изменяет и не закрывает ордера.

BacktestOverfitting: probability of backtest overfitting (PBO) of an optimization BacktestOverfitting: probability of backtest overfitting (PBO) of an optimization

Вероятность переобучения при бэктесте (PBO) оптимизации на MT5 с использованием комбинаторно-симметричной перекрестной проверки. Каждый проход отправляет свои дневные результаты в виде фрейма, а показатель PBO рассчитывается по завершении оптимизации.