Skip to content

Commit

Permalink
Deriv.com - 筛选日内高频量化交易统计模型 校阅(第IV部)
Browse files Browse the repository at this point in the history
Deriv.com - 筛选日内高频量化交易统计模型 校阅(第IV部)

🚩🦔量化对冲,中科红旗;一带一路,一统天下:频率=1

**大秦赋 (Chinese Emperor)**<br>
春秋战国《*礼记•经解*》<br>
孔子曰:『君子慎始,差若毫厘,缪以千里。』

> <span style='color:#FFEBCD; background-color:#D2B48C;'>**《礼记·经解》孔子曰:**</span><span style='color:#A9A9A9'; background-color:#696969;'>*「君子慎始。差若毫厘,谬以千里。」*</span>[^1]

*引用:[「快懂百科」《礼记•经解》](https://www.baike.com/wikiid/2225522569881832051?view_id=2tt3iw3blkq000)和[第一范文网:差之毫厘,谬以千里的故事](https://www.diyifanwen.com/chengyu/liuziyishangchengyugushi/2010051523105152347092749890.htm)和[「百度百科」春秋时期孔子作品《礼记•经解》](https://baike.baidu.com/item/%E7%A4%BC%E8%AE%B0%C2%B7%E7%BB%8F%E8%A7%A3/2523092)和[「當代中國」差之毫釐 謬以千里](https://www.ourchinastory.com/zh/2962/%E5%B7%AE%E4%B9%8B%E6%AF%AB%E9%87%90%20%E8%AC%AC%E4%BB%A5%E5%8D%83%E9%87%8C)*

[^1]: [HTML Color Codes](https://html-color.codes)
  • Loading branch information
englianhu committed Jan 1, 2023
1 parent eca2fae commit 7c7c676
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
6 changes: 5 additions & 1 deletion binary-Q1Inter-HFT-RV4.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,11 @@ source('函数/日内高频季节性自回归.R')
as.data.table
.季节性规律参数 <- setnames(.季节性规律参数, old = c('V1', 'V2', 'V3'),
new = c('季节性自回归阶数', '季节性差分阶数',
'季节性滑均阶数'))[季节性差分阶数 <= 2]
'季节性滑均阶数'))[季节性差分阶数 <= 2] %>%
mutate_dt(总和 = rowSums(.)) %>%
filter_dt(总和 > 0) %>%
select_dt(-总和)
# 循环周期 <- 数据量/频率
# seasonal <- list(order = .季节性规律参数, period = 循环周期)
```
Expand Down
2 changes: 1 addition & 1 deletion 函数/日内高频季节性自回归.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#趋势 = NULL, 包含常数与否,
包含截距与否 = 包含截距与否, 统计模型 = 统计模型,
#博克斯考克斯变换 = 统计模型$lambda, x = y, 偏差调整与否 = FALSE,
计策谋略 = 计策谋略, 列印 = '') {
计策谋略 = c('CSS-ML', 'ML', 'CSS'), 列印 = '') {

options(digits = 22)
require('tidyft', quietly = TRUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ source('函数/日内高频季节性自回归.R')
.季节性规律参数 <- permutations(6, 3, 0:5, repeats.allowed = TRUE) %>%
as.data.table
.季节性规律参数 <- setnames(.季节性规律参数, old = c('V1', 'V2', 'V3'),
new = c('季节性自回归阶数', '季节性差分阶数', '季节性滑均阶数'))[季节性差分阶数 <= 2]
new = c('季节性自回归阶数', '季节性差分阶数', '季节性滑均阶数'))[季节性差分阶数 <= 2] %>%
mutate_dt(总和 = rowSums(.)) %>%
filter_dt(总和 > 0) %>%
select_dt(-总和)

频率 = 1

Expand Down Expand Up @@ -379,7 +382,7 @@ source('函数/日内高频季节性自回归.R')
包含截距与否 = ''
迭数1 <- 迭代基准[1]
省略 = NULL
计策谋略 = NULL
计策谋略 = c('CSS-ML', 'ML', 'CSS')
趋势 = NULL
博克斯考克斯变换 = NULL

Expand Down Expand Up @@ -533,10 +536,8 @@ source('函数/日内高频季节性自回归.R')
逐步精化量 = 94, #近似值与否=(length(x)>150|frequency(x)>12),
省略 = NULL, 计策谋略 = NULL, #x = y,
趋势 = NULL, 测试 = c('kpss', 'adf', 'pp'), 测试参数 = list(),
季节性测试参数 = list(),
季节性测试 = c('seas', 'ocsb', 'hegy', 'ch'),
允许截距与否 = '', 允许包含均值与否 = '',
博克斯考克斯变换 = NULL,
季节性测试参数 = list(), 季节性测试 = c('seas', 'ocsb', 'hegy', 'ch'),
允许截距与否 = '', 允许包含均值与否 = '', 博克斯考克斯变换 = NULL,
偏差调整与否 = '', 多管齐下与否 = '', 核心量 = 2, 包含均值与否 = '')


Expand All @@ -559,6 +560,15 @@ source('函数/日内高频季节性自回归.R')
biasadj = 偏差调整与否, method = 计策谋略)
}, 错误信息 = function(错误信息参数) NULL)

半成品 <- tryCatch({
Arima(
季回归, order = unlist(.时序规律[1,]),
seasonal = unlist(.季节性规律参数[1,]),
xreg = 趋势, include.mean = 包含均值与否,
include.drift = TRUE, #包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 'CSS')#计策谋略)
}, 错误信息 = function(错误信息参数) NULL)



Expand Down

0 comments on commit 7c7c676

Please sign in to comment.