High frequency trading regarding trade in goods of agricultural origin

This work presents the usage model in high frequency trading mechanisms concerning goods of agricultural origin. The aim of this study is to verify this type of solution on the basis of historical data covering the period from April 1, 2013 to April 30, 2014. The most common ratios, i.e. Annualised Return, Investment Risk, Maximum Drawdown, as well as Information Ratio have been chosen as the measures of strategy usefulness. Options varying in both the horizon and the time interval have been considered. The best results have been achieved with respect to the historical time horizon for appointing the benchmark proportion of securities and exceeding one day, as well as one-minute time interval. It is worth emphasizing that the investment issue constitutes a very complex problem influenced by a large number of factors. Owing to this fact, no universal mode of conduct guaranteeing profits may be unequivocally indicated. It is possible only to define a scenario, which shall prove effective with a substantial degree of probability.


INTRODUCTION
Any human activity makes a permanent process of decision making.The choice of the appropriate strategy constitutes an essential factor contributing to the future development and its rate.Nowadays, farmers worry not only about what shall be produced, but also about when, to whom and in which form goods shall be sold.Therefore, they are increasingly benefiting from forms of securing themselves against a future change in prices or exchange rates.Such a solution allows farmers to focus all their efforts on production, not on timeconsuming searching for customers.Including future contracts constitutes one form of such a security, was presented by Dunis and others [7].This work presents a mechanism of further trading in such a financial instrument, i.e. algorithmic trading, and more specifically pair trading -one of its forms, both of which do not require the farmer's direct time involvement. .One example is the method of pairs trading.This approach allows for the construction of a trading strategy where trades are entered when the process reaches an extreme value and exited when the process reverts to some equilibrium value.This technique was developed in 1980 by a team scientist lead by a Wall Street quant Nunzio Tartaglia [8].Since then in the world published many bibliographic items describing strategies based on pairs trading.Huck [10] proposed a general and flexible framework for pairs selection.He used multiple return forecasts based on bivariate information sets and multi-criteria decision techniques.Bertram [2] presented analytic formulae and solutions for calculating optimal statistical arbitrage strategies with transaction costs.The author assumed that the traded security had been described by an Ornstein-Uhlenbeck process.Broussard and Vaihekoski [3] investigated the practical issues of implementing the self-financing pairs portfolio trading strategy.Using data from the Finnish stock market over the period 1987-2008, authors found pairs trading to be profitable even after allowing for a one day delay in the trade initiation after the signal.Tourin and Yan [13] proposed a model for analyzing dynamic pairs trading strategies using the stochastic control approach.The model was explored in an optimal portfolio setting, where the portfolio consisted of a bank account and two co-integrated stocks and the objective was to maximize for a fixed time horizon, the expected terminal utility of wealth.
The impact of time on making decisions concerning efficiency of high frequency trading on the basis of macroeconomic data was researched, among others, by Scholtus and others [12], who had found out that delay of only a few seconds in decision making, could significantly influence the financial result of the adopted strategy.At the micro scale the research, which detected volatility dynamics and the level of financial time series complexity, was conducted by Aghamohammadi and others [1].In 2009 Izumi and others used computer simulations to evaluate the investment strategy.The authors found out that not only the strategy itself but also the way it is connected with other strategies, i.e. dependance on other players' moves, influences the achieved result.Chang and co-authors [4] used artificial neural networks for detecting purchase and sale signals on the securities market.The technical analysis combined with monitoring sale price/volume diagrams, in which artificial neural networks were applied for choosing the purchase/sale moment, was presented by Chavarnakul and Enke [5].Gradojevic and Gencay [9] adopted fuzzy logic for the needs of evaluating the investment risk and choosing a strategy.Fuzzy sets were also used in Chang [4] and others with respect to cyclical stock exchange investments.The cluster analysis with the help of the Support Vector Machine (SVM -the method of machine learning) constituted the subject of research conducted by Choudhury and others [6].In 2013 genetic algorithms also constituted the subject of Mabu and co-authors' work.Here the team's work was concentrated on using the GAs for the needs of decision trees.Kluger and McBride [11] showed implementation of agent-based systems for exploring investment models in intraday investments.
The pork contract -corn contract pair of instruments listed on the Chicago Mercantile Exchange (CME) over the course of one year (from April 1st 2013 to March 31st 2014) constitutes the subject of research.These securities are listed in electronic continuous sessions and are characterized by high liquidity.

