The Features of Building a Portfolio of Trading Strategies Using the SAS OPTMODEL Procedure

The article describes the original information technology of the algorithmic trading, designed to solve the problem of forming the optimal portfolio of trade strategies. The methodology of robust optimization, using the Ledoit–Wolf shrinkage method for obtaining stable estimates of the covariance matrix of algorithmic strategies, was used for the formation of a portfolio of trade strategies. The corresponding software was implemented by SAS OPTMODEL Procedure. The paper deals with a portfolio of trade strategies built for highly-profitable, but also highly risky financial tools—cryptocurrencies. Available bitcoin assets were divided into a corresponding proportion for each of the recommended portfolio strategies, and during the selected period (one calendar month) were used for this research. The portfolio of trade strategies is rebuilt at the end of the period (every month) based on the results of trade during the period, in accordance with the conditions of risk minimizing or income maximizing. Trading strategies work in parallel, being in a state of waiting for a relevant trading signal. Strategies can be changed by moving the parameters in accordance with the current state of the financial market, removed if ineffective, and replaced where necessary. The efficiency of using a robust decision-making method in the context of uncertainty regarding cryptocurrency trading was confirmed by the results of real trading for the Bitcoin/Dollar pair. Implementation of the offered information technology in electronic trading systems will allow risk reduction as a result of making incorrect decisions or delays in making decisions in a systemic trading.


