Optimization Parameters of Trading System with Constant Modulus of Unit Return

The unit return is determined as the return in the quotation currency (QCR) per the unit of base exchange medium (BEM). The main purpose is to examine the applicability of a trading system with a constant modulus of unit return (CMUR). The CMUR system supports speculative operations related to the exchange rate, given as the BEM quotation per the QCR. Premises for investment decisions are based on knowledge about the quotation dynamics described by its binary representation. This knowledge is described by a prediction table containing the conditional probability distributions of exchange rate increments. Any prediction table depends on observation range. Financial effectiveness of any CMUR system is assessed in the usual way by interest rate and risk index based on Shannon entropy. The main aim of our paper is to present algorithms which may be used for selecting effective CMUR systems. Required unit return modulus and observation range are control parameters applied for management of CMUR systems. Optimal values of these parameters are obtained by implementation of the proposed algorithm. All formal considerations are illustrated by an extensive case study linked to gold trading.


Introduction
Each financial instrument is determined as a given asset in short position or in long position. The speculator's earning does not result from the underlying asset attributes, such as long-term technical analysis or fundamental ratios. In general, speculation is the acquisition of a financial instrument with the expectation that it will be sold as more expensive in the near future [1]. Therefore, speculation is acquisition of an asset in anticipation of its price increase, and also the disposal of an asset in anticipation of its price fall. For these reasons, speculation transaction is such financial transactions where the speculator's earnings result from short-term fluctuations in the quoted price of a traded asset. For these reasons, speculation transactions can only be implemented on financial markets characterized by frequent price changes. Moreover, the duration of a single speculative transaction is generally short. This is why speculation transactions require the use of High-Frequency Trading (HFT) systems. HFT systems help traders hold positions for short periods of time and earn their profits by accumulating tiny gains on a large number of transactions [2].
The existing body of literature on HFT is extensive, and it covers many items devoted to different aspects of HFT [2,3]. IT techniques' development implies an increase in HFT systems' popularity.
The subject of speculation is trading in base exchange medium (BEM), given as any currency, any precious metal, or any standardized commodity. All speculative transactions are related to an exchange rate, given as the BEM quotation per the quotation currency (QCR). The trading in called the BEM/QCR market. The Ask price of BEM is the unit price of BEM in the QCR. In each moment of time, t ∈ [0, T], we note the Ask price, Q Ask (t). In this way, we determine the Ask price trend, Q Ask : [0, T] → R + , which describes the dynamics of an exchange pair, BEM/QCR.
In this section, we describe such method of discretization Ask price trend, which is dedicated to CMUR systems. This discretization method was introduced and justified in Reference [4]. The changes on the BEM/QCR market are described by a unit return, defined as a dirty return by the BEM amount. The unit return (t , t ) in the time interval [t , t ] equals (t , t ) = Q Ask (t ) − Q Ask (t ). (1) In the first step, we create a binary representation of Ask price trend. Applied binary representation is inspired by the historical point-symbolic notation [40].
We observe a continuous trend, Q Ask : [0, T] → R + . If a single trend observation begins at the time t , then it ends as early as possible at the moment t > t , fulfilling condition (t , t ) = δ > 0 (2) where δ is assumed as the discretization unit. We must remember that the assumed discretization unit, δ, should be equal to the unit return modulus requested by the speculator. The event, ℐ δ , denotes such an Ask price increase which fulfils the condition (2). The complement, ℐ C δ , of this event is Ask price fall fulfilling condition (2). Forecasting changes in the Ask price is limited to answering the question of whether there will be an increase, ℐ δ , or a decrease, ℐ C δ , after the current time, t . The examined CMUR systems require only such elementary forecasts.
The first trend observation begins at the time t 0 = 0. We assume that the observation continuity of it means that at each moment of closing the observation, the next observation is opened. That is why the sequence, (t i ) n i=0 ⊂ [0, T], of observation opening moments is recursively determined in the following way: The sequence (t i ) n i=0 is a record of the observation history. Therefore, the sequence (t i ) n i=0 = Θ is called an observation record.
The binary representation of the trend Q Ask : [0, T] → R + consists of transforming this trend into its binary representation E = (ε i ) n i=1 , determined as follows: The number, n, of binary observations contained in the binary representation E = (ε i ) n i=1 depends on the discretization unit δ and the length T of the observation interval.
Each state, s j ∈ E c , is observed exactly n j times. The sequence n j 2 c j=1 of random numbers is explicitly determined by training dataset Ψ . Thanks to this, for each j = 1, 2, . . . , m, we can establish the probability of achieving the state s j . Moreover, the training dataset Ψ determines the space of all observed states G c (Ψ ) = s j ∈ E c : n j > 0 . (12) In Reference [4] it is justified that the training dataset Ψ uniquely determines conditional probability of achieving assumed rise, ℐ δ , immediately after that the state, s j , has occurred. The sequence n * j m j=1 is explicitly determined as follows: The total probability, p(ℐ δ ), of rise in Ask price can be determined as: The set of triples below: forms the prediction table to foresee the changes of the BEM/QCR exchange rate For any exchange pair BEM/QCR, its prediction table depends only on three parameters: The training dataset Ψ depends on observed ex-ante Ask price trend, Q Ask : [0, T] → R + , on required discretization unit, δ, and on assumed observation range, c. During the calculation of the prediction table, financial analysts and traders do not have influence on the observed ex-ante Ask price trend. Therefore, training dataset Ψ cannot be taken into account as a control parameter of a prediction table.
On the other hand, discretization unit, δ, and observation range, c, are always specified by financial analysts and traders. Therefore, these last two parameters may be considered as control ones.
The confidence interval of a sample statistic (13) is given as the Wald confidence interval [42]. The proposed approximation is reliable when the sample size is large enough, and the success probability is noticeably different from 1 [43].
The value α is the assumed value of a significance level. For each state, s j ∈ G c (Ψ ), the (1 − 2·α) level Wald's confidence interval is given by the equation where z α is the α{\displaystyle 1-{\tfrac {\alpha }{2}}} quantile of a standard normal distribution. In financial practice, the minimal sample size should be determined empirically. Each state, s j ∈ E c , can use a prediction premise. If prediction premise s j ∈ E c fulfils the condition then it is called a well-justified premise. Other prediction premises are called ill-justified ones. In this way, for assumed α level of significance, we determine the space, of all well-justified premises. For any well-justified premise, the probability of inaccurate forecasting Ask price change is not greater than the value α. For ill-justified premises, this probability increases. Therefore, when it is possible, ill-justified premises should be avoided. In practice, FX is the main financial market where the BEM/QCR exchange rate is traded. All quotations on the FX are related to the BEM unit. For any base currency (BCR) except Japanese Yen (JPY), the BEM unit equals to its monetary unit. For JPY, the BEM unit is equal to 100 JPY. For any precious metal, the BEM unit is equal to 1 troy ounce (1 oz). Major precious metals traded in the FX are gold, marked by acronym XAU, and silver, marked by acronym XAG.
On the FX, traders use the lot as a measure unit for the BEM amount. Table 1 contains different lot values determined for various BEMs. In FX, a change in an exchange rate is expressed in pips. One pip is equal to 0.0001 lot of QCR.
Example 2 [4]. We discuss some cases of speculations in exchange pair silver quoted in U.S. dollars (XAG/USD). The selected value, δ = 28 pips, of assumed discretization unit is justified in Reference [28]. We use the space E 4 of all possible FX states.
In the first research stage, we determine the prediction table and distinguish well-justified premises. The Dukascopy broker has collected tick data containing 42,782,438 XAG/USD quotations from 31 December 2012 to 1 January 2018, denoted in the following way: [0, 5Y]. For exchange pair XAG/USD, these tick data determine the Ask price trend, Q Ask : [0, 5Y] → R + . This trend graph is presented in Figure 1.
This trend graph is presented in Figure 1. We see that the trend contains descriptions of bull market, bear market rand, and sideways market. For this reason, we can say that collected tick data are representative.
Using recurrent formula (4) Table 2. For significance level = 0.05 , we determine Wald's confidence intervals (0.05) by using formula (17). Then, we distinguish the space (0.05,28, 4) of all well-justified premises. In Table 2, the ill-justified premises are market by the hash, #. The last row in Table 2 shows the following: a total number of observations − 5 and a total probability (ℐ 28 ) of assumed rise in Ask price. The probability, (ℐ 28 ), is calculated using formula (15).  We see that the trend Q Ask contains descriptions of bull market, bear market rand, and sideways market. For this reason, we can say that collected tick data are representative.
Using recurrent Formula (4), we transform the collected tick data into the observation record Θ = (t i ) 1480 i=0 ⊂ [0, 5Y]. In the next step, with Formula (5), we set binary representation E = {ε i } 1480 i=1 of Ask price trend Q Ask . The binary representation E is applied for determination of the state record Ξ = ( Taking together all the above results, we build training dataset Ψ = ( s(t i ), ε i+1 ) 1479 i=4 , which is used for calculation of the prediction table P(XAG/USD, 28, 4, Ψ ) presented in Table 2. For significance level α = 0.05, we determine Wald's confidence intervals W j (0.05) by using Formula (17). Then, we distinguish the space D(0.05, 28,4) of all well-justified premises. In Table 2, the ill-justified premises are market by the hash, #. The last row in Table 2 shows the following: a total number of observations n − 5 and a total probability p(ℐ 28 ) of assumed rise in Ask price. The probability, p(ℐ 28 ), is calculated using Formula (15).
For premises s 2 , s 3 , s 4 , s 5 , s 6 , s 8 , s 10 , s 11 , s 13 , and s 14 , the probability of inaccurately forecasting Ask price change is less than or equal to α = 0.05. In the next stage of the research, we will examine the profitability of financial decisions made under the impact of well-justified premises. This topic will be discussed in Example 3.

Description of the CMUR System
The CMUR system is designed to support trading on FX. Trading on FX is managed by a broker. The applied variant of the CMUR system is selected by a speculator. Any exchange pair BEM/QCR is traded on FX in the following way.
The current value of BEM is quoted in two prices: The Bid price and the Ask price. Bid reflects how much of QCR will be obtained when we dispose of the BEM unit. Observed evolution of these prices is described by trends Q Ask : [0, T] → R + and Q Bid : [0, T] → R + . Ask price is always greater than Bid price. Therefore, we have The difference, spr : [0, T] → R + , between a current Ask and Bid price is determined by the broker. This difference is called spread.
Two types of transaction may be opened on FX: long position and short position. A long position is opened by BUY order and it is closed by SELL order. A short position is opened by SELL order and it is closed by BUY order. The BUY order is made with the Ask price, Q Ask , and it means acquisition BEM with QCR. The SELL order is made with the Bid price, Q Bid , and it means disposal BEM with QCR. Transactions on FX are concluded between brokers and speculators. At FX, only the speculator can give the broker an order to BUY or SELL. A broker accepting an opening order is obliged to accept the closing order. The amount of the order is defined by the speculator.
Each transaction consists of its opening in time t and its closing in a time t > t . On the FX, the duration of the transaction is short. That is why we assume This condition is almost always satisfied. The value of a spread, spr, depends on the offer of the broker. Therefore, we cannot take spread, spr, into account as a control parameter of the CMUR system. On the other hand, the individual variants of the CMUR system differ in the value δ > spr of the required unit return modulus, which is always specified by the speculator. Therefore, unit return modulus may be considered as a control parameter of the CMUR system. In Reference [4], these last two parameters are used for determining the following ratio: which will be interpreted later below the formula (27). FX brokers set their fees based on commission equal to the spread. A speculator wants to earn due to an accurate prediction of a BEM/QCR quotation change. To achieve this goal, a speculator can apply the CMUR system. A CMUR system is linked to the prediction table P(BEM/QCR, δ, c, Ψ ), where the discretization unit, δ, is equal to the unit return modulus required by the speculator. Since the discretization unit, δ, and the observation range, c, are the only control parameters of the prediction table P(BEM/QCR, δ, c, Ψ ), the unit return modulus, δ, and the observation range length, c, are control parameters of any CMUR system. In Reference [4], it is shown that these last two parameters are the only control ones of the CMUR system.
The effectiveness of CMUR system operation results from the proper selection of transaction premises. Each well-justified premise can be used as a premise for opening transaction on FX. Using the ratio (22), we distinguish the following kind of transaction premises. If well-justified transaction premise s j ∈ D(α, δ, c) fulfils the condition then it is called an acceptable transaction premise [4]. The value π s j will be explained belowthe Formula (27). In this way, we determine the space of all well-justified premises. If we open a transaction after encountering an acceptable premise, then the probability of a loss is relatively low. For non-acceptable premises, this probability increases. We can expect that transactions opened repeatedly under acceptable premises will be profitable. Therefore, non-acceptable transaction premises should be avoided.
Example 3 [4]. Let us consider some ways of speculating on the XAG/USD exchange market. The speculator plans to speculate only using transactions with the unit return modulus δ = 28. These speculations may be supported by using prediction table P(XAG/USD, 28, 4, Ψ ), presented in Table 2. Using (23), for each well-justified premise, we calculate its success probability, presented in Table 3. For the pair XAG/USD, the broker offers the spread spr = 1 pip. Therefore, we have the infimum of acceptable success probability, π p = 0.5179. It, together with condition (23), implies that all well-justified transaction premises are acceptable. We can expect that transactions opened repeatedly under premises s 2 , s 3 , s 4 , s 5 , s 6 , s 8 , s 10 , s 11 , s 13 , and s 14 will be profitable. For these premises, the probability of opening a profitable transaction is greater than or equal to 1 − α = 0.95.
Each trading system is linked to the implemented strategy of transaction-making. The CMUR system is related to a very simple strategy with only the following four transaction-making rules: • Any transaction can be opened only at the moment t , when the acceptable premise, s j ∈ D, has occurred. • If, for observed premise s j , we have then place a BUY order and go long.

•
If, for observed premise s j , we have then place a SELL order and go short.

•
Each opened transaction is closed at the moment t , determined by dependence Listing the applied transaction-making rules ends the CMUR system description. We denote the CMUR system described in this section by symbol C = CMUR(P(BEM/QCR, δ, c, Ψ ), spr, α). Taking into account conditions (25) and (26), we infer that the value π s j determined by Formula (23) is the probability of accurate transaction opening due to an observation of a current premise, s j .
Each accurately opened transaction is profitable for a speculator. Therefore, the probability π s j will be called the conditional success probability. In agreement with conditions (23) or (24), the ratio π p is the infimum of conditional succes probabilities determined for acceptable transaction premise. For any CMUR system, C, we define the success probability as the probability of accurate transaction opening due to use of this system. We get: An expected single payment from transaction is defined as the expected value of payment obtained due to realization of this transaction on one lot of BEM. Then, by the symbol Y s j , we denote the expected single payment from transaction opened immediately after that the acceptable premise, s j ∈ D, has occurred. The expected single payment, Y s j , is equal to value expressed in pips [4].

Effectiveness of the CMUR System
The effectiveness of any trading system means being able to achieve the highest possible profits under conditions of the lowest possible risk. An important element of each trading process in any market is the proper choice of an effective supporting system. For realization of this choice, we can use criteria pointed out by Garcia et al. [44] and Li et al. [45], who point to the trading system features that should be evaluated. Their proposals are implemented for evaluating the CMUR system [4]. In further considerations, without loss of generality, we can ignore the leverage problem. All efficiency characteristics are determined for payment obtained due to realization of a single transaction on one lot of BEM. We assess the CMUR system effectiveness using the following notions.
Let a fixed CMUR system, C = CMUR(P(BEM/QCR, δ, c, Ψ ), spr, α), be given, with the space of all acceptable premises, D = D α, c, π p . The expected annual number of transactions is whereñ j is an annaualized number of the state, s j , observations collected during construction of the prediction table P(BEM/QCR, δ, c, Ψ ).
• The success probability, π(C), is determined by the Formula (28) • The expected unit payment, expressed in QCR units, is • The expected unit profit is • The expected interest rate is where v BEM/QCR is current Ask price of one lot of BEM.
In CMUR system evaluation, we understate the speculator's risk as the possibility of incurring losses as a result of placing an inaccurate order. In Reference [4], the risk index, E(C), is defined as expected Shannon's entropy [46] in the following way: In summary, for the CMUR system, C = CMUR(P(BEM/QCR, δ, c, Ψ ), spr, α), its effectiveness should be characterized by a pair of (i(C), E(C)).
The evaluation of effectiveness of the CMUR system can also be simplified by means of interest risk premium: The characteristics presented above are useful only for comparison of evaluated CMUR systems with other trading systems.
The effectiveness characteristic of considered CMUR system are given in Table 4. Table 4. Juxtaposition of effectiveness characteristics of CMUR(P(XAG/USD, 28, 4, Ψ ), 1, 0.05). Effectiveness of the evaluated CMUR system is represented by the pair (41.68%, 0.9813). The high interest rate of 41.68 tells us that the use of the system CMUR(P(XAG/USD, 28, 4, Ψ ), 1, 0.05) on the gold market guarantees profits well above average. We can use the value 0.9813 of the risk index only for comparison with the system CMUR(P(XAG/USD, 28, 4, Ψ ), 1, 0.05) applied on the gold market with other trading systems applied on any exchange market.

Optimization of the CMUR System
The financial effectiveness increases along with the increase of expected interest and with the decrease of the systemic risk index. Therefore, the subset of all effective CMUR systems may be distinguished as the Pareto's optimum, determined as a two-criteria comparison of maximization of expected unit profit and minimization of risk index.
Let us take into account the single CMUR system. C δ,c = CMUR(P(BEM/QCR, δ, c, Ψ ), spr, α). To simplify further considerations, we can assume that the required unit return modulus, δ, is an integer number. Therefore, we can restrict limit the search area for effective CMUR systems by the condition: where • δ * ∈ N is the least required unit return modulus, and • δ * ∈ N is the greatest required unit return modulus.
Moreover, searching for the most effective CMUR system is always limited by condition where • c * ∈ N is the least assumed observation range, and • c * ∈ N is the greatest assumed observation range.
On the space of all compared CMUR systems, we determine some preorders, C δ,c ·Q x ·C ∂, f , which read: "CMUR system C δ,c is not worse than CMUR system C ∂, f " (40) In this section, we will apply the following preorders: The set of all effective CMUR systems we appoint as Pareto's optimum are determined by multi-criterial comparison Q 1 ∩ Q 2 . We solve this optimization task in two stages.
In this way, we obtain the sequence (P c ) c * c=c * of partial optima of Pareto. In the second stage, we execute the following algorithm: STEP 1: STEP 2: c := c * + 1 (51) STEP 3: ∀ C x,c ∈P c ∀ C y,z ∈P : i y,z < i x,c ∧ E y,z >E x,c ⇒ P := P/ C y,z STOP.
In this way, we obtain the Pareto's optimum, P. Any CMUR system C δ,c ∈ P is an effective one. Then, the pair of control parameters (δ, c) is optimal.

Case Study
In this section, we explore the possibility of effective use of the CMUR system for speculations in exchange pair gold quoted in USD (XAU/USD). We have collected tick data containing 188,055,881 XAU/USD quotations from 31 December 2014 to 1 January 2020 [47]. For exchange pair XAU/USD, these tick data determine the Ask price trend. This trend graph is presented in Figure 2. 3. STOP.
In this way, we obtain the Pareto's optimum, ℙ. Any CMUR system , ∈ ℙ is an effective one. Then, the pair of control parameters ( , ) is optimal.

Case Study
In this section, we explore the possibility of effective use of the CMUR system for speculations in exchange pair gold quoted in USD (XAU/USD). We have collected tick data containing 188,055,881 XAU/USD quotations from 31 December 2014 to 1 January 2020 [47]. For exchange pair XAU/USD, these tick data determine the Ask price trend. This trend graph is presented in Figure 2. We see that the trend Q Ask contains descriptions of bull market, bear market rand, and sideways market. For this reason, we can say that the collected tick data are representative. We see that the trend Q Ask contains descriptions of bull market, bear market rand, and sideways market. For this reason, we can say that the collected tick data are representative.
On 2 January 2020, the average price of 1 gold ounce was $1520. 30. It means that average Ask price of 1 gold lot was v XAU/USD = $152, 030. Trading on the XAU/USD exchange market is managed by many brokers. We assume that the speculator gives orders to a broker who offers a spread of spr = 20 pips. This level of spread is most often offered on the XAU/USD exchange market.
For each pair of control parameters (δ, c), we determine following values and sets: • E δ,c the binary representation containing all binary observations (5), • n δ,c the number of binary observations, • Ψ δ,c the training dataset (10), • a δ,c the average sample size given by the equation: • P XAG/USD, δ, c, Ψ δc) the prediction table (16) A sample size will be applied for heuristic evaluation of obtained solutions of the optimization task.
In the next step, we use the algorithm (43-49) for each observation range, c = 2, 3, 4, 5, separately. Obtained results are presented in Tables 5-8.    It is very easy to see that if we use the optimal CMUR system linked to observation range c = 5, then expected interest rates, i δ,5 , are not realistic. On the other hand, each average sample size, i δ,5 , is always low. Therefore, we can suppose that prediction tables P(XAU/USD, δ, 5, Ψ ) are not reliable. For this reason, we propose to accept the value a = 300 as the minimal average sample size. Of course, our proposal is only heuristic. The above heuristic inference leads to the omission of the optimal CMUR systems, CMUR(P(XAU/USD, δ, 5, Ψ ), 20, 0.05) in subsequent calculations.
In the last step, we use the algorithm (50-56) for all observation ranges, c = 2, 3, 4, together. Obtained results are presented in Table 9. Table 9. Effective variants of the CMUR system, CMUR(P(XAU/USD, δ, c, Ψ ), 20, 0.05). The above table can be used as follows: A speculator chooses one of the recommended values of unit return modulus. This choice implies a recommendation of the proper observation range. An interesting situation exists in the case of a recommendation unit return modulus δ = 463. Then, we have two options of choice:

