“Hedging and non-hedging trading strategies on commodities using the d-Backtest PS method. Optimized trading system hedging”

Modern trading systems are mechanic, run automatically on computers inside trading platforms and decide their position against the market through optimized parameters and algorithmic strategies. These systems now, in most cases, comprise high frequency traders, especially in the Forex market. In this research, a piece of software of an automatic high frequency trading system was developed, based on the technical indicator PIVOT (price level breakthrough). The system made transactions on hourly closing prices with weekly parameters optimization period, using the d-Backtest PS method. Through the search and checking of the results, two findings for optimization of trading strategy were found. These findings with the order they were examined and are presented in this paper are as follows: (1) the simultaneous use of “long and short” positions, with different parameters in a hedging account, acts as a hedging strategy, minimizing losses, in relation to a “long or short” in a non-hedging account for the same time period and (2) there is weak correlation of past backtesting periods between the same systems, if they are configured for “long and short” trades, or for just “long” or for just “short”.


INTRODUCTION
The current research examines a strategy for offsetting risk (hedging) when trading on commodities.In order to achieve this, it uses the same system that has undergone separate parameter optimization for long and short positioning and runs in two independent cases for long and short positions with different parameters.
The PIVOT indicator was used in order to implement three automated trading systems (Expert Advisors).In short, these systems take the respective action when the price line crosses the barriers that are formed from the previous high or previous low prices.The parameters for making these decisions were chosen through the d-Backtest PS method of Vezeris, Schinas, and Papaschinopoulos (2016) for parameters optimization, where the best backtesting period is derived and then the best parameters.
The first of these automated trading systems has always a long or short position open at any given time, the second one only uses long positions, and the third one only uses short positions.Because these three systems behave differently from each other, the parameter optimization through the d-Backtest method yields different parameters for each, which are also derived from different backtesting periods for each Expert Advisor.
The last two Expert Advisors can be used together, each one on half the available balance, to form a hedging strategy.This approach was tested with four assets: COTTON, NATGAS, OIL and XAUUSD.These results allowed to assess the effectiveness of trading both long and short positions simultaneously as a hedging method in comparison to the long or short approach of the first Expert Advisor.

LITERATURE REVIEW
There has been a plethora of papers about the topics the authors concern themselves with in this paper: hedging strategies, high frequency traders, commodities and relatives, risk and momentum, speculation, energy dynamics, hedging and backtesting.The systems implemented in this research trade as high frequency traders on commodities and energy assets, performing fine tuning through back testing on hedging and non-hedging strategies.