Introduction
Prospects for the use of cryptocurrencies as tools of the financial market today are irrefutable [1][2][3][4][5][6][7]. Scientists at the Singapore University [6] focus particular attention to the investment opportunities of cryptocurrencies, studying historical data sets of bitcoin prices and the profitability and riskiness of a diversified portfolio, which also includes cryptocurrency [7][8][9][10]. They believe that the inclusion of cryptocurrencies in the traditional asset portfolio does not significantly increase its profitability, and it is important for the investor to estimate the riskiness (risk factors) and profitability of investing before making investment commitments. Cryptocurrency volatility, to their mind [11,12], is more related to the attitude of the potential investors than to fundamental indexes. Perhaps it is logical that cryptocurrencies with a high attitude of investors [13], as a rule, tend to have an inflated price, so the rational investors will buy cryptocurrency to earn extra income in the future. However, the issue is how long the process of correcting the strategy will be, and how much time should be spent on processing transactions. Therefore, it is also necessary to study the change in the attitudes of the rational investors towards buying and selling, and subsequent investment policy in relation to different cryptocurrencies, to determine how quickly they will be able to correct pricing [14][15][16][17][18][19].
The theory of the Markowitz portfolio [43][44][45] does not lose relevance for the cryptocurrency market. However, significant volatility of the cryptocurrency market during long periods of time limits the usage of Markowitz's theory of forming the optimal portfolio based on the historical data sets of the cryptocurrency rate. As [46] notes, the increase in standard deviation may be connected with the appearance of "bubbles". Therefore, some researchers [46] focus on the detection of cryptocurrency "bubbles", which is of fundamental importance. However, research related to the problem of investment risks hedging, taking into account the current situation in the cryptocurrency market, has become more demanding. The problem of forming an optimal portfolio takes on a new significance [44][45][46][47][48].
Thus, Greek scientists [2] note that cryptocurrencies should be effectively used in the composition of the investment portfolio. Such an approach significantly reduces the risk of investing.
Researchers [10] consider the formation of the investment portfolio exclusively from cryptocurrencies, others [9] suggest using cryptocurrency as a hedging asset. However, active introduction of algorithmic trade in the financial market changes approaches to the use of portfolio theory.
Algorithmic strategies [47][48][49][50] are actively used in the cryptocurrency market, operated, not by portfolios consisting of separate financial tools, but portfolios of trading strategies. Such systems are widely described in the literature. As [43,45] note, the advantage of such an approach is that it avoids the influence of the human factor, in particular, due to the fact that decision-making regarding buying and selling in such systems is based on a certain set of rules. Sets of such rules are mainly based on the basis of technical analysis [25]. Unfortunately, such trading systems have a significant default: the algorithm must generate a significant number of trading strategies to be able to be the first to identify the emergence of new tendencies in the market and to be ahead of other participants. The problem of efficient management of the investment strategies portfolio arises at this stage. Considerably high requirements concerning the possibilities of constant improvement, riskiness, and profitability to the formation of such portfolios designed for cryptocurrency trading are imposed [43][44][45][46][47][48][49][50][51][52][53][54][55][56][57]. Taking into account that high-frequency trading (HFT) [58] trading systems become the most common variant of algorithmic trading in the cryptocurrency market, there are specific risks which should be taken into account when forming portfolios of trading strategies. These are operational risks, risks of a sharp leap of volatility, liquidity outflow, possibilities of pricing manipulation, reduction in market predictability, etc.
Therefore, traditional approaches to the formation of an investment portfolio may not be effective [43,56,57]; in addition, most common traders are not able to compete with powerful trading robots used in algorithmic trading by large market participants. Under such conditions, the development and adaptation to the practical application of the methods for forming and optimizing portfolios of trading strategies and portfolios of financial tools adapted to the conditions of the modern market is an urgent issue.
The novelty of this research is to optimize the methods for modeling a portfolio of trading strategies based on income and risk indicators in the conditions of the limited investment resources. The advantages of the offered method are the building of a robust portfolio of trading strategies, which works effectively in the cryptocurrency market, and developed software can be used both separately and in the structure of the trading system. The offered method allows ensuring flexibility in the formation of a portfolio of trading strategies, in particular, the variants of building a portfolio are considered: profitability maximization at a fixed risk value and risk minimization at a fixed profitability value. It should be noted that such an approach provides the best decision in terms of ensuring the profitability of a strategies portfolio. In addition, according to the offered approach, it is assumed that input data may have gaps, discharges, errors, etc.
Therefore, the study of the necessity for preliminary data processing was performed, and the method of gaps processing was proposed. SAS Institute software, including the OPTMODEL [51] procedure, allows us to solve the tasks of linear and nonlinear programming, to build models and produce a suitable algorithm, and to perform multithreading and parallel calculations that creates prerequisites for further improvement of the developed software to implement the algorithm for building a robust portfolio of strategies being used. Approbation of the developed method in trading systems intended for cryptocurrency trading showed acceptable profitability and risk results-the profitability of the portfolio of trading strategies for the BTC-USD pair was provided to 5.3% per month.
Information technology which implements the concept of the formation of a portfolio of algorithmic strategies in the cryptocurrency market characterizing by the use of robust optimization and use of the Ledoit-Wolf shrinkage method for obtaining stable estimates of the covariance matrix of algorithmic strategies is presented in this paper. Implementation of the offered information technology in electronic trading systems will reduce the risks of losses from making incorrect decisions or/and investment decisions making out-of-time in the cryptocurrency market. SAS Institute software, including OPTMODEL procedure, to implement the algorithm for building a portfolio of strategies was used.

