Advertisement IC Markets

Scaling rules after payout — keeping challenge habits on funded

Navigate the rules, daily drawdown limits, and consistency guidelines of prop trading firms. Discuss how to pass funded account challenges using scalping strategies.
PTScalper
Site Admin
Posts: 3349
Joined: Mon Jul 20, 2026 1:28 pm

Re: Scaling rules after payout — keeping challenge habits on funded

Post by PTScalper »

The Midnight Gap Edge Case

This logic elegantly handles the most dangerous VPS crash scenario: a crash at 23:45 and a reboot at 00:15.
Because the EA pulls the current server time on initialization and compares it to the saved g_currentDay, it instantly recognizes that the day has rolled over during the downtime. It will ignore the cached balance, pull the new midnight balance, and overwrite the storage files automatically, keeping your drawdown limits mathematically accurate for the new session.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
Recommended broker for automated trading & scalping IC Markets
PTScalper
Site Admin
Posts: 3349
Joined: Mon Jul 20, 2026 1:28 pm

Re: Scaling rules after payout — keeping challenge habits on funded

Post by PTScalper »

To implement a webhook notification, the most critical architectural requirement is spam prevention (a state latch). Because OnTick fires hundreds of times per second during high-volume sessions, triggering an HTTP request as soon as equity drops below the threshold will instantly spam your API and get your webhook IP-banned.

We need to add a boolean flag (_alertSentToday) that resets at the start of the daily rollover.

Here is how to implement the Telegram Bot API natively in both MT5 and cTrader, including the state latches.

1. MetaTrader 5 (MQL5): Telegram WebRequest

In MT5, you use the native WebRequest() function.
Requirement: You must explicitly allow [https://api.telegram.org](https://api.telegram.org) in the MT5 Terminal options (Tools > Options > Expert Advisors > Allow WebRequests for listed URL).

Code: Select all

//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
input string InpTelegramBotToken = ""; // Telegram Bot Token
input string InpTelegramChatID   = ""; // Telegram Chat ID

bool g_alertSentToday = false;

//+------------------------------------------------------------------+
//| Telegram HTTP Post Function                                      |
//+------------------------------------------------------------------+
bool SendTelegramMessage(string message)
{
    if(InpTelegramBotToken == "" || InpTelegramChatID == "") return false;
    
    string url = "https://api.telegram.org/bot" + InpTelegramBotToken + "/sendMessage";
    string headers = "Content-Type: application/json\r\n";
    
    // Construct JSON Payload
    string payload = "{\"chat_id\":\"" + InpTelegramChatID + "\",\"text\":\"" + message + "\"}";
    
    char data[], result[];
    string result_headers;
    StringToCharArray(payload, data, 0, WHOLE_ARRAY, CP_UTF8);
    
    // Fire WebRequest (timeout 1000ms)
    int res = WebRequest("POST", url, headers, 1000, data, result, result_headers);
    
    if(res != 200) Print("Telegram Error Code: ", res);
    return (res == 200);
}

//+------------------------------------------------------------------+
//| Integration into Gatekeeper                                      |
//+------------------------------------------------------------------+
bool IsDrawdownCompliant()
{
    if(g_startOfDayBalance <= 0) return false;
    
    double currentEquity = AccountInfoDouble(ACCOUNT_EQUITY);
    double maxAllowedLoss = g_startOfDayBalance * (InpDailyDDLimitPct / 100.0);
    double currentLoss = g_startOfDayBalance - currentEquity;
    
    if(currentLoss >= maxAllowedLoss)
    {
        // 1. Trigger the Alert Latch
        if(!g_alertSentToday)
        {
            string alertMsg = "🚨 ALGO LOCKOUT 🚨\n" +
                              "Account: " + IntegerToString(AccountInfoInteger(ACCOUNT_LOGIN)) + "\n" +
                              "Daily DD Breached. Max allowed loss: $" + DoubleToString(maxAllowedLoss, 2);
                              
            SendTelegramMessage(alertMsg);
            
            // Native MT5 Push to phone app (optional fallback)
            SendNotification(alertMsg); 
            
            g_alertSentToday = true;
        }
        
        return false;
    }
    
    return true;
}

// Inside your OnTick() Rollover check, add:
// if(timeStruct.day_of_year != g_currentDay) { ... g_alertSentToday = false; ... }
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 3349
Joined: Mon Jul 20, 2026 1:28 pm

Re: Scaling rules after payout — keeping challenge habits on funded

Post by PTScalper »

2. cTrader (C#): Native Http Request

In cTrader, you can use the built-in Http service.
Requirement: You must elevate the robot's access rights to AccessRights = AccessRights.Internet in the header, otherwise the cBot will sandbox the HTTP request and throw an exception.

Code: Select all

using System;
using cAlgo.API;

namespace cAlgo.Robots
{
    // CRITICAL: Must include AccessRights.Internet to allow webhooks
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.Internet)]
    public class PostPayoutRiskManager : Robot
    {
        [Parameter("Telegram Bot Token", DefaultValue = "", Group = "Alerts")]
        public string TelegramBotToken { get; set; }

        [Parameter("Telegram Chat ID", DefaultValue = "", Group = "Alerts")]
        public string TelegramChatId { get; set; }

        private bool _alertSentToday = false;

        protected override void OnTick()
        {
            int serverDay = Server.Time.DayOfYear;

            // Session Rollover
            if (serverDay != _currentDay)
            {
                // ... Balance anchoring logic here ... //
                
                // Reset the alert latch for the new day
                _alertSentToday = false;
            }
            
            // ... Active DD flat-account trigger here ... //
        }

        private void SendTelegramAlert(string message)
        {
            if (string.IsNullOrWhiteSpace(TelegramBotToken) || string.IsNullOrWhiteSpace(TelegramChatId)) 
                return;

            try
            {
                // URL Encode the message to handle spaces and newlines safely
                string url = $"https://api.telegram.org/bot{TelegramBotToken}/sendMessage?chat_id={TelegramChatId}&text={Uri.EscapeDataString(message)}";
                
                // Execute HTTP GET (synchronous, but fast enough for a single daily trigger)
                var response = Http.Get(url);
                
                if (response.IsSuccessful)
                    Print("Telegram lockout alert sent successfully.");
                else
                    Print($"Telegram HTTP Error: {response.StatusCode}");
            }
            catch (Exception ex)
            {
                Print($"Webhook Exception: {ex.Message}");
            }
        }

        private bool IsDrawdownCompliant()
        {
            double maxAllowedLoss = _startOfDayBalance * (DailyDdLimitPct / 100.0);
            double currentLoss = _startOfDayBalance - Account.Equity;

            if (currentLoss >= maxAllowedLoss)
            {
                if (!_alertSentToday)
                {
                    string alertMsg = $"🚨 ALGO LOCKOUT 🚨\nAccount: {Account.Number}\nLimit of ${Math.Round(maxAllowedLoss, 2)} breached.";
                    SendTelegramAlert(alertMsg);
                    
                    _alertSentToday = true;
                }
                
                return false;
            }

            return true;
        }
    }
}
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 3349
Joined: Mon Jul 20, 2026 1:28 pm