High frequency trading systems
High frequency traders (HTFs) constitute important professionals with automated trading systems as stated by the Security and Exchange Commission SEC (2010).The introduction of Chi-X in Europe -that permitted HFT -was controversial as was the introduction of a similar system and specifically the EuroSETS on LSE competing the NYSE-Euronext, which had failed as Foucault and Menkveld (2008) prove.But what was confirmed is the liquidity connection because of the simultaneous participation of automated systems in many markets.
According to the abovementioned, the cost of a trade is actually the difference of bid-ask, namely the spread between them.This distance is shaped mainly by: a) the cost of processing orders; b) the cost of the opposite choice (position swap) with supply or demand; c) the cost of risk taking from the secured risks that are required for price risk.
So it is examined that the change of prices around the clock is formed in a way so that it is analyzed whether HFT is sensibly influencing the market prices.Are the HFTs market-makers?The answer is positive from Menkveld (2011) and the influence can be noticed in two ways: a) permanent price changes are negatively correlated with position swap of the HFT and also the price errors are negatively correlated with HFT position, and b) during the negotiation day, the HFT position creates important pressures of prices.It is an economically significant amount, like for example bigger than the half of bid-ask average.
High frequency trading systems trade aggressively towards the direction of price changes.High frequency traders may compete for liquidity and reinforce the variability of the prices as claimed by Kirilenko, Kyle, Samadi, and Tuzun (2017).But in situations of sudden crash, where there is intense downtrend, there is the solution proposed by Masteika, Rutkauskas, and Tamosaitis (2012) for algorithmic trading and market analysis for hedging accounts through backtesting of future markets.As for these trades that are given with limit orders, the trading systems must check, besides the price limit, equally important the trade volume.In these cases, there is a need for an optimized frame of order execution policies on tick, for which a noteworthy work has been made by Guilbaud and Pham (2015).What interests the authors is the stop loss function to repel the collapse risk because of HFTs, because all of the systems in this research trade in high frequencies.Finally, HTFs increase the quality of the market, which was examined by Aitken, D. Harris, and F. Harris (2015) and presented as overwhelmingly positive.Indeed, the tick size for every symbol is characteristic, because an increase in trades is observed, without the asset being checked not only for the quality, but also for the buy cost margin.That way, the high frequency investors prefer the low cost ticks as claimed by Frino, Mollica, and Zhang (2015).
In the current research, all results have been derived on HFT on H1 timeframe.The only difference from real time trading is that a) stop loss is triggered on closing price and not during every tick, b) there is no pressure on prices, because it is in backtesting mode, but either way there would be no pressure as the trading amount is just $1,000.Consequently, all the positive elements of automated high frequency trading are encompassed, but with some bigger loses due to delays on stop loss (they don't happen on tick, but on closing prices).

Hedging
Hedging is usually described as taking a complementary action that would prevent big amounts of losses.This complementary action is in some way opposite of the main action and it would cancel it out in case things don't go as predicted.This tactic is used in all sorts of environments where prices can unpredictably go up or down with most common of the foreign exchange markets, for example, Akansha (2013) describes how Indian businesses protect themselves from the volatility of foreign exchange rates.Hedging has also been used in commodities markets, see Witt, Schroeder, and Hayenga (1987) for an example of hedging approached for agricultural commodities.There are a lot of strategies about implementing hedging, Dash and Kumar (2013) analyze and compare a few of them.In this research, a form of hedging was examined where a trader is using different strategies for opening and closing long and short positions for the same asset instead of choosing to open either a long or a short position for that asset.This means that long and short positions can exist at the same time for a given asset and in cases of sudden volatility and unanticipated rise or fall in prices the long positions can be offseted with short positions and the short positions can be offseted with long positions.
In the present research, the authors will be implementing hedging strategies in HFTs with an automated trading system based on the d-Backtest PS method on commodities.

Commodities and equities
Several commentators have hinted at an increase in the correlation, in recent years, between equity and commodity returns, hinting at the bigger investments in commodity-related products as the reason behind that.In their work, Lombardi and Ravazzolo (2016) discuss the implications of this for asset allocation by examining various measures of correlation.They found that modeling equity and commodity prices together can give accurate forecasts, which can help for better portfolio management.This, however, has the negative trade-off of higher volatility.Therefore, the popular opinion that commodities have to be used in investment portfolios as hedging device is not substantiated.
Ohashi and Okimoto (2016) investigated how the exuberant co-movement of prices in commodities, that is, the correlation in commodity returns after filtering out common basic hocks has differentiated over the past three decades.They found that big increasing long-run trends in exuberant co-movement have presented themselves since around 2000.Moreover, they found that no serious growing trends exist in the exuberant comovement between off-index commodities and that the increase of global demand cannot explain by itself the growing trends.They concluded that these findings provide more facts for the timing and the extension of the recent growing commodity-return correlations that imply an effect of the financialization of commodity markets that started around 2000.
Investment Management and Financial Innovations, Volume 15, Issue 3, 2018 Using a generalized dynamic factor model, Lübbers and Posch (2016) found a hidden common factor in the return of a wide sample of thirty-one commodity futures between 1996 and 2015.They demonstrate that an examination of subperiods shows a growing correlation between the common factor and transitions in gold and oil prices during the years of the financial crisis.
Their findings also indicated that, in recent years, a growing homogeneity of the commodity markets exists.

Risk and momentum
In this research, historical data of the commodities XAUUSD, COTTON, NATGAS and OIL (commodities and energy) were used.In the paper of Carter, Rogers, Simkins, and Treanor (2017), previous research on the risk management in commodities by nonfinancial firms was analyzed and they also provided a review and a summary of the findings until then.In that study, they analyze how the current research gives evidence to whether the commodity risk is expressed in the behavior of share price and whether the use of derivatives, tools for commodity risk management, is linked to lowered risk.
In the work of Z. Zhang and H. Zhang (2016), the statistical properties of precious metals' daily price returns and Value-at-Risk were examined.An approach with two stages which combines models of GARCH type with extreme value theory was used.
In the first stage, they model the conditional variance in the returns of precious metals.Then, in the following second stage, they used an extreme value approach to identify the distribution's tail behavior for the extracted standardized residuals.
Gold was found to have the highest and steadiest VaRs, with platinum and silver following next and with palladium at the bottom being the most volatile in terms of VaRs.
In their paper, Awartani, Maghyereh, and Guermat (2016) used the implied volatility indexes to research the directional risk transfer from oil to various assets such as Euro/Dollar exchange rates, US equities, agricultural commodities and precious metals.Small volatility transmission was found from oil to agricultural commodities, but large volatility transmission was found from oil to equities.The spillover of risk from oil to Euro/Dollar rates and from oil to precious metals was found to be moderate.Oil was found to be the primary driver of its correlation with all of these abovementioned markets, because the opposite volatility crossover from them to oil was small.Finally, they find that the transmission of volatility from oil to other markets has grown since the reduction in the price of oil in July 2014.
Chaves and Viswanathan (2016) examined mean reversion and momentum strategies in the prices of commodity futures and commodity spot prices.They concluded that, in futures markets, momentum performs well, but mean reversion does not.
In spot markets, on the other hand, they found that mean reversion performs well, but momentum does not.One more interesting finding of theirs is that a continuous trend in spot prices cannot justify momentum in futures prices.
In her article, Miffre (2016) analyzed recent academic research that examined the effectiveness of strategies using both long and short positions in commodity futures markets.The majority of literature indicates that using long and short positions in commodity futures markets is better compared to being long only.
In the recent years of economic crisis, the safeheaven role of gold and other precious metals has been broadly studied.In their article, Li and Lucey (2017) analyzed four precious metals (namely gold, silver, platinum and palladium) for their changing roles as safe-heavens against equities and bonds, extending previous academic studies.They found that each one of these metals can play a safe-haven role versus an asset, although sometimes different precious metals can take this role in different time periods.The second part of that article attempted to find political and economic factors that influence the safe-haven properties of precious metals.
One such factor was identified as the economic policy uncertainty, which plays a decisive role in the safe-haven properties of a precious metal.
Consequently and according to the above, one can offset the investment risks with metals, but there are cases where more commodities are worth having in one's portfolio.

Speculation
In their work, Mohaddes and Raissi (2017) examined the volatility of the commodity terms of trade (CToT) and their impact on economic growth.They also examined the role of Sovereign Wealth Funds (SWFs) and the quality of a country's institutions in the performance of their long-term growth.They concluded that although volatility in CToT has a negative effect in economic growth, it can be mitigated with the existence of a Sovereign Wealth Fund and better institutional quality in a country.
Pirrong (2017) made a survey about the economics of manipulation in commodity markets.Several kinds of such manipulation have been identified in the economics literature.Among them manipulation by fraud, trade-based, and market power manipulation.He concluded that, because basic economic principles make it possible (and profitable), commodity market manipulation will always exist.
Using a thorough sample of macroeconomic news announcements from U.S. and China, Smales (2017) concluded that volatility in the prices of commodities is substantially affected by news that contain information in relation to forthcoming demand for commodities.Volatility in commodity prices is also tightly correlated with credit cost.He determined that the biggest reason for this phenomenon is energy markets' volatility.
In their study, Kocaarslan, Sari, Gormus, and Soytas (2017) examined the effects of volatility expectations in various assets (currency, gold, oil, U.S. stocks) on conditional and time-varying correlations between U.S. and BRIC stock markets.Then, they analyzed the dependence structure that contained asymmetric and non-linear interactions by examining the dynamic and conditional correlations.Their results indicate that in both financial and non-financial markets, dependence between markets is affected by the perceptions of risk apart from the level of their correlation.
Shanker (2017) developed new indicators of adequate speculation and excess speculation for the futures markets.She defined adequate speculation as the amount that equates to unbalanced hedging, and excess speculation as the amount of speculation that overtakes the previous amount.The indicators took special care to balance hedging and speculative contracts.The conceptual definition from Working (1960) for his speculative index is estimated accurately by those indicators.She also showed that adequate speculation causes volatility in crude oil futures to decline, but extreme speculation causes crude oil futures' volatility to increase.
Haase and Huss (2018) showed that price volatility is reduced by speculative activity, particularly during times of turmoil.Their results were extracted from wheat future contracts on different commodity exchanges that displayed various degrees of speculative activity.
There have been a lot studies on commodity futures markets and on the impact of speculation on them.They sit on a range of qualities and usually focus on different variables for speculative effects (for example, volatility, price, effects of spill-overs) and also use different speculation measures.Haase, Y. Zimmermann and H. Zimmermann (2016) reviewed 100 papers published or cited the most over the last ten years and evaluated their results and methodology on this topic.They found that when studies used immediate measures of speculation, their results contradicted the criticized effects of speculation, in contrast with the general picture of results being equally supporting and contradicting the criticized effects of speculation.
Consequently, speculation and manipulation in the markets is a fact.Also, a fact is the influence of the markets by news and rumors.In cases of great speculation, there is an increase in volatility.

Energy dynamics
In Kuck and Schweikert (2017) in their work reexamined the hypothesis for globalization and regionalization of the global crude oil market.They looked into major oil prices for long-period equilibrium associations and examined the period of adjustments that follows the states of disequilibrium.Their results suggested that the world crude oil market is indeed globalized.Another interesting conclusion in their study was that the global economic uncertainty appears to be connected to how much integrated the market is.
In their work, Mann and Sephton (2016) empirically studied dynamics and ties between the price of crude oil benchmarks.The results showed a long-period relationship between the pairs WTI-Oman and WTI-Brent from physically segregated spot markets when they applied threshold co-integration.They also found evidence that all three oil benchmark move towards restoring the longperiod relationship of both of these pairs through the use of threshold error correction models.
Haugom and Ray (2017) for the first time examined the relationships between volatility, liquidity, and distribution of returns for the market of crude oil futures.When trading activity, defined as the number of distinct trades, raises, then, the distinct volatility forms a "smile" curve.On the other hand, when trade size raises then volatility plummets resulting in a "frown" curve.The energy commodities play a very important role and influence the rest of the pairs.Many publications have correlated their behavior with the prices of stocks, exchange rates and other commodities.

Hedging and backtesting
All hedging practices have a target of securing the capital and lowering the risk of loss.Spencer, Bredin, and Conlon (2018) researched the hedging characteristics of physical commodities in order to learn more about significant properties of commodities such as corn and ethanol.All commodities that are storable can be affected by their empirical findings.Data sets for spot ethanol prices that are frequently cited in the bibliography and have differences because of their methodologies for data collection have been discussed and explained.The selection of data has been found to be very important for hedge effectiveness.Based on this overview of the data, they concluded that the best models for futures hedging are the simple ones rather than the complicated ones.
Thompson (2016) introduced a method for hedging and pricing optimization for gas storage facilities and leasing contracts when the risk of counter-party credit is present.They managed to explain the vast majority of the curve dynamics by developing a Markovian representation independent of time with fewer factors and with the seasonality of volatility taken into account.Next, they derived a system of partial differential equations that could be used for optimization and valuation and the technique of radial basis function was used to solve this system of equations.The use of this framework allowed for the identification of storage contracts that were of high deliverability.Also, a list of analytic radial basis function expansions were produced for the value of the contracts of gas storage as a side product of the partial differential equations solving process.An advantage of these expansions is that they can be analytically differentiated at an extremely low cost in order to obtain statistics for hedging, even with the backing of the millions of contracts that have to be evaluated in order to price and hedge the counter-party credit risk.
The backtesting procedure that Aepli, Füss, Henriksen, and Paraschiv (2017) used was based on scheme of a 520-return rolling window.The estimation through multistaged maximum likeli- hood was used for the calibration of copula functions and univariate models from t = 520 until t + 1.In the next step, specific copula functions were used to simulate dependent uniform variates.
The noise processes that the generalized autoregressive conditional heteroskedasticity models would need can be derived by further transforming these copulas in order to obtain standardized residuals.With the above, they calculated the profit and loss of the portfolio by simulating weekly returns to the count of 10,000.These simulated returns of the portfolio were subsequently contrasted with the historical value.Utilizing the return distributions of the whole forecasted portfolio, the density and risk measure predictions were evaluated.
In the present research, the authors tested nonhedging strategies investing $1,000 in comparison to a 50%-50% hedging strategy ($500 + $500) in HFTs with dynamic changes of parameters.

METHODS
After the implementations of the dynamic backtesting period selection method (d-Backtest PS method) and according to the authors' future research schedule, a series of findings are presented, which optimize a high frequency autonomous and dynamic trading system.In this research, the results of a trading system based on the PIVOT technical indicator are compared.
The research objectives that were methodically undertaken are in sequence: 1) the implementation of a differentiated dynamic parameter selection strategy separately for short and separately for long positions, on a hedging account.Comparison of the results with a simple long or short system in a nonhedging account; 2) correlation of past periods between different strategies of the same system of finding 1.

