Broker Arbitrage

Broker arbitrage opportunities appear when Forex liquidity providers deviate from each other, or when market makers do not precisely follow the market. Since Zorro S can trade with several brokers at the same time, you can compare currency or CFD prices between broker A and broker B, and enter a long position with the cheaper broker and a short position with the other. There is no central exchange for currencies and CFS, so their prices vary from broker to broker. If the price differences temporarily exceed trading costs, you can collect risk-free profits. This does not happen often, but it happens. Here's the step by step setup and a code example for taking advantage of Forex/CFD price differences.

Example:

// Simple broker arbitrage example ////////////////////////////

function tick()
{
  asset("EURUSD_A");
  var SpreadA = Spread, PriceA = priceClose(), 
    CommissionA = Commission*LotAmount/10000*PIP/PIPCost; // convert commission to price difference 
  asset("EURUSD_B");
  var SpreadB = Spread, PriceB = priceClose(), 
    CommissionB = Commission*LotAmount/10000*PIP/PIPCost;

  var Threshold = 1.5*(SpreadA+SpreadB+CommissionA+CommissionB); // arbitrage threshold
  var Difference = PriceA - PriceB;

  asset("EURUSD_A");
  if(NumOpenShort && Difference < 0)
    exitShort();
  else if(NumOpenLong && Difference > 0)
    exitLong();
  else if(!NumOpenShort && Difference > Threshold) // go short with the expensive asset
    enterShort();
  else if(!NumOpenLong && Difference < -Threshold) // go long with the cheap asset
    enterLong();

  asset("EURUSD_B");
  if(NumOpenShort && Difference > 0)
    exitShort();
  else if(NumOpenLong && Difference < 0)
    exitLong();
  else if(!NumOpenShort && Difference < -Threshold)
    enterShort();
  else if(!NumOpenLong && Difference > Threshold)
    enterLong();
}

function run()
{
  StartDate = EndDate = 2017;
  LookBack = 0;
  set(TICKS);
  History = ".t1";
  assetList("AssetsArb.csv");
  asset("EURUSD_A");
  asset("EURUSD_B");
}

See also:

Account list, Brokers, TradeMode

► latest version online