Re: Scaling rules after payout — keeping challenge habits on funded

Post by PTScalper »

Setup Steps for the Telegram Bot

If you haven't set up the bot infrastructure yet:

Message @BotFather on Telegram and send /newbot.

Copy the HTTP API Token he provides (this is your TelegramBotToken).

Send a message to your new bot, then go to [https://api.telegram.org/bot](https://api.telegram.org/bot)<YOUR_TOKEN>/getUpdates in your browser. Look for the "id" under the "chat" object. This is your TelegramChatId.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
LondonScalper
Posts: 770
Joined: Sat Sep 05, 2026 7:54 am

Re: Scaling rules after payout — keeping challenge habits on funded

Post by LondonScalper »

Fairman wrote:Getting a payout feels like permission to loosen. That is exactly when funded accounts start looking like challenge accounts in reverse — size up, stretch rules, “I earned this.” I treat post-payout as a high-risk psychology window, not a victory lap.
Post-payout as a risk window is the correct framing. The cheque is not a rule change.

Challenge habits I keep on funded: same session fence, same max tickets, same daily loss stop, same A+/B grading before size. The only number that may move after a payout is withdrawn cash, not risk per trade. If anything, I run one week at challenge size deliberately — call it a cool-down — before any step-up that was already written in the plan.

Desk process the morning after payout: open the rule sheet first, not the platform. Tick each rail. If I catch myself thinking “I can afford a wider stop now,” that thought alone is a red flag for the session.

Funding is a lease with conditions. Treating the payout as permission to loosen is how leases end early. Keep the boring rails; let the calendar celebrate, not the blotter.
PropScalpDesk
Posts: 364
Joined: Sat Sep 19, 2026 7:50 pm

Re: Scaling rules after payout — keeping challenge habits on funded

Post by PropScalpDesk »

Fairman wrote:Getting a payout feels like permission to loosen. That is exactly when funded accounts start looking like challenge accounts in reverse.
Post-payout is a psychology window, not a victory lap. I keep challenge habits on purpose: same risk band for the first funded weeks, same daily hard stop relative to firm DD, same news blackout, same journal fields. Passing did not invent a new edge; it invented a new way to feel entitled.

Scaling rules on this desk: no size increase on payout day or the next session; scale only after a pre-defined sample of process-compliant days; small steps only; size from the new cushion after withdrawal if trailing/static floor tightened. “I earned this” is the tag I force into the journal for two weeks so I can see the urge in ink.

Frankfurt practicality: cool-down is mandatory. Celebration belongs offline. The account does not need a parade; it needs the same boring rails that passed the evaluation.

If trailing DD is tight after a withdrawal, do you cut % risk first, or keep risk and shrink ticket count?
Post Reply