Domain field and trading rules
The domain field of the PIVOT system, with the period f parameter optimization through back- testing is the following:

Profit and profit factor
Profit and profit factor are two metrics used to determine the profitability and security of the trades executed.They are defined by Gross Profit and Gross Loss.Gross Profit is the sum of all profitable trades: Gross Profit = Trade Outcome, Trade outcome > 0. ∑ and Gross Loss is the sum of all unprofitable trades:  Gross Loss = Trade Outcome, Trade outcome < 0.

∑ (3)
Profit is defined as the net profit: and profit factor is defined as: (5)

Correlation of BT periods of different hedging strategies
Applying the d-Backtest PS method on all verification periods on the three systems, one can calculate and come to useful conclusions to think about regarding the correlation between backtesting periods.
For correlation, the classic mathematical formulae will be used: Variance equation: where in this case x is a backtesting period in weeks and µ is the average of backtesting periods of one system.
Covariance equation: where , x y are backtesting periods of different

Take profit and stop loss on PIVOT
As it is shown below, PIVOT is generally a system of moderate returns and in most of the assets that it was used on, it amounts quite some losses, so it is a good candidate to determine if the hedging strategy discussed in this paper protects from big losses.Although this is not very important, it was also used because of the single variable and the very simple execution rules.
For stop loss, the ATR (average true range) was used, an indicator measuring the average volatility.In order to calculate the hourly volatility, the following equation is used: prev prev 9)   where high is the highest price of a time period, low is the lowest price of a time period and close prev is the closing price of the previous time period.