Objectives and Scope of Work
The main aim of this study is to verify the usefulness of the mechanism of statistical arbitrage [7]

Methodology of work
Attempts to use temporary price fluctuations of the respective products have been included in the statistical arbitrage in high frequency trading in goods of agricultural origin.The assumption that relations between prices of products belonging to the same sector of economy should be characterized by stability for a long time has been the starting point.The relation stability is understood here as the quotient of prices of two products.In order to determine the investment strategy, the most important thing to do has been to calculate the ratio of goods prices ensuring their balance, as well as the sizes of deviation from the balance level, constituting signals of overvaluing one and undervaluing the other commodity.However, the first step in practical applications is to check the co-integration.

Engle-Granger Co-integration Model
Co-integration is the attribute of time series used in econometrics, which takes place when two series are not stationary but their linear combination is stationary, i.e. irrespective of time.While creating the co-integration model, one should at first create pairs of instruments (most often securities from the same sector, e.g.cereal prices, meat prices, coffee and tea prices, etc.), and then their long-term balance is checked with the help of the co-integration vector, i.e.: where -dependent variable, -independent variable, -co-integration (similarity) coefficient, -random error.
Owing to the fact that estimation of the co-integration coefficient is burdened with an error, adaptive methods of smoothing are used in practical applications: and where -is the random error in the Wiener process.

RESULTS AND DISCUSSION
For the purpose of this work the corn and pork contracts listed on the Chicago Mercantile Exchange have been adopted for analysis (as co-integrated commodities).The analysis of research results shall begin with presenting possibilities of the statistical arbitrage algorithm in high frequency trading.The following has been adopted as the input data in table 1.According to the procedure presented in the section concerning work methods and the operation of the algorithm prototype itself, April 7 th 2014 was treated as the model day for determining the constant proportion between pork and corn.Investing started only on April 8 th 2014.Due to the fact that the value of the Sym_len parameter is 2, the strategy covers also the following day, i.e.April 9 th .Investing took place from 09.30 a.m. to 4.00 p.m. of the local time where the time interval of 1.10 was adopted as the minimum number of units of the respective commodities.The initial capital was established at $ 10,000.00.The input parameters were set in a way that the result presentation was as transparent as possible, thus, the number of units were significantly decreased in relation to the actual ones.Opening positions were set to the value of the standard deviation, whereas closing -to their half.The actual exchange quotations of pork and corn are presented in Figure 1.In order to illustrate the operation of the investment strategy, the original time moments have been collected in Table 2.
At 09:33 the standardised Beta parameter value, i.e. the difference between the forecast and real ratio of the pork price to corn price, decreased below the oSTreshold level, but since it was only the first occurrence, the investor took next actions.At 09.34 the Beta coefficient value decreased below the oSTreshold level again, but because it was the second consecutive occurrence, the investor decides to purchase pork counting on its momentary weakness, by speculating its disproportionate increase in relation to the corn price.The investor simultaneously decided to sell corn for a short while (currently the investor does not own this commodity but is bound with the brokerage agreement concerning this type of operation, according to which the only action the investor is required to conduct is to provide the broker with the appropriate amount of corn until the end of the session day).In the event of any signal of position opening, the capital available for purchase (and short sale) was divided into two equal parts and then the number of possible commodity units (the block multiple -1 block constitutes of 10 tonnes) was calculated.In that case it was possible to purchase 5 blocks of 10 tonnes of pork (at the price of $ 995.15 per each block) and to conduct short sale of 10 blocks of 10 tonnes of corn (at the price of $ 466.00 per each block).
After the operation and deduction of transaction costs, $364.17remained available.Three minutes later the standardised Beta value increased above -0,5.Thus, the investor was able to take the position.The investor sold pork at the price of 99.476 per tonne (so, in case of traditional investing the investor would have suffered a loss) and repurchased corn at the price of 46.48 per tonne (here the investor made a profit by conducting sale at a higher price than purchase).As a result of both transactions the investor had earned $ 9.89 in total.The next position-opening-occurred at 09:39.However, that time the investor had to wait for the closing position until 09:49.Considering transaction costs, the investor's profit rose to $ 9.92.Although both speculations were right, the latter amount was only slightly higher than the previous one.Purchase of pork at $ 99.47 and sale at $ 99.51 and short sale of corn at $46.55 and purchase at $ 46.47.Additionally, the capital value (the sum of available cash extended by the commodity value) was calculated constantly, therefore, the investor was able to withdraw from investment, having recorded a sudden loss.Table 3 presents the mechanism of operation of the system "closing" -the investor's positions at the end of the listing day.Although at 15:45 the Beta parameter value was below -oLTreshold (-0,5), the position "closing" took place as a result of the priority of the closeTime parameter (15:45).

