当前位置:网站首页>Translation of meisai C topic in 2022 + sharing of ideas

Translation of meisai C topic in 2022 + sharing of ideas

2022-06-25 11:40:00 Spsspro free mathematical modeling

MCM——C: Trading strategies ( Thinking behind )

background

Market traders frequently buy and sell volatile assets , The goal is to maximize its total return . There is usually a commission for every transaction . Two such assets are gold and bitcoin .

chart 1: The daily price of gold , Dollars per troy ounce . source : London Bullion Market Association ,2021 year 9 month 11 Japan

chart 2: Bitcoin daily price , US $per bitcoin . source : NASDAQ ,2021 year 9 month 11 Japan

requirement

A trader asked you to develop a model , The model uses only the daily price stream to date to determine the delivery Should I buy... Every day 、 Holding or selling assets in its portfolio

2016 year 9 month 11 Japan , You will come from 1000 The dollar starts . You will use a five-year trading period , from 2016 year 9 month 11 solstice 2021 year 9 month 10 Japan . On every trading day , The trader will have a portfolio of cash , Gold and bitcoin [C, G, B] In US dollars 、 Troy ounce and bitcoin mean . The initial status is [1000, 0, 0]. Every deal ( Buy or sell ) The commission cost of is the transaction amount . hypothesis αgold = 1% and αbitcoin = 2%. There is no cost of holding assets .

Please note that , Bitcoin can be traded every day , But gold is traded only on open market days , Pricing data files reflect LBMA-GOLD.csv and BCHAIN-MKPRU.csv These two points , Your model should consider this trading schedule .

To develop a model , You can only use the data in the two spreadsheets provided :LBMA-GOLD.csv and BCHAIN-MKPRU.csv.( Download it from the official website )

• Develop a model , Only provide the best daily trading strategy based on price data until that day . stay 2021 year 9 month 10 Use your initial 1000 How much is the value of dollar investment model and strategy ?

• Provide evidence that your model provides the best strategy .

• Determine how sensitive the strategy is to transaction costs . How transaction costs affect strategy and outcomes ?

• At most one memo ( Two pages ) Form your strategy 、 Models and results are communicated to traders

Thought analysis

This topic is the establishment of portfolio model , It mainly includes prediction - Plan two processes :

1、 We need to forecast each price series , To judge when assets should be sold for return according to the rise and fall of future prices ;

2、 Establish goal planning , With the weight of gold ( Gold trading amount ) Or bitcoin ( Bitcoin transaction amount ) As an unknown parameter , The objective function gets the largest report in a certain period of holding assets , So we can get the optimal parameters .

We can predict the future trend of ( Buy or sell or keep ) These three trading activities make decisions .

First , Forecast the price of gold and bitcoin , You can choose to use a variety of machine learning regression .

here , For example, using a sliding window -xgboost To make predictions , Before use 5 Days of price data to predict 1 Sky price .( Take the gold price forecast as an example )

Using tools :SPSSPRO( All functions are free 、 Unlimited times and time )

https://www.spsspro.com/?utm_source=CSDN

step 1  Upload data

step 2  Null processing

in fact , That is to say, the 10 Data with missing values .

step 3  Process the data , So that the time series can be transformed into pre 5 Days of price data as an independent variable , after 1 Days of price data as a dependent variable .

step 4  Then run xgboost To predict , Incidentally, genetic algorithm is used to estimate the learning rate 、 Regular term parameters for optimization .

Complex model , Long running time , Please be patient !

result

step 5 After making the forecast , We need to get buy - sell - Maintain this trading strategy , among , Gold only trades on the opening day , This means that on weekends or holidays , The trading status must be holding , The common trading day data of gold and bitcoin can be kept separately for analysis . Suppose gold - Bitcoin is bought and sold together , The main design is a time series data such as a rate of return , such as , We can buy on any day , We can use ( Predict the price of gold one day / The actual price of gold -1) To get a yield , When the increase reaches a certain value , Suggest selling .

Be careful : The initial state is 【1000,0,0】, And every transaction ( To buy or sell ) The transaction cost of is... Of the transaction amount a%, The gold is 1%, Bitcoin is 2%, that , about 1000 dollar , There are two steps to buying and selling , We suggest to keep the actual transaction amount 960 dollar , With 40 US dollars as transaction cost .

Establish a simple goal plan :  \Deltat It is the period from buying to selling

Due to purchase - The sale is ongoing , We need to set up a loop to run .

To achieve a more perfect result , More realistic , Financial risk analysis can be added , similar VaR、CVaR、 Or the use of information entropy , After establishing a perfect investment model , We can use the optimization algorithm to optimize the weight , Such as particle swarm optimization 、 Genetic algorithm (ga) 、 Immune algorithm and so on .

原网站

版权声明
本文为[Spsspro free mathematical modeling]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200536338614.html