TR high low abs high close abs low close
To calculate the average volatility, the following equation is used: where in this paper is it set 24 n = in order to calculate the daily average volatility.
The first ATR is given by the equation: .
For take profit, a divisor is used with which the first market entering period is constricted.So the x periods are divided with the divisor and that way a take profit signal is given, as applied in the following rules.In this paper, it is set divisor = 2.
Consequently and after the abovementioned, the rules of the PIVOT trading system are converted with the addition of new functions (see Figure 2): In Figure 3, the opening of a short position in EURUSD is shown on August 30, 2017.With the position opening, the stop loss levels were created at ± 2ATR.But the current price is in profitable position much lower of the stop loss zone.
In Figure 4, the opening of a long position on USDJPY is shown on September 1, 2017.With the position opening, the stop loss levels were created at ± 2ATR.But the exchange rate triggered a stop loss breaking through the long stop loss level momentarily.

Long or short in non-hedging account vs long and short in hedging account
In accounts without hedging, a single position can be opened for each symbol.Consequently, in the AdPIVOT system, after the parameter optimization, a single position can be opened each time.
With the common optimization of the system for long and short positions, common parameters are chosen for the new highs period and the new lows period.
In case opposite positions could be opened for risk offset, the selection of different parameters between short and long positions is necessary.This results from a) that common parameters don't differentiate the system and the strategy from that without hedging, as a single position will be opened each time, b) different parameters will give different positions in different moments so that the hedging is achieved and c) the time series presents different characteristics during the ascent than during the descent (fluctuation, volatility, momentum, etc.).
In the same trading system during the same period, the use of different parameters for long positioning and different for short saw different results compared to the use of same parameters for long and short.The differences and the rules of the two systems are based on the following: 1) The long or short system has same x periods' parameters both for long and short positions; 2) in the long or short only one position can exist each time because of common parameters, when a short position has opened a long position has closed and the same for the reverse.Consequently, the system simulates nonhedging accounts; 3) the long and short system has different parameters of x periods for long positioning and different parameters of y periods for short positioning; 4) in the long and short system both positions can exist at the same time, because of different parameters.Consequently, the system is applied to hedging type accounts.