CONCLUSIONS
As shown in the work, the model of the statistical arbitrage with high frequency trading in goods of agricultural origin may constitute an interesting alternative for traditional selling methods.The agricultural producer who decides to sell goods with the help of a future contract shall receive payment for it before delivering it to the stock exchange operator.The agricultural producer's further active participation in the goods trading, for which they have already received remuneration, makes a benefit of the presented solution.
Due to the verification of usefulness of the following stock exchange ratios: Annualised Return, Annualised Volatility, Information Ratio and Maximum DrawDown has been demonstrated that the model of algorithmic trading may be a good tool for conducting investments.It is characterised by significantly lower risk of loss suffering and drawdown.
Among the analysed time intervals (the one-, five-, ten-and fifteen-minute ones), the longest interval has resulted in the highest, 20% annualised return.A slightly lower annualised return has been recorded in case of the one-minute interval (nearly 18 %), whereas the other intervals have turned out to be significantly worse.None of these investments have been evaluated as good (IR < 0.5), although the one-, ten-and fifteen-minute intervals have undoubtedly been favourable.The high investment risk has had a negative influence on their evaluation.The relations between the time interval and the strategy quality cannot be clearly defined on the basis of the conducted analyses.
The significant improvement of the quality has been observed as a result of lengthening the time horizon.Owe to this procedure, each strategy has been evaluated as very good or unusually good.However, it has not been possible to specify the cause and effect relationship between the time horizon and the annualised return with the risk level yet.
Further analyses would require conducting research with the help of a multi-criteria optimisation method of the simultaneous influence of the time horizon length and the time interval.The level of opening and closing position (oSTreshold, oLTreshold, cTreshold) would be an additional element, which might have an impact on the investor's profit maximisation.The increase in the number of paired securities (the choice of pairs made among a set of available pairs) could potentially ensure the improvement of quality.
concerning trade in goods of agricultural origin in High Frequency Trading.The scope of work includes: • performance of the investment algorithm prototype based on the mechanism of statistical arbitrage with its implementation in the Matlab environment; • presentation of investment details regarding quick purchase/sale mechanisms; • research of the influence of the time interval and time horizon length on quality of the strategy; • determination of the most important statistics concerning respective options, i.e.Annualised Return, Investment Risk, Maximum Drawdown and Information Ratio (IR).The pork contract -corn contract pair of instruments listed on the Chicago Mercantile Exchange (CME) over the course of one year (from April 1 st 2013 to March 31 st 2014) constitutes the subject of research.These securities are listed in electronic continuous sessions and are characterized by high liquidity.
The term was suggested and introduced into use by the econometricians Robert Engle and Clive Granger in the article published in 1987 under the title Co-integration and Error Correction: Representation, Estimation and Testing.They were, among other things, awarded the Sveriges Riksbank Prize in Economic Sciences in Memory of Alfred Nobel in 2003 for this achievement.

Figure 1
Figure 1 Pork and corn quotations in the successive time moments

Figure 2
Figure 2 Standardised differences of the forecast value and the actual proportion of goods prices (Beta) and the position held by the investor

Table 1
Simulation Input Parameters

Table 2
The example of investment strategy operation

Table 3
The closing mechanism -a position before the end of quotations