当前位置:网站首页>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 .
边栏推荐
- MySQL and Oracle processing CLOB and blob fields
- 时创能源冲刺科创板:拟募资11亿 年营收7亿净利反降36%
- 西山科技冲刺科创板:拟募资6.6亿 郭毅军夫妇有60%表决权
- SQL injection vulnerability (type chapter)
- 翌圣生物冲刺科创板:25%收入来自新冠产品销售 拟募资11亿
- wait()、notify()和notifyAll()、sleep()、Condition、await()、signal()
- 一个数学难题,难倒两位数学家
- Customize to prevent repeated submission of annotations (using redis)
- Spark tuning tool -- detailed explanation of sparklens
- Openfeign uses
猜你喜欢

JVM 原理简介

SQL注入漏洞(类型篇)

SystemVerilog (XIII) - enumerate data types

Apache ShenYu 入門

What is the development history, specific uses and structure of the chip

推荐一款M1电脑可用的虚拟机软件

Why distributed IDS? What are the distributed ID generation schemes?

基于SSH的高校实验室物品管理信息系统的设计与实现 论文文档+项目源码及数据库文件

龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书

TCP如何处理三次握手和四次挥手期间的异常
随机推荐
[维护集群案例集] GaussDB 查询用户空间使用情况
GaussDB others内存比较高的场景
Nacos installation and use
ARM64汇编的函数有那些需要注意?
一个数学难题,难倒两位数学家
SQL注入漏洞(繞過篇)
Getting started with Apache Shenyu
CFCA Anxin sign access
SQL注入漏洞(类型篇)
杭州/北京内推 | 阿里达摩院招聘视觉生成方向学术实习生(人才计划)
Capacity expansion mechanism of Dict Of redis (rehash)
Geographic location system based on openstreetmap+postgis paper documents + reference papers + project source code and database files
Manually rollback abnormal data
Is industrial securities a state-owned enterprise? Is it safe to open an account in industrial securities?
MySQL and Oracle processing CLOB and blob fields
Bayes
Arrays. asList()
Spark tuning tool -- detailed explanation of sparklens
Wait (), notify (), notifyAll (), sleep (), condition, await (), signal()
Golden sun education listed in the U.S.: a small cap medium cap stock with a market value of USD 360million