Data and implementation
The framework used for storing the data and calculating the results, is similar to that presented in Dai, Wu, Pei, and Du (2017).The system and forecast integration was adopted as mentioned in Vezeris, Schinas, and Papaschinopoulos (2016).The technical indicator PIVOT was used with the stop loss and take profit functions as mentioned.The integration to the trading system, the forecast and the unobstructed trading is also seen in Kirk (2014).Systems based on MACD, Wavelet growth, Stochastic K & D were used there from the classic group of indicators categorized as Trend-following (moving average, MACD), Oscillators (RSI, Stochastic, CCI), Volatility (Ave Range, Bollinger, Keltner), Volume (Money Flow, On-balance) and Structure (Fibonacci Numbers, Support and Resistance).
The assumptions about HFT on every tick is based on the fact that liquidity availability is considered certain for the $1,000 of the initial capital base and that the orders are filled in "FILL or KILL" filling policy, because they are calculated on a specific spread and specifically that on the opening price which is equal to the closing price of the immediately previous time period.
The research was applied on four assets: COTTON, NATGAS, OIL and XAUUSD.The data about every asset used in the current research, concern data derived from GEBINVEST and FXTM, for the time period between December 6, 2015 and February 18, 2018.
The client software Metatrader 5, of Metaquotes was used and 3 Expert Advisors were built in total (LSPIVOT, LPIVOT, SPIVOT).Every parameter optimization file was created for each Expert Advisor for the time period studied.Files for 3 systems (for the advanced pivot) x 4 assets x 86 weeks x 30 backtesting for every week = 30.960result files were created in total.
The files were stored in Microsoft SQL Server 2012, where the results were sorted based on the d-Backtest PS method and all the relationships and sorting methods were used.As it has been proven in Vezeris, Schinas, and Papaschinopoulos (2016), a genetic algorithm was not used for reasons of better precision.Records reached the amount of 1.165.210.560.Phase 2: Check of tests completeness for all verification weeks.
Phase 3: Parameter selection, check of neighboring returns and final selection of historical data, based on the maximum profitability.
Phase 4: Storing of the historic performances to be reviewed, based on the selections of the previous phases.

