FX Triangular Arbitrage

Triangular arbitrage is one of those strategies well exploited by the high frequency traders but the question is: do this strategies still work in nowadays markets ? To answer this question i had to leave the meta trader platform and the mql brokers to go with something more serious and advanced, an ECN, Dukascopy and their JForex platform was choosed for this experiment.

Jforex is a trading platform developed by Dukascopy on where the trader can make automatic trading scripts using the java programming language. Between the benefits of this ECN broker and its  platform we can highlight:

- Fast execution.
- Tons of market history for all currencies.
- Possibility to test multi currency strategies against historical data, this wasn’t possible at mql.

A problem we can find with Dukascopy is the high commissions they charge per transaction, this is the price you have to pay for being trading with an ECN.

For illustration purposes only, the commissions were set to be as lower as possible just to know how good or bad the strategy is without the commissions. When i run the strategy in the last 6 months of data with an initial deposit of 100 k here is the report i got:

Report 1

The pairs involved are the EURCAD, the EURUSD and the USDCAD as described by Irene Aldridge(2010).

The strategy made 60 % of profits, there were 137 exploited triangular arbitrage opportunities in the period.

Now, the same period with defaults commissions:

Report 2

Big part of the profit is gone by the commissions when using the real ones.

The discussion is open, comments are more than welcome.

Tags: , , , , , ,

Triangular Arbitrage

In theory triangular arbitrage is an opportunity to a risk free trade. More information about it:

Wikipedia
Investopedia

So, here is the setup i am going to use to construct synthetic EURCAD and trade misprices with the broker EURCAD. Broker is alpari.

EURCADsy,bid = EURUSDm,bid x USDCADm,bid

EURCADsy,ask = EURUSDm,ask x USDCADm,ask

“If market ask for EURCAD is lower than synthetic bid for EURCAD, buy market EURCAD, sell synthetic EURCAD, and wait for the market and synthetic prices to align, then reverse the position, capturing the profit. The difference between the market ask and the synthetic bid should be high enough to at least overcome two spreads—on EURUSD and on USDCAD.”

So the first thing i did was to create an expert advisor to see if we have triangular arbitrage opportunities in decent periods of time, in fact i found we have this chances , at least one per day.The next thing was execute trades accordingly, in here i found some problems. First, meta trader is not able to execute more than one trade at the same time, The solution is to have 3 meta traders in the same computer, logged at the same account, each one taking care of trading one asset.  I also decided to change to the alpari pro feed as it trades are executed automatically, no dealing desk in the middle, trades go directly to ECNs.

Lets see a triangular arbitrage attempt, i made one of the 3  experts take screenshots of entry and exit so i can take a look at the numbers:

Differentiating EURCADsy,bid with EURCADm,ask and later substracting the 2 spreads we end at: 0.00002038.

At close 1 second later:

At here arb is already gone and the trade is closed correctly however we ended up lossing 30 usd(alpari pro also charge 5 usd per trade but let just forgeit for now):

Statement

So what happened ? Checking the statement i can see the EURCAD market was purchased at 1.35236. So making 1.35210038 – 135236 ends up with a negative number, we never had arbitrage because we got inside the trade late. One possible solution to get in a little quicker could be placing limit orders instead of just market orders.

Tags: , ,

High frequency trading

High frequency trading try to exploit small deviations from market fair prices. Entries and exits can be in less than one second, earnings very small but repeating the process during the day HFT(high frequency traders or high frequency trading) make a decent amount of money. Almost all transactions nowadays in forex markets are high frequency.

Our brokers use high frequency techniques to make markets (market making), earn profits from the money we send to them. Using complex mathematics they can make sure that they never go broke while they also provide liquidity to their clients, this tasks are done at high speed and with fully automated programs. When an order from a client came in the algorithms decide what to do with it in milliseconds.

So, to be the broker you need HFT, can we take adv of it as retail small traders ? In theory we can, classic finance tell us that the market is fully efficient, all opinions are reflected in price immediately. This is not what happens all the time, HFT help the markets to be efficient taking advantage of that little inefficiencies the market haves. As the modern markets are decentralized, different exchanges or ECNs have different prices for the same asset leaving the HFT with a lot of arbitrage opportunities.
For instance, the EURUSD can be at 1.3523 at ECN A and 1.3524 at ECN B. forget  slippage, commissions, spreads, etc. the trader can buy the euro in ECN A and sell it at ECN B looking for this 2 to align again. This deviation and later alignment can be of milliseconds but a trader with enough speed of execution can exploit it.

The job of a HFT is to find this deviations, exploit them and make a profit. There are several strategies developed by the HFT, i will try to test and exploit some of them as a retail trader, however the literature is small as the best and most profitable strategies are proprietary and not known by the masses.

Tags: , , , ,