- 博客(6)
- 收藏
- 关注
原创 2021-09-30 Backtesting.py 恒生指数
Backtesting.py 恒生指数简介载入packages读取数据策略遍历,选择夏普率最高的阈值和周期看看最大值是什么参数将参数套路策略,并查看回测图表查看逐次交易记录对先前得到的SR table计算9格mean和std计算SR of SR简介主要是使用backtesting.py做了个回测,对象是恒生指数,数据源是yahoo finance,策略是基于夏普率的Z-score 配合给定阈值,然后目标是计算9格平均夏普率的夏普率载入packagesimport numpy as npimport
2021-09-30 11:59:31 1140
原创 R 语言地图可视化 美国2016大选
rm(list=ls())load(file = "/Users/n.w./Documents/countypres_2000-2016.rdata")library(tidyverse)library(here)library(janitor)library(albersusa)library(sf)library(sp)library(rgeos)library(maptools)library(ggthemes)library(viridis)library(scales)l
2021-05-17 14:42:31 592
原创 2020-10-28 LogisticRegression Exercise
## ## Call:## glm(formula = OnlineOrderFlag ~ Bikes + Clothing + Components + ## Accessories, family = binomial(link = "logit"), data = data)## ## Deviance Residuals: ## Min 1Q Median 3Q Max ## -3.5203 0.0639 0.0736
2020-10-28 23:11:17 334
转载 glm() and lm()
In R, using lm() is a special case of glm().lm() fits models following the form Y = Xb + e, where e is Normal (0 , s^2).glm() fits models following the form f(Y) = Xb + e. However, in glm both the function f(Y) (the ‘link function’) and the distribution
2020-10-23 15:39:00 2127
转载 2020-10-11
###################################################问题:创建、操作向量 18.4.27 怎么创建向量 vector,,及其相关操作 ???解决方案: a <- 3; 或 a=3 #单数据变量 a * 2; sqrt(a); #单数据变量的简单运算 a2 = seq(1:8); a2 #生成等差序列 #[1] 1 2 3 4 ...
2020-10-11 10:58:45 97
原创 Exercise for loop
# 1. write a loop to print the following# 10# 20# 30# 40# 50# 60for i in range(1, 7): print(i * 10)# 2. write a loop to print the following.# [Tips: you need to use google to search]## 2 4 6 8 10a = ""for i in range(1, 6): a += st
2020-10-03 10:43:17 256
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人