Advertisement IC Markets

IB-friendly brokers still need fill proof from traders

Compare ECN/Raw spread brokers, analyze execution speeds, report slippage, and evaluate commission structures for high-frequency traders.
PTScalper
Site Admin
Posts: 7647
Joined: Mon Jul 20, 2026 1:28 pm

Re: IB-friendly brokers still need fill proof from traders

Post by PTScalper »

cTrader (C# / cAlgo) Implementation

cTrader handles execution tracking synchronously, allowing you to wrap the execution method in standard C# Stopwatch diagnostics.

1. Capture the Execution Cycle
Wrap the ExecuteMarketOrder call in a timer and compare the pre-execution price to the final Position.EntryPrice.

Code: Select all

using System;
using System.Diagnostics;
using cAlgo.API;

[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FileSystem)]
public class ExecutionLogger : Robot
{
    protected override void OnStart()
    {
        // Example: Execute a buy order
        LogExecution(TradeType.Buy, SymbolName, 1000);
    }

    private void LogExecution(TradeType type, string symbol, double volume)
    {
        double requestedPrice = type == TradeType.Buy ? Symbol.Ask : Symbol.Bid;
        
        Stopwatch timer = new Stopwatch();
        timer.Start();
        
        // Send the order to the server
        TradeResult result = ExecuteMarketOrder(type, symbol, volume, "DisputeTracker");
        
        timer.Stop();
        double latencyMs = timer.Elapsed.TotalMilliseconds;

        if (result.IsSuccessful)
        {
            double executedPrice = result.Position.EntryPrice;
            double slippagePips = Math.Abs(requestedPrice - executedPrice) / Symbol.PipSize;
            
            // Format for CSV database
            string logEntry = $"{result.Position.Id},{Server.Time},{requestedPrice},{executedPrice},{slippagePips},{latencyMs}";
            WriteToCSV(logEntry);
        }
        else
        {
            Print($"Order Failed: {result.Error}");
        }
    }
    
    private void WriteToCSV(string data)
    {
        // Implement standard System.IO.File.AppendAllText to a local CSV path
    }
}
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: 7647
Joined: Mon Jul 20, 2026 1:28 pm

Re: IB-friendly brokers still need fill proof from traders

Post by PTScalper »

Required CSV Formatting for Brokers

To ensure your logs are accepted by a broker's dealing desk, your CSV export functions must contain these exact columns:

Ticket ID: The unique server transaction number.

Server Timestamp: To the exact second (or millisecond if your broker bridge supports it).

Requested Price: The terminal's Top of Book (Bid/Ask) at the exact microsecond of the request.

Executed Price: The final fill price returned by the server.

Slippage (Pips): Standardized distance between requested and filled price.

Latency (ms): The calculated execution delay.

When a dispute arises, providing a filtered CSV containing dozens of trades showing a clear statistical bias—such as 100% negative slippage on limit orders or severe latency spikes solely during winning trades—forces an internal bridge audit.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 7647
Joined: Mon Jul 20, 2026 1:28 pm

Re: IB-friendly brokers still need fill proof from traders

Post by PTScalper »

Capturing the network ping precisely at the moment of the order request isolates the delay. If your execution latency is 1,200ms but your VPS ping is 2ms, the math proves the delay occurred entirely within the broker’s routing bridge, internal queue, or liquidity provider matching engine.

MetaTrader 5 (MQL5) Implementation
In MQL5, the terminal continuously measures the connection quality. You can retrieve the last known ping in microseconds using TERMINAL_PING_LAST right before firing the OrderSend command.

1. Update the Global Variables
Add a variable to hold the network ping.

Code: Select all

ulong last_order_ticket = 0;
ulong request_time_micro = 0;
double requested_price = 0.0;
double vps_ping_ms = 0.0; // Captures network latency
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 7647
Joined: Mon Jul 20, 2026 1:28 pm

Re: IB-friendly brokers still need fill proof from traders

Post by PTScalper »

2. Capture Ping Before Order Execution

Retrieve the terminal's ping state immediately before building the trade request.

Code: Select all

void SendMarketOrder(string symbol, ENUM_ORDER_TYPE type, double volume) {
    MqlTradeRequest request = {};
    MqlTradeResult result = {};
    
    // Capture terminal ping in microseconds and convert to milliseconds
    vps_ping_ms = TerminalInfoInteger(TERMINAL_PING_LAST) / 1000.0;
    
    request.action = TRADE_ACTION_DEAL;
    request.symbol = symbol;
    request.volume = volume;
    request.type = type;
    request.price = (type == ORDER_TYPE_BUY) ? SymbolInfoDouble(symbol, SYMBOL_ASK) : SymbolInfoDouble(symbol, SYMBOL_BID);
    request.deviation = 0; 
    
    requested_price = request.price;
    request_time_micro = GetMicrosecondCount(); 
    
    if (OrderSend(request, result)) {
        last_order_ticket = result.order;
    }
}
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 7647
Joined: Mon Jul 20, 2026 1:28 pm

Re: IB-friendly brokers still need fill proof from traders