Materials and Methods
A thorough literature review devoted to the problems of constructing cryptocurrency portfolios, developing the trade strategies for cryptocurrency trading, and forming the portfolio strategies for algorithmic trading, is given in [54,55]. This is why this study considers only some special features of modern instruments' applications in automatizing the portfolio strategies constructing directed to cryptocurrency trading in the algorithmic trading systems.
In spite of the fact that there exists an active discussion regarding the possibility of application the Markowitz portfolio in the cryptocurrency market, it should be agreed that it can be used, though with adaptation to this specific segment of the financial market. As it is noted in [59], taking into consideration the fact that the cryptocurrency market is nonstationary and unbalanced, with preserving its general structure, the problem of portfolio optimization takes another sense due to the fact that its parameters acquire new meaning.
That is, the optimization problem statement is performed using the information concept. With such approach, an investor who is constructing the portfolio (regarding trading strategies or separate financial instruments) at the cryptocurrency market solves the following optimization problem [59]: whereR T t -is effectiveness forecast with known information y(t), V e -is covariance matrix, x-is expected vector of capital distribution between the portfolio components, y(t)-is a set of information, for the moment t, I-is a unity column-matrix, and t ≤ T-denotes the time restrictions.
Thus, in conditions of nonstationary and unbalanced markets, the information about supply and demand for the market players should be taken into consideration, as far as each of them possesses definite information regarding the factors that would influence the decisions regarding buying or selling the cryptocurrency.
Agreeing with [52,59] it should be noted that the optimization problem statement formally completely corresponds to the classic statement, but acquires new content. In contrast to the classic approach, instead of fixed values of mathematical expectation the forecast is considered to depend on the coming information that replaces the effectiveness of the covariance matrix-covariance matrix of forecasting errors. This approach corresponds better to the speculative game at the cryptocurrency market. The comparative characteristic of the portfolio optimization technologies is given in [52].
Thus, it is possible to state that the problem can be also solved as the problem of "naïve" diversification of the trading strategies when the capital is distributed uniformly between all the strategies, as well as in the Markowitz problem when the strategies portfolio structure is formed with the condition of risk minimization for a given level of expected return. The problem of forming the portfolio is considered for a one time period only, and for each of the following periods the problem is solved anew, and the portfolio is reconstructed. The income of the Markowitz optimal portfolio is sensitive to the return estimate errors, especially to the errors that exhibit "heavy tail" distributions and errors in data. That is why an important problem to be solved when constructing the portfolio is providing high quality input data, their appropriate preliminary processing.
The study proposes the use of a robust optimal portfolio. An advantage of the approach is that even in the "worst" case of portfolio return realization and its covariance matrix, the portfolio still satisfies the investor restrictions. That is, the robust portfolio provides for maximum return when risk is restricted, and it is less sensitive to input data and influence of the random factors. Thus, the acceptable robust portfolio is formed first. There can be several such portfolios, and at the next stage the best one is selected from them exhibiting the best value of the goal function. It means that at the definite moment it will be necessary to form the trading strategies portfolio that will be effective within the time interval [t, ts]. This is the interval of time between trading signals generated by the technical analysis means at the financial market. To optimize the portfolio trading strategy choice, the following approaches can be used.
The first approach to optimizing portfolio selection is to maximize profitability at a fixed risk value. The main goal is to increase profitability. The measure of risk is understood and used as a measure of dispersion and covariance of profitability of trading strategies on the Bitfinex [60] exchange, at which the maximum profit is achieved.
The function of profit maximization, in this formulation of the problem, has the form of (2): where x j -is a proportion of asset j, r j -is the expected profitability of the asset j, and n-is the number of types of financial assets in the portfolio. Limitation: 1.
Fixed amount of risk-admissible losses of the strategies portfolio: where Risk-is a fixed value of risk, x j -is a proportion of asset j, x i -is a proportion of asset j, σ ij -is a value of covariance between assets i and j, and n is the number of types of financial assets in the portfolio.

2.
The sum of all proportions of investments in strategies does not exceed one (i.e., 100%).
where x j -is a proportion of asset j, r j -is the expected profitability of the asset j, and n-is the number of types of financial assets in the portfolio.

3.
The proportion of investments in each portfolio strategy cannot be negative: In this case, the problem to be solved belongs to the class of nonlinear programming problems as the constraint function is a polynomial of the second degree.
The second approach to optimizing portfolio selection is to minimize risk at a fixed rate of profitability. The main goal is to minimize the risk, and at the same time to achieve the preliminarily expected profit R.
The function of risk minimization, in this problem statement, has the form of: where x j -is a proportion of asset j, r j -is the expected profitability of the asset j, σ ij -is a value of covariance between assets i and j, and n-is the number of types of financial assets in the portfolio. Limitation: 1. Fixed amount of profitability by the strategies portfolio must be not less than the profit R.
where R-is a fixed value of portfolio profitability, x j -is a proportion of asset j, r j -is the expected profitability of the asset j, and n-is the number of types of financial assets in the portfolio.

