You need to enable JavaScript in order to visit our site!
 
Logo PTMC
NAVIGATION
CANCEL
 
or via PTMC account
Restore password
or via PTMC account
Logo PTMC
NAVIGATION
or via PTMC account
Restore password
or via PTMC account
or via PTMC account
Restore password
or via PTMC account
PTMC team 28.06 2014

Multicurrency trading system: implementation and testing

Hey there, Protraders!

Today's article will focus on such an important topic as multicurrency trading. In general, all trading systems that somehow use the information from several trading instruments, in this case - currencies, can be attributed to a multicurrency trading systems. Directly trading can take place on any number of currencies. What are the prerequisites to the use of multicurrency trading systems? All multicurrency trading systems somehow use the interrelation of trading instruments. The pairs trading can be called a special case of multicurrency trading system when strong direct or inverse interrelation of two currencies is used, for example EUR/USD and USD/CHF. In this case the situation with the anomalous behavior of currency pairs is often traded i.e. if there is a strong positive interrelation of two currency pairs then the anomalous multidirectional movement of the considered pairs will be signal to entry.

It is possible to compile a complex basket of currencies with specific properties, such as high volatility or some degree of stationarity. Statistical currency arbitrage and some high-frequency trading strategies can also be attributed to the multicurrency trading. As already mentioned, the basis of almost all multicurrency trading systems is the interrelation between trading instruments. There are many methods for measuring the strength and direction of this interrelation, one of the most common is the correlation coefficient calculation. In some cases, the interrelation of assets is used not so much, as their potential for diversification of trading strategy risks, a well-known principle "Do not put all your eggs in one basket". But even in this case the diversification degree will directly depend on strength and direction of the traded instruments' relation. Let’s consider the simplest example for the demonstration of interrelation of some assets: let's form the portfolio of the already mentioned currency pairs EUR/USD and USD/CHF. To provide this, use the “Portfolio” tool.

Portfolio

Since the selected currency pairs have the clearly expressed negative relation, let’s choose weight coefficients equal to 1 for each symbol in portfolio. Thus, for creation of this portfolio it is enough to take up unidirectional positions by the two currency pairs.

for creation of this portfolio it is enough to take up unidirectional positions by the two currency pairs

The chart clearly shows that this portfolio has a low degree of trendiness and is different from the properties of individual currency pairs. Thus, the portfolio trading of several instruments gives trader a possibility to create sophisticated trading instruments with some set properties by himself.

Of course, the creation of successful multicurrency strategy will include such steps as optimization of some trading system parameters and its testing. Protrader 3 terminal provides wide opportunities for testing and optimization of strategies in which several trading instruments are involved. And the opportunity to import the external data opens almost unlimited possibilities.

Let’s consider the example of multicurrency strategy implementation on the programming language MQL4. Use the “AlgoStudio” tool. In general, writing of multicurrency trading system does not practically differ from the strategy which uses a single trading instrument. Except that, the opening, modifying, closing of orders and handling the price information will be held on several trading instruments. As an example, let’s create the trading system on already chosen currency pairs EUR/USD and USD/CHF. In one of the previous articles we became familiar with RSI indicator; let’s accept entry of indicator values in the overbought/oversold extreme zones as a trading signal in our system. We will open a short position when the RSI indicator values are greater than 70. A long position will be opened in the case when RSI values are lower than 30. Let’s accept these simple signals of opening the position for already selected currency pairs.

Receiving of the RSI indicator values:

double
RSI1=iRSI("EURUSD",30,10,1,1);
double
RSI2=iRSI("USDCHF",30,10,1,1);

The trading signal will look like this:

bool
Signal_Buy()
// Signal to open a long position
{
if (RSI1<USDDOWN &&
RSI2<CHFDOWN)
return(true);
return(false);
}
bool
Signal_Sell()
// Signal to open a short position
{
if (RSI1>USDUP && RSI2>CHFUP)
return(true);
return(false);
}

Here USDUP, CHFUP, USDDOWN, CHFDOWN– top and bottom RSI extreme zones.

When opening a position you should pay attention to the price constants, in order not to try to open a trade with USDCHF using prices EURUSD:

OrderSend("EURUSD",OP_SELL,lot,MarketInfo("EURUSD",MODE_BID),slippage,0,0,"",MAGICMA,0,Red);
OrderSend("USDCHF",OP_SELL,lot,MarketInfo("USDCHF",MODE_BID),slippage,0,0,"",MAGICMA,0,Blue);
OrderSend("EURUSD",OP_BUY,lot,MarketInfo("EURUSD",MODE_ASK),slippage,0,0,"",MAGICMA,0,Blue);
OrderSend("USDCHF",OP_BUY,lot,MarketInfo("USDCHF",MODE_ASK),slippage,0,0,"",MAGICMA,0,Red);

To conduct the test correctly, make sure you have high-quality historical data of the needed instruments. The “History data manager” tool can be used for this.

History data manager

To test the multicurrency strategies, you should add the trading instruments which your trading system uses in the “Properties” window - > “Backtesting setup”, using “Additional data” menu.

“Backtesting setup”, using “Additional data” menu.

Let’s hold the test for the last month, using modeling scheme – 1m O H L C.

modeling scheme – 1m O H L C

We received sufficiently large quantity of trades.Let’s check, whether were both our selected currency pairs involved in the trading.

selected currency pairs involved in the trading

We can plot an informative pie chart of instruments which were involved in trading.

informative pie chart of instruments which were involved in trading

Sometimes, it just needs to see the process of trading on the chart, if test was conducted in “Visualize backtesting” mode this is easily done in the “Backtester” window.

“Backtester” window

Using the drop-down menu in the tester window we can switch between chosen trading instruments.

 tester window we can switch between chosen trading instruments

In conclusion it can be noted the flexibility and versatility of the “AlgoStudio”. Using this functionality, a trader can create complex trading strategies, including multicurrency, determine their optimal parameters and conduct their testing.

Discussion
Join PTMC community to post your comments
No comments yet. Be the first.
PTMC is a professional trading platform that combines all the best charting and analytical tools to trade on different financial markets. It is developed by PFSOFT UK LTD, a global provider of trading technology for banks & brokers
© 2017. PTMC is based on Protrader technology
Head office
PFSOFT UK LTD
20 Centenary Avenue
South Shields, Tyne and Wear,
NE34 6QH
United Kingdom
Ukraine office
TOV PTMC
26, Naberezhna str., Dnipro,
Dnipropetrovs'k region,
Ukraine
Contact us
Phone: +380 56 740 30 01
E-mail: info@protrader.org
Skype: PTMC_support
Social groups