TRIALS AND RESEARCH RESULTS
According to the algorithm which is cited above and according to the following sequence, the experiments were executed as follows: 1) a differentiated strategy of dynamic parameter selection was implemented separate for short and separate for long positions in a hedging account.Comparative results are presented relative to the simple long or short system in a non-hedging account; 2) the correlation coefficient of all the past periods between the different strategies of step 1 was calculated in the same AdPIVOT system.

Long or short vs long and short
The abovementioned system run trades in trial, using the same parameters for long or short positions.Since the system opens and closes positions with the same period x, when it overcomes the highest/lowest asset price, it could never have a short and long position at the same time.Consequently, it could not perform hedging with the same parameters, since it can't happen to have at the same time the highest and lowest price of x periods simultaneously.On the other hand, when the system reaches new, lows it closes long positions and when it faces new highs, it closes short positions.Consequently, with this system, there can't be risk compensation with simultaneous opposite positions.
The parameters of a long pivot system and a short pivot system could be optimized separately, for the same period, that would open only long positions, the first, and only short positions, the second.These two systems could trade simultaneously in a non-hedging account.This can be conceived with the strategy that there won't always be two opposite in volume positions, because the opening of each order will demand the exit from the 2 x ATR channel.Moreover, the stop loss and take profit that in essence close the orders will be based on different parameters.So the three systems were compared to each other, with regard to the profitability and the following results were extracted.
At first, the results of the three systems plus the combined system are compared when all of them are using the default parameters of 24 period high and low lines (initial x = 24 in the pseudocode of section 3.4) constantly throughout the 79 weeks that were examined.Table 1 and Table 2 show the percentage of profitable weeks and the sum of net profits at the end of the examined period.All systems start each week with the same initial capital no matter how profitable or loss-making the week before was.The long||short column presents the results for the nonhedging system that opens only one long or short position at a time.The long + short column preseents the results for the hedging system, which is the combination of the two systems that are optimized and use only long or only short positions, respectively.The two last columns, long and short, show these two individual systems.For most assets there has been some reduction in the percentage of profitable weeks when using the hedging long + short system compared to the long||short non-hedging system.On the other hand, the sums of net profits rise, with every asset losing a lot less when using the hedging system than when using the non-hedging system.
Tables 3 and 4 show the percentage of profitable weeks and the sum of net profits when using the systems mentioned above, but this time with the optimized parameters that the d-Backtest PS method provided for the three systems long||short, long, short.In this case, there is also a reduction in the percentage of profitable weeks when using the hedging system instead of the non-hedging system.The negative net profits still rise in all assets when using the hedging system, except for XAUUSD where the positive net profits are actually diminished.
Comparing the results between the systems using the default parameters and the systems using the optimized parameters through the d-Backtest method, it can be seen that the sums of net profits are higher for both the non-hedging and hedging systems when using optimized parameters, even if the percentages of profitable weeks are higher for the default parameters.
Finally and more as a reference, Table 5 and Table 6 show the results of the same experiments with optimized parameters, but this time with a priori knowledge of the best backtesting periods instead of using the d-Backtest method.In this case too, the same behavior can be observed, with the non-hedging system (long||short) having higher percentage of profitable weeks and higher positive net profits than the hedging system (long + short).
Figure 8 summarizes the picture of the sums of net profits for both the non-hedging system (long||short) and the hedging system (Long + Short), for the three different paramneter selection cases.
The figure summarizes the fact that the combined long + short method does in fact act as a hedging strategy, drastically cutting on the losses, while also taking away a variable percentage of the profits.