2.
The sum of all proportions of investments in strategies does not exceed one (i.e., 100%).
where x j -is a proportion of asset j and n is the number of types of financial assets in the portfolio. 3.
The proportion of investments in each portfolio strategy cannot be negative: In this case, the problem to be solved belongs to the class of quadratic programming problems as the target function is a polynomial of the second degree.
The strategies of algorithmic trade are functioning under control of the alpha-factors that process trading signals, forecast future cost of stocks, estimate possible return (risk of return), and generate "input-output" signals that result in deploying orders for buying or selling. At the same time, the diversity of a trading strategies portfolio can be rather high, up to several thousand. In such a portfolio, the return risks for separate strategies are interacting with one another so as to provide an appropriate profile of risk (return) for the whole portfolio of trading strategies. In turn, some strategies can be used by several trading algorithms, including their recursive constructions.
It should be noted that systemic trade at the cryptomarket requires and actively uses new automatized trading systems. Additionally, such innovation process is taking place practically without interruption. The primary reason for this is the rather fast adaptation of the market to the new trading strategies. The information effectiveness of the market is substantially decreasing, and it loses its capability to generate income. That is why an urgent problem is to create the methodologies providing possibilities for adaptation of the trading strategies and accept new rules.
To solve the problem of creating new trading strategy portfolios for cryptocurrencies, this study proposes the implementation of the robust portfolio using the procedure of SAS OPTMODEL. The OPTMODEL procedure supports the language of optimization modeling which contains special syntax; the language constructions allow for representing the problems clearly and effectively. This approach simplifies initial model constructing, and their subsequent modification and use with changing data. This is an especially important feature for solving the problem stated in this study, as it is proposes disseminating the methods of models constructing to solve similar problems, including alternative scenarios. The advantages of the OPTMODEL procedure that, in its turn, provide for advantages of portfolio constructing are as follows [49,51]: When solving the problem of constructing the portfolio of strategies for algorithmic trade with cryptocurrency, the following possibilities of the OPTMODEL language were used: constructing forecasting models for cryptocurrency price, and call of appropriate trading algorithm while reformatting the strategy portfolio. It is supposed that, during trading sessions, several alternative trading algorithms that are available in the portfolio are functioning, and are responsible for the implementation of different trading strategies, the number of which can reach several thousand.
Thanks to implementing the shrinkage estimator of Ledoit and Wolf [61,62] into the OPTMODEL procedure, the robust portfolio was created for a substantial number of algorithmic trading strategies.
Aside from the other potential possibilities of the OPTMODEL procedure, the "Multistart" is significant. It provides multiple solutions of nonlinear optimization problems, using various initial conditions, to find the global extreme, which is used for the operative re-forming of the portfolio strategies, to select the best one for a current situation and to follow the market signals that are generated by the technical analysis indicators. The development supposes the forecasting of currency prices that are contained in the portfolio using a multi-model approach, as well as the methods of structural and parametric adaptation presented in the studies [52][53][54][55][56][57][58]63].
The development presented is also distinguished with the possibility of forming the portfolio of trading strategies by making use of the Multistart model. PROC OPTMODEL has a Multistart model that is designed to solve nonlinear programming problems with multiple local maxima or minima.
In addition, the proposed approach to forming the trading strategy portfolio for cryptocurrency implements the following advantages of the PROC OPTMODEL: Software implementation of the offered method was performed in the environment of SAS Enterprise Guide 7.1 using the SAS Base programming language and a specialized language of optimization modeling of OPTMODEL, designed to build models and use appropriate algorithms for solving optimization problems.

