当前位置:网站首页>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 : t 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 .
边栏推荐
- Crawler scheduling framework of scratch+scratch+grammar
- CMU提出NLP新范式—重构预训练,高考英语交出134高分
- Detailed explanation of spark specification
- c盘使用100%清理方法
- Vulnérabilité à l'injection SQL (contournement)
- Multiple clicks of the button result in results
- Idea uses the fast request interface for debugging
- Use of Presto visualization client-yanagishima20.0
- Dynamic programming to solve stock problems (Part 1)
- 基于Minifilter框架的双缓冲透明加解密驱动 课程论文+项目源码
猜你喜欢
Nacos installation and use
An interesting logic SRC mining
Countdownlatch source code analysis
SQL注入漏洞(类型篇)
推荐一款M1电脑可用的虚拟机软件
Database Series: MySQL index optimization summary (comprehensive version)
4 life distributions
C disk uses 100% cleaning method
Leetcode 1249. Remove invalid brackets (awesome, finally made)
杭州/北京内推 | 阿里达摩院招聘视觉生成方向学术实习生(人才计划)
随机推荐
Golden sun education listed in the U.S.: a small cap medium cap stock with a market value of USD 360million
【上云精品】节能提效!加速纺织业“智造”转型
Introduction to socket UDP and TCP
Why distributed IDS? What are the distributed ID generation schemes?
CMU puts forward a new NLP paradigm - reconstructing pre training, and achieving 134 high scores in college entrance examination English
龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书
Wait (), notify (), notifyAll (), sleep (), condition, await (), signal()
Dragon Book tiger Book whale Book gnawing? Try the monkey book with Douban score of 9.5
Jincang database kingbasees plug-in force_ view
杭州/北京内推 | 阿里达摩院招聘视觉生成方向学术实习生(人才计划)
Detection and analysis of simulator in an app
Multiple clicks of the button result in results
Redis6笔记02 配置文件,发布和订阅,新数据类型,Jedis操作
SQL注入漏洞(绕过篇)
Manually rollback abnormal data
如何实现移动端富文本编辑器功能
RPC typical framework
ThingsPanel 发布物联网手机客户端(多图)
Comment TCP gère - t - il les exceptions lors de trois poignées de main et de quatre vagues?
PHP如何提取字符串中的图片地址