Post by PTScalper »

3. Append to the CSV Output

Modify your OnTradeTransaction logging to include the ping.

Code: Select all

void OnTradeTransaction(const MqlTradeTransaction &trans, const MqlTradeRequest &request, const MqlTradeResult &result) {
    if (trans.type == TRADE_TRANSACTION_DEAL_ADD && trans.order == last_order_ticket) {
        ulong execution_time_micro = GetMicrosecondCount();
        double execution_latency_ms = (execution_time_micro - request_time_micro) / 1000.0;
        
        double executed_price = trans.price;
        double slippage_points = MathAbs(requested_price - executed_price) / SymbolInfoDouble(trans.symbol, SYMBOL_POINT);
        
        // CSV Format: Ticket, Time, ReqPrice, ExecPrice, SlippagePts, TotalExecutionMs, NetworkPingMs
        string log_entry = StringFormat("%I64u,%s,%f,%f,%.2f,%.2f,%.2f", 
                                        trans.deal, TimeToString(TimeCurrent(), TIME_SECONDS), 
                                        requested_price, executed_price, slippage_points, execution_latency_ms, vps_ping_ms);
        WriteToCSV(log_entry);
    }
}
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 7647
Joined: Mon Jul 20, 2026 1:28 pm

Re: IB-friendly brokers still need fill proof from traders

Post by PTScalper »

cTrader (C# / cAlgo) Implementation

Since you are running C# inside cTrader, you can leverage the Server.Latency property. This property returns a TimeSpan representing the current round-trip time between your instance and the cTrader server.

Update the Execution Logic

Capture Server.Latency.TotalMilliseconds right alongside your Stopwatch initialization.

Code: Select all

private void LogExecution(TradeType type, string symbol, double volume)
{
    double requestedPrice = type == TradeType.Buy ? Symbol.Ask : Symbol.Bid;
    
    // Capture VPS to Server ping immediately before the request
    double vpsPingMs = Server.Latency.TotalMilliseconds;
    
    Stopwatch timer = new Stopwatch();
    timer.Start();
    
    TradeResult result = ExecuteMarketOrder(type, symbol, volume, "DisputeTracker");
    
    timer.Stop();
    double totalExecutionMs = timer.Elapsed.TotalMilliseconds;

    if (result.IsSuccessful)
    {
        double executedPrice = result.Position.EntryPrice;
        double slippagePips = Math.Abs(requestedPrice - executedPrice) / Symbol.PipSize;
        
        // Calculate the internal broker delay (Total execution minus round-trip network time)
        double brokerInternalDelayMs = totalExecutionMs - vpsPingMs;
        
        // CSV Format: Ticket, ServerTime, ReqPrice, ExecPrice, SlippagePips, TotalExecMs, NetworkPingMs, BrokerDelayMs
        string logEntry = $"{result.Position.Id},{Server.Time:yyyy-MM-dd HH:mm:ss.fff},{requestedPrice},{executedPrice},{slippagePips:F1},{totalExecutionMs:F2},{vpsPingMs:F2},{brokerInternalDelayMs:F2}";
        
        WriteToCSV(logEntry);
    }
}
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 7647
Joined: Mon Jul 20, 2026 1:28 pm

Re: IB-friendly brokers still need fill proof from traders

Post by PTScalper »

Proving the Broker Delay

With this data, you isolate the exact variable dealing desks use to deflect blame. If you log a trade where:

TotalExecutionMs = 850 ms

NetworkPingMs = 3 ms

The BrokerInternalDelayMs is 847 ms. Because your network overhead was negligible, that 847 ms was entirely consumed by the broker's system—either waiting in an overwhelmed FIX bridge queue, or being intentionally throttled by an execution plugin analyzing the toxicity of the order flow before confirming the fill. Presenting these exact three columns together is what escalates the ticket past tier-1 support directly to the dealing desk.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
Shadow Trader
Posts: 5438
Joined: Wed Sep 09, 2026 5:19 pm

Re: IB-friendly brokers still need fill proof from traders

Post by Shadow Trader »

In January 2015, the Swiss National Bank removed its minimum exchange rate against the euro without warning. EURCHF fell by around twenty percent within minutes. Quotes vanished. Some brokers went bankrupt, and many traders ended with negative balances.

A decade later, the event still shapes how experienced traders view the franc. The lesson wasn't that the SNB is unreliable. It was that a market held in place by a policy can break in a moment, and that stops give no protection when no price exists.

CHF pairs today don't have a floor, but the central bank still intervenes at times, and the franc moves as a safe haven during stress. Spread behaviour is a good gauge. Brokers widen CHF spreads before risk events, and sometimes restrict leverage.

For scalping, the practical points are modest. Don't leave positions or pending orders in CHF crosses around SNB meetings. Expect larger-than-normal slippage on stops. And treat any currency that has a managed or policy-supported level as having a hidden tail risk.

None of that means avoiding the franc. It means sizing and timing with the memory of what a missing market looks like.

Which central bank events get avoided entirely, and which ones get traded?
Post Reply