Results and Discussion
The task of forming a portfolio of cryptocurrency trading strategies can be formulated as follows: to make a decision regarding the implementation of a particular trading strategy, which is part of a portfolio, at a moment of time determined on the basis of analysis of trading signals, estimating the profitability of various strategies, and forecasting cryptocurrency behavior.
Taking into account the complexity of this task, its solution involves the implementation of several steps. Accordingly, the software implementation provides a multi-module architecture of application.
The first step is to forecast the cryptocurrency behavior. At this stage, a system of data collection from exchanges (mainly Bitfinex, Bitstamp, Huobi, Binance, and others) based on the API interface is used. Databases implemented on different platforms, such as MySQL, PostgreSQL, and others, are used to store the collected structured data. Data obtained from exchanges require pre-processing, in particular detection of anomalous values or gaps, etc. Preliminary analysis and processing of such data is performed in a dialog mode, as is required. Filling in the missing values is one of the problematic issues to be solved at this stage. Missing values are obligatorily present in the data series obtained from the exchange. This is due to the specifics of the computer systems. Observations show that many of the situations where in a considerable part of the data has a gap occur when the intensity of trading on the stock exchange is very high. In such cases, the reason for the information loss is that the main focus during the operation of the exchange is focused on servicing applications for buying and selling, rather than storing information about the issued orders. There are also failures in the accumulation of information on the part of the trader, which is especially true for companies that create their own databases for storing information from different exchanges by their own efforts. Another reason for data gaps may be system failures caused by various attacks on elements of the exchange, including cyberattacks. The problem of changing the API should be mentioned separately, about which users usually find out only after it happens, i.e., after some time, when it becomes known that the information about orders and transactions has not been received.
All factors mentioned had different effects on the number and frequency of gap formation in the time series of exchange data on bitcoin trading [64]. In the case of cryptocurrencies, the gap was the percentage of minutes for which there was no information within the corresponding hourly, or daily, session, or sometimes the interval of another specified duration.
In this research, missing data was analyzed for various time intervals and for various percentages of their availability in the time series for bitcoin prices.
The study of the efficiency of the developed system was performed using a set of data on transactions concerning buying and selling of cryptocurrency consisting of 957,510 lines, each of which contained aggregated information for every 15 s of the exchange work for the period from 24 June 2018 to 18 December 2018.
Aggregated information contained such elements as a timestamp in the format of day-month-year-hour-minute-second (DateTime), a planned offer price of one bitcoin (Bid), the total turnover on the exchange for 15 s (Aggregated_tick_volume), and the number of transactions on the exchange for every 15 s of its work (Trades_count).
The mentioned data sets are updated, if possible, every 15 s automatically, as the exchange receives transaction data on transactions (if there are no technical problems in the information sharing with the exchange). A 15 s time frame is defined as optimal for the study as: • information sharing between the trading robot and the exchange takes place with a certain delay, the duration of which is determined by many technical parameters of the computer network, but not exceeding 15 s; the time that, as shown by our experiments in 2015-2018, experiments are sufficient to process agreements on the buying and selling of cryptocurrency; • storing of aggregate indicators, in contrast to transactional agreements, allows us to speed up the performing of necessary calculations, which in turn saves computing resources, as well as the time required for decision making.
The data set, built on 15 s time intervals, can be aggregated to the analytical table of any other time frame, for example, 5, 10, 15, or 30 min, or 1, 4, 6, or 8 h, etc. Taking into account the results of numerical experiments on models developing and testing the work of trading strategy conducted at 15, 30, and 60 min time intervals, the results obtained using a data set based on aggregated to a 4 h frame of 15 s aggregate sets of exchange data were revealed optimal. Another advantage of using data aggregated on a 4 h frame in the forecasting modeling was the ability to track the work of a trading robot, not every minute, but once every few hours.
The formation of gaps was studied at different time intervals and for different percentages of their presence in the time series of the bitcoin price.
A numerical experiment to substantiate the method of filling in the gaps was conducted; its essence is as follows. For example, there were 30 unfilled minute values out of 60, corresponding to 50% of time frame gaps for the hour interval from 15:00 to 16:00 on 1 July 2018, and there were 144 unfilled minute frames out of 1440, corresponding to 10% of the gaps of the daily frame on the same time interval on 15 July 2018. The results of the study of the periodicity of the data gaps formation are presented in Table 1. The values indicated in the table show the percentage of time intervals of the corresponding time frame, during which incomplete data were obtained (Table 1). As can be seen from Table 1, 7.23% of time intervals contained from 80 to 100% of gaps on the hour frame, and 4.99% of time intervals contained from 50 to 80% of gaps. However, the percentage of gaps was 5.74% and 4.92%, respectively, at daily intervals.
Despite the fact that the problem of filling in the gaps is one of the most studied, and there are many methods of filling in the gaps in time series of indicators, of different natures, with different number of gaps, etc., each method is focused on solving a certain group of problems and has its own specific application.
In particular, gaps in the tasks of forecasting the price or trading volume of financial tools can be filled with data on the price of the same asset in the same period of time obtained from another exchange. Another fairly common method is to fill in the gaps with averages calculated as the arithmetic mean of the known previous and next missing values. Such methods should be used with a small number of missing values, when there are no serial data gaps in the time series. If there are series of gaps, the method of filling them by forecasting the missing values using mathematical modeling is used. After conducting a series of experiments using a large number of different methods, we concluded that it is best to use exponential smoothing methods to fill in the gaps in the time series of data concerning cryptocurrency trading. Table 2 presents comparison of the forecasting results of the trading volumes of the currency pair of BTC-USD after applying different methods of exponential smoothing for filling in the gaps in the time series. The value of root-mean-square deviation (RMSE) on hourly and daily frames as a criterion for comparing the results of forecasting modeling was used. According to Table 2, the best result was obtained by applying exponential smoothing with a dump trend for filling in the gaps in the time series of these models.
Taking into account the obtained results, the following approach for the forecasting of the volumes of the cryptocurrency trading within the relevant time interval, on the basis of time series containing data gaps, is offered: (1) to calculate the number of minutes for the period of time in which there is data on the forecasting financial tool by the formula of (10): where I(t) = 1, if the value of the series is filled for the corresponding t-minute frame, otherwise I(t) = 0.
(2) to calculate the total value of the studied indicator for the hourly time frame based on the available minute frames (11): Volume 60 = ∑ 60 t=1 Volume (t) (11) where Volume (t) is a value of the indicator of the minute frame t.
(3) to calculate the adjusted value of the studied indicator for the corresponding time frame (12): A similar approach was used for other time frames, only the basis for calculations was used not equal to 60, but to the actual value. For example, it was 240 for four-hour frames.
Numerical experiments according to the method offered in this study were performed for a long time-in the period from 1 January 2015 to 31 December 2018. The method was adjusted at each stage of the study, so the examples showed only the final results obtained in 2018.
The analytical table for the construction of mathematical models included the following indicators (13): where Price (t − k) is the value of Price in the previous k, i.e., moment of time.
In general terms, the formula for predicting the price of bitcoin four hours ahead can be represented as a regression Equation (14): where a 0 -is the intercept parameter, which corresponds to the value of the response variable when the all predictors is 0; a k -is the slope parameter, which corresponds to the magnitude of change in the response variable given a one unit change in the predictor variable Price(t − k); b m -is the slope parameter, which corresponds to the magnitude of change in the response variable given a one unit change in the predictor variable Amount k ; c m -is the slope parameter, which corresponds to the magnitude of change in the response variable given a one unit change in the predictor variable Volume k , k = 1, . . . , 12; Amount kis the total turnover on the stock exchange for the previous k hours, where k = 16, 32, 48, 64, 72, 80, and 96 USD; Volume k -is the total turnover on the stock exchange for the previous k hours, where k = 16, 32, 48, 64, 72, 80, and 96 bitcoins; and m = {16, 32, 48, 64, 72, 80, 96}.
The following method to forecast the bitcoin rate was offered by the following steps: Step 1. The size of the training sample (training_window_size), which would be used to build the model, was determined by an automatic search from the minimum, 32 points, to a value of 480 points.
Step 2. The size of the window (sample_size) was specified; it would be used to check the quality of the forecast model. The values of 320 points were used in this study; Step 3. The forecast on 320 points forward was built for the volume of the training sample (training_window_size) equal to 32 points. Then, the training sample from the elements of Price (t = 1), . . . , Price (t = 32) was formed; after this, the estimates of the model coefficients were calculated and the forecast on one point forward Price_forecast (t = 33) was built. Then, a training sample from the elements of Price (t = 2), . . . , Price (t = 33) was created, the estimates of the model coefficients were calculated, and the forecast for the next point forward Price_forecast (t = 34) was built, etc. The process of forming a training sample was performed 320 times, until a forecast of 320 points forward Price (t = 352), on the basis of a training sample of the elements of Price (t = 320), . . . , Price (t = 351) was obtained.
Step 4. The following was calculated to estimate the quality of each built model: Root mean square error (RMSE) calculating by the formula of (15) [65]: where price_forecast (t = n) is the forecast values of the model; price (t = n) is the actual value; and n is the number of observations. Additionally, the Misclassification Rate is the percentage of cases of incorrect forecasting of changes in price direction for estimating the quality of the built models was calculated.
Step 5. The value of training_window_size was increased by one; Step 3 and Step 4 were repeated until the entire training sample was processed (determined by automatic search from the minimum, 32 points, to a value of 480 points).
Step 6. The best model, which would be used for the forecasting based on the comparison of the calculated indicators of estimation of the models quality, was chosen.
It should be noted that the best forecasts were obtained using different regression models, mainly those taking into account seasonality.
Technical analysis [25] with its figures, oscillators, and indicators also allowed usto analyze and forecast general tendencies in the bitcoin market. Indicators such as MACD (Moving Average Convergence Divergence), RSI (Relative Strength Index), SMA (Simple Moving Averages), and others were often used.
The results of 37 trade agreements, 12 of which were aimed at increasing and 25 at decreasing of the exchange rate in a numerical experiment using the Order Indicator, which acquired the values of (1) trend up, flat (0), and (−1) trend down. The total profitability of cryptocurrency trading was USD 3460, while the average profitability of one transaction was USD 93.
However, trend definition does not solve the problem of confirming or rejecting the hypothesis concerning the choice of trading strategy. In the process of strategy building, there may be situations where there are discrepancies between the trend and the forecasting values. For example, the direction of the upward trend could be determined correctly, but the forecasting rate is higher than the real one. In this case, the trader may lose money if he does not place stop orders below. In the case when the direction of the trend-upward is determined correctly, but the forecasting rate is lower than the real one, the trader will not lose money if he places a stop order at the forecast level, but he also does not receive the expected income. The situation is similar for cases when the direction of the trend is downwards, and the forecasting rate is higher or lower than the real one.
The percentage of erroneous classification for the forecasted trend direction was chosen as the criterion of strategy selection (16): where SS3 MISC is the number of cases of correctly forecasted upward trend; SS3_TP is the upward trend, correctly forecasted; SS3_FN is a forecasted downward trend which turned out to be the upward one; SS3_FP is a forecasted upward trend which turned out to be a downward one; SS3_TN is the downward trend, correctly forecasted; and SS3_MISC is the percentage of erroneous classification, i.e., the percentage of incorrectly forecasted direction of a trend. The formation of a portfolio of strategies was implemented in four stages. Stage 1. It should be calculated on the basis of available statistical historical data on the implementation of selected strategies during the month, including: • the vector of profitability of each of the strategies during the month; • covariance matrix of profitability change of all strategies.
Stage 2. Strategies with a positive profitability for further analysis should be chosen. Stage 3. An appropriate investment policy, applying linear constraints of the form, ensuring the sum of the proportions of strategies does not exceed 100% and that each proportion of the strategies should be greater than zero using optimization methods based on the vector of profitability of strategies and covariance matrix, should be formed.
Stage 4. After the formation of investment policy, the available assets are distributed in a certain proportion for each of the recommended strategies, and are used for a month for exchange transactions. At the end of the month, all operations of stages 1-3 are repeated, and recommendations are formed on the optimal investment policy for the next month. The efficiency of the proposed method was tested experimentally.
The covariance matrix, the profitability vector, and the constraints on the expected risk were used in the capacity of the input parameters.
There is an example of the code in OPTMODEL for finding the optimal portfolio of strategies (Algorithm 1).
The represented macro program could work in two regimes: (1) select a portfolio that maximizes expected return while not exceeding a specified risk, or (2) minimizes risk (measured by variance) and achieves a target expected return.
The efficiency of the offered method was tested by an experimental method. The task of developing a method for forming a portfolio of investment strategies for cryptocurrency trading, taking into account its riskiness, and the profitability of individual strategies of which it should consist, was examined. This method was used during the trading of cryptocurrency bitcoin in a pair with US dollars (BTC-USD) on the Bitfinex exchange in the period from 1 July 2018 to 1 April 2019, using 12 strategies which differed by indicators used, their combinations, indexes, and signals from exchanges (Table 3).
setAmount_Prop_&&&CURRENCY_PAIR_&i_pair. (Rename = (Name = strategy_id)); currency_pair = "&&&CURRENCY_PAIR_&i_pair."; run; procprintdata = Amount_Prop_&&&CURRENCY_PAIR_&i_pair.; run; %MEND OPT_MODEL;  Table 4 shows the portfolios which were obtained on the basis of the offered method for each of the studied months. The use of the offered method allowed getting almost 43 cents of profit per 1 dollar invested in bitcoin after eight months (Table 5). Table 6 presents the statistical characteristics of the price of bitcoin for the period from July 2018 to April 2019.
Following this strategy, the profitability of "buying and selling" agreements was USD 4900. The net profit after deducting the commission of the exchange for transactions was taken into account when calculating the profitability. In total, during the experiment, 139 trading operations were performed, 57 of which focused on increasing the rate of bitcoin, and 82 on its decreasing; the average profitability of each transaction was USD 35.
Additionally, the application of a universal method for the formation of investment strategy for the management of the cryptocurrency portfolio allowed us to ensure the portfolio profitability up to 43% during the eight months. Thus, the study showed that the offered methods of building the robust portfolio of the trading strategies was universal, flexible and adaptive. The usage of a method of the building the robust portfolio, the multi-model approach in the prognostic modelling of the prices of cryptocurrency, and the preliminary preparation of data allowed us to obtain much better results of profit in the algorithmic trading system. The use of powerful tools such as SAS Enterprise Guide 7.1 make it possible to implement the offered approaches.

