Telegram DrawnDown control

DD Guardian Bot — User Guide

Requirements

  • MetaTrader 5 (any broker)
  • A Telegram account



    Step 1 — Create your Telegram Bot

    1. Open Telegram and search for @BotFather
    2. Send /newbot and follow the prompts to set a name and username
    3. BotFather will reply with a Bot Token — copy and save it
    4. Send any message to your new bot (e.g. /start ) so it can detect your Chat ID
    5. Open the following URL in a browser to find your Chat ID: https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates Look for "chat":{"id": 123456789} — that number is your Chat ID

    Step 2 — Allow WebRequest in MT5

    1. Go to Tools → Options → Expert Advisors
    2. Check Allow WebRequest for listed URL
    3. Add https://api.telegram.org to the list and click OK

    Step 3 — Configure EA Inputs

    Input Description
    InpBotToken Your Bot Token from BotFather
    InpChatID Your Chat ID (numbers only)
    InpDDThreshold Drawdown % that triggers an alert (default: 5%)
    InpDDCritical Drawdown % that auto-closes all positions (0 = disabled)
    InpUseEquityDD true = Equity vs Balance · false = Floating P/L only
    InpMagicFilter Magic number to monitor (−1 = all orders)
    InpCheckIntervalSec How often to check drawdown in seconds (default: 5)
    InpPollingIntervalSec How often to poll Telegram commands in seconds (default: 3)

    Step 4 — Attach the EA

    1. Drag DD_Guardian_Bot onto any chart (XAUUSD M1 recommended)
    2. The EA does not need to be on the same symbol as your trading bots
  • If configured correctly, a startup message will appear in your Telegram chat within a few seconds


    Telegram Commands

    Command Action
    /status Show current Balance, Equity, DD%, and open position count
    /closeall Close all open positions immediately
    /closeloss Close only positions currently at a loss
    /closeprofit Close only positions currently in profit
    /disable Pause DD monitoring (does not close positions)
    /enable Resume DD monitoring and reset alert state

Alert Behaviour

  • When DD exceeds InpDDThreshold , one alert is sent to Telegram. The alert resets automatically once equity recovers by InpDDRecoveryBuffer percent below the threshold, allowing the next alert to fire if DD rises again.
  • When DD reaches InpDDCritical , all positions are closed automatically and a critical alert is sent. This fires only once per session.
  • A startup message is sent when the EA loads and a shutdown message when it is removed from the chart.

Filtrele:
Değerlendirme yok
Değerlendirmeye yanıt