Correlation of BT periods of common system, of different transactions
The system trialled in the previous paragraph, was configured to execute trades in three different ways.One way was with long and short transactions concurrently, the other one just with short and the other one with long.The results of the backtesting periods were written down for the period August  There seems to be a weak correlation as the tables show for the different systems, but with a closer look at Figures 9-12 of backtesting periods' lengths (in weeks), the following are observed: a) there are time periods where there is no match in backtesting periods; b) there are periods where there is a match in backtesting periods; c) generally, even if there is no match in periods there is a common upward (with bigger backtesting periods) or downward trend (with smaller backtesting periods).

CONCLUSION
In this research, a strategy for offsetting risk was examined.This hedging strategy uses the combination of two systems that trade independently, one using only long positions and the other using only short positions.The parameters for these systems were optimized separately by the use of the d-Backtest PS method.Other parameter selection processes where also examined and compared, such as using default and constant parameters and using optimized parameters by a priori knowledge of the best backtesting periods.This system derived from the combination of the two systems was compared to the basic system that trades both long and short positions with its parameters selected in the same way as mentioned above.
In all three parameter selection methods the general result was that the combined system showed drastically reduced losses but also fewer profitable weeks and fewer profits, a behavior typical of a hedging system.It was also clear that using parameters optimized through the d-Backtest PS method yield higher net profits in both the hedging and the non-hedging systems.
Lastly, the lengths of the backtesting periods that were derived from the d-Backtest PS method were examined for the three different systems on which this method was implemented (the LongShort system, the long-only system and the short-only system).Weak correlation was found among the past backtesting periods between same systems, if they are configured for long or short transactions, or just for long or just for short.