Conclusions
This is primarily due to the fact that the cryptocurrency market is characterized by a significant volatility, the presence of uncertainties of various types, nonlinearity, and unsteadiness; however, it attracts investors with the opportunity to receive great incomes. Therefore, the goal of developing a scientifically sound method of forming an effective trading strategy or/and portfolio of the strategies, and its automation, is particularly relevant and has practical significance. Various methods and sets of tools are used to forecast the cryptocurrency rate and to gain income from cryptocurrency trading.
Thus, the performed research showed that the offered method of forming a portfolio of strategies for cryptocurrency trading provided income, even in conditions of risk and uncertainty, and was universal, flexible, and adaptive. The use of a multi-model approach, including for the preliminary preparation of data, allowed us to receive forecasting results better than in many automated trading systems.
The novelty of this research is to optimize the methods for modeling a portfolio of trading strategies based on income and risk indicators in the conditions of the limited investment resources. The advantages of the offered method are the building of a robust portfolio of trading strategies, which works effectively in the cryptocurrency market, and developed software can be used both separately and in the structure of the trading system.
The methodology of robust optimization using the Ledoit-Wolf shrinkage method for obtaining stable estimates of the covariance matrix of algorithmic strategies was used for the formation of a portfolio of trade strategies. The corresponding software was implemented by SAS OPTMODEL Procedure. Additionally, the use of powerful instruments of SAS Enterprise Guide 7.1 allowed us to implement the different methods of prognostic modeling and intellectual analysis.
The offered information technology, models, and methods could be useful in a decision making support system designed for use by different groups of potential investors in cryptocurrency. Such a software application will provide use on mobile platforms. In addition, it is expected that the application will be aimed, not only at professional participants of the financial market, but also at investors who do not have the appropriate training and skills in decision making in the conditions of a rapid change in situation in the financial market, when making considered reasonable decisions using only the tools of technical analysis and information from the Internet and the media is virtually impossible.
Therefore, developing the proposed system, that would be flexible and universal and could be used to solve the problems of forecasting the price of various financial tools, not just cryptocurrencies, remains as very important goal. In the future, the offered information technology can be supplemented by the use of the tools of data mining, text analytics, and elements of expert systems.