Normally brokers prevent arbitrage technically - they just don't send quotes that you can use for spread arbitrage. But there were indeed known exceptions, especially with arbitrage between different brokers. It can pay when you observe the markets and look for arbitrage situations.

Caution: in your script above you're comparing price(), which is the mean price of a bar, not a price you can use for arbitrage. You must use priceClose() for this. Also do a backtest with tick data. This is one of the rare situations where tick data makes sense.