Discretization
• The observation range c = 3 for speculators with risk aversion.

•
The observation range c = 4 for speculators with risk propensity. This is a simple example of the CMUR system flexibility.

Conclusions
In this paper, we proposed an original method of selecting financially effective CMUR systems. Proper selection is given as Pareto' optimum determined by interest rate maximization and risk index minimization. In our case study, we show a heuristic limitation of optimization task. The results of the discussion point to further research directions.
Results obtained in the case study show that distinguished Pareto's optima are multi-element sets. This fact implies that a most-powerful parameter specification does not exist. This is a common situation in economics and finance. For this reason, in economics and finance, we are finding non-dominated parameter specification. It is a widely accepted approach in operations research. Therefore, such approach is applied in our paper.
Moreover, obtained results show that distinguished Pareto's optima are not convex. It implies that expected interest rate and risk index are not convex functions of CMUR system parameters. It implies that convex analysis cannot be used.
In our paper, we have used risk index (34) related to Shannon' entropy [46]. It would be useful to discuss the use of other suitable risk indices here. We propose to discuss the following ex-ante risk indices: inverse of success probability (28), single payment variance, and single payment semi-variance. In addition, we suggest taking max drawdown into account as ex-post risk indices. A rank correlation between these indices should be investigated. After this research, we will be able to start comparing CMUR systems and other types of trading systems. In the case study, we proposed to accept some values as minimal average sample size. This proposal is only heuristic. This means that there is a real need to build a formal method of determining minimal sample size. Additionally, we propose the following directions of investigation on the CMUR systems: Funding: This research received no external funding.