FUTURE RESEARCH
The next research steps could concern the comparative assessment of different trading systems, with the use of the improved d-Backtest PS method, incorporating all the findings of the present research.

ACKNOWLEDGMENT
This research has been co-financed by the European Union and Greek national funds through the Operational Program Competitiveness, Entrepreneurship and Innovation, under the call RESEARCH -CREATE -INNOVATE (project code T1EDK-02342).
The authors would like to thank COSMOS4U for providing the infrastructure used to conduct this research.
Chang et al. (2010), Zhang et al. (2010), Alom et al. (2011), and Du et al. (2011) reported significant linkages in volatility between agricultural commodities and oil.However, their results were not consistent with the findings ofGilbert (2010) who shows weak linkages between oil and food.

Figure
Figure 1.The rules for executing trades

Figure 7 Phase 1 :
Figure7shows the implementation and the step by step execution of the considerations:

Figure 5 .
Figure 5. Example of long and short positions for the three systems during a sample week

Figure 9 .
Figure 9.A diagram that shows the values of the backtesting periods (in number of weeks) for the three PIVOT systems for COTTON

Figure 10 .Figure 11 .
Figure 10.A diagram that shows the values of the backtesting periods (in number of weeks) for the three PIVOT systems for NATGAS

Figure 12 .
Figure 12.A diagram that shows the values of the backtesting periods (in number of weeks)for the three PIVOT systems for XAUUSD Investment Management and Financial Innovations, Volume 15, Issue 3, 2018 dure, they analyzed future and spot quotation data of West Texas Intermediate (WTI).The capacity of the model in capturing the features of the oil price dynamics is greatly improved when both jumps and stochastic volatility are added to the model.
methodology for estimation was akin to the one used by Andrieu, Doucet, and Holenstein (2010), the Particle Markov Chain Monte Carlo (PM-CMC).In order to execute their deduction proce- Investment Management and Financial Innovations, Volume 15,Issue 3, 2018

Table 1 .
Percentage of weeks with profit factor > 1 for Expert Advisors running with constant default parameters

Table 2 .
Sums of profits during the 79 week period for Expert Advisors running with constant default parameters

Table 3 .
Percentage of weeks with profit factor > 1 for Expert Advisors running with optimized parameters (by means of the d-Backtest PS method)

Table 5 .
Percentage of weeks with profit factor > 1 for Expert Advisors running with parameters optimized with a priori knowledge of the best backtesting periods Long||Short Long+Short Figure 8. Sums of profits using three different parameter setting methods

Table 6 .
Sums of profits during the 79 week period for Expert Advisors running with parameters optimized with a priori knowledge of the best backtesting periods

Table 7 .
Table of correlation coefficients between backtesting periods of the three PIVOT systems on COTTON

Table 8 .
Table of correlation coefficients between backtesting periods of the three PIVOT systems on NATGAS

Table 9 .
Table of correlation coefficients between backtesting periods of the three PIVOT systems on OIL

Table 10 .
Table of correlation coefficients between backtesting periods of the three PIVOT systems on XAUUSD