MACD指标择时交易策略分析
引言
技术分析是金融市场中常用的分析方法,其中MACD指标是一种重要的趋势跟踪指标,能够反映价格波动的趋势和动量。本研究旨在通过R语言实现基于MACD指标的股票择时交易策略,并通过历史数据回测寻找最佳参数组合。
研究方法
数据获取与处理
我们将使用quantmod
包获取股票数据,并使用quantstrat
包进行策略回测。首先加载所需的包:
# 加载必要的包
library(quantmod)
library(quantstrat)
library(eTTR)
library(PerformanceAnalytics)
library(ggplot2)
library(dplyr)
library(tibble)
library(scales)
library(gridExtra)
library(showtext)
font_add("SimHei", regular = "SimHei.ttf")
showtext_auto()
接下来,我们获取TSLA的历史数据作为研究对象:
# 设置获取数据的起始和结束日期
startdate.st <- as.Date("2018-01-01")
enddate.st <- as.Date("2023-06-01")
# 获取上证指数数据
getSymbols("TSLA",
src = "yahoo",
from = startdate.st,
to = enddate.st)
## [1] "TSLA"
colnames(TSLA) <- c("Open", "High", "Low",
"Close", "Volume", "Adjusted")
# 查看数据结构
head(TSLA)
## Open High Low Close Volume Adjusted
## 2018-01-02 20.80000 21.47400 20.73333 21.36867 65283000 21.36867
## 2018-01-03 21.40000 21.68333 21.03667 21.15000 67822500 21.15000
## 2018-01-04 20.85800 21.23667 20.37867 20.97467 149194500 20.97467
## 2018-01-05 21.10800 21.14933 20.80000 21.10533 68868000 21.10533
## 2018-01-08 21.06667 22.46800 21.03333 22.42733 147891000 22.42733
## 2018-01-09 22.34400 22.58667 21.82667 22.24600 107199000 22.24600
summary(TSLA)
## Index Open High Low
## Min. :2018-01-02 Min. : 12.07 Min. : 12.45 Min. : 11.80
## 1st Qu.:2019-05-10 1st Qu.: 21.42 1st Qu.: 21.82 1st Qu.: 21.04
## Median :2020-09-15 Median :126.48 Median :130.84 Median :122.50
## Mean :2020-09-14 Mean :135.13 Mean :138.26 Mean :131.71
## 3rd Qu.:2022-01-20 3rd Qu.:230.08 3rd Qu.:235.64 3rd Qu.:224.40
## Max. :2023-05-31 Max. :411.47 Max. :414.50 Max. :405.67
## Close Volume Adjusted
## Min. : 11.93 Min. : 29401800 Min. : 11.93
## 1st Qu.: 21.50 1st Qu.: 77479900 1st Qu.: 21.50
## Median :125.58 Median :105881850 Median :125.58
## Mean :135.07 Mean :134180816 Mean :135.07
## 3rd Qu.:231.07 3rd Qu.:159549600 3rd Qu.:231.07
## Max. :409.97 Max. :914082000 Max. :409.97
MACD指标计算原理
MACD指标由三条曲线组成:DIF线、DEA线和MACD柱状图。其计算基于以下步骤:
计算短期和长期EMA: $$ EMA_{s} = \frac{2}{N_{s} + 1} \times (Cl - EMA_{s}^{pre}) + EMA_{s}^{pre} $$ $$ EMA_{l} = \frac{2}{N_{l} + 1} \times (Cl - EMA_{l}^{pre}) + EMA_{l}^{pre} $$ 其中,$N_{s}$ 通常为12,$N_{l}$ 通常为26。
计算DIF线: $$ DIF = EMA_{s} - EMA_{l} $$
计算DEA线: $$ DEA = \frac{2}{N_{signal} + 1} \times (DIF - DEA^{pre}) + DEA^{pre} $$ 其中,$N_{signal}$ 通常为9。
计算MACD柱状图: $$ MACD = DIF - DEA $$
交易策略设计
我们将基于MACD指标设计以下交易策略:
- 买入信号:当DIF线从下方上穿DEA线(金叉)
- 卖出信号:当DIF线从上方下穿DEA线(死叉)
下面我们使用quantstrat
包实现这个策略:
# 清理历史环境。
reset_strategy_env()
## 策略环境已重置
rm(list = ls(.blotter))
rm(list = ls(.strategy))
# 设置初始参数
initDate <- as.Date("2017-12-31")
initEq.st <- 1000000
portfolio.st <- "MACD_Portfolio"
strategy.st <- "MACD_Strategy"
account.st <- "MACD_Account"
symbols.st <- "TSLA"
# 初始化quantstrat
currency("USD")
## [1] "USD"
stock("TSLA", currency = "USD", multiplier = 1)
## [1] "TSLA"
initPortf(portfolio.st, symbols = symbols.st)
## [1] "MACD_Portfolio"
initAcct(account.st, portfolios = portfolio.st, initEq = initEq.st)
## [1] "MACD_Account"
initOrders(portfolio.st, symbols.st, initDate = initDate)
strategy(strategy.st, store = TRUE)
# 添加MACD指标
add.indicator(strategy.st,
name = "MACD",
arguments = list(x = quote(Cl(mktdata)),
nFast = 8,
nSlow = 21,
nSig = 35),
label = "MACD_8_21_35")
## [1] "MACD_Strategy"
# 添加交易规则
# 买入规则:DIF线上穿DEA线(金叉)
add.signal(strategy.st,
name = "sigCrossover",
arguments = list(columns = c("macd.MACD_8_21_35",
"signal.MACD_8_21_35"),
relationship = "gte"),
label = "Buy_Signal")
## [1] "MACD_Strategy"
# 卖出规则:DIF线下穿DEA线(死叉)
add.signal(strategy.st,
name = "sigCrossover",
arguments = list(columns = c("macd.MACD_8_21_35",
"signal.MACD_8_21_35"),
relationship = "lte"),
label = "Sell_Signal")
## [1] "MACD_Strategy"
# 添加交易规则
add.rule(strategy.st,
name = "ruleSignal",
arguments = list(sigcol = "Buy_Signal",
sigval = TRUE,
orderqty = 1000,
ordertype = "market",
orderside = "long",
replace = FALSE,
prefer = "Close"),
type = "enter",
label = "Enter_Long")
## [1] "MACD_Strategy"
add.rule(strategy.st,
name = "ruleSignal",
arguments = list(sigcol = "Sell_Signal",
sigval = TRUE,
orderqty = "all",
ordertype = "market",
orderside = "long",
replace = FALSE,
prefer = "Close"),
type = "exit",
label = "Exit_Long")
## [1] "MACD_Strategy"
# 添加止损规则(可选)
add.rule(strategy.st,
name = "ruleSignal",
arguments = list(sigcol = "Buy_Signal",
sigval = TRUE,
orderqty = "all",
ordertype = "stoplimit",
threshold = 0.05,
orderside = "long",
replace = FALSE,
prefer = "Close"),
type = "chain",
parent = "Enter_Long",
label = "Stop_Loss")
## [1] "MACD_Strategy"
# 策略回测
tryCatch({
applyStrategy(strategy = strategy.st,
portfolios = portfolio.st,
mktdata = TSLA)
# 更新结果
updatePortf(portfolio.st)
updateAcct(account.st)
updateEndEq(account.st)
# 分析回测结果
port_ret <- PortfReturns(account.st)
if (nrow(port_ret) > 0) {
# 计算绩效指标
sharpe_ratio <- SharpeRatio.annualized(port_ret, Rf = 0.02)
total_return <- Return.cumulative(port_ret)
max_drawdown <- maxDrawdown(port_ret)
cat("策略绩效指标:\n")
cat("夏普比率:", round(sharpe_ratio, 4), "\n")
cat("总回报率:", round(total_return, 4), "\n")
cat("最大回撤:", round(max_drawdown, 4), "\n")
# 绘制绩效图表
charts.PerformanceSummary(port_ret)
} else {
cat("警告: 策略未产生任何交易\n")
}
}, error = function(e) {
cat("回测失败:", e$message, "\n")
cat("请检查MACD指标参数和数据格式\n")
})
## [1] "2018-04-11 00:00:00 TSLA 1000 @ 20.0620002746582"
## [1] "2018-05-18 00:00:00 TSLA -1000 @ 18.4546661376953"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-07-03 00:00:00 TSLA -1000 @ 20.7240009307861"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-21 00:00:00 TSLA 1000 @ 19.9400005340576"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-26 00:00:00 TSLA -1000 @ 23.0666675567627"
## [1] "2018-12-06 00:00:00 TSLA 1000 @ 24.2040004730225"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-14 00:00:00 TSLA 1000 @ 22.2933330535889"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-04-01 00:00:00 TSLA 1000 @ 19.2786674499512"
## [1] "2019-04-25 00:00:00 TSLA -1000 @ 16.5086669921875"
## [1] "2019-06-10 00:00:00 TSLA 1000 @ 14.1920003890991"
## [1] "2019-07-29 00:00:00 TSLA -1000 @ 15.7180004119873"
## [1] "2019-09-06 00:00:00 TSLA 1000 @ 15.1633329391479"
## [1] "2019-09-26 00:00:00 TSLA -1000 @ 16.1706676483154"
## [1] "2019-09-27 00:00:00 TSLA 1000 @ 16.1420001983643"
## [1] "2019-10-07 00:00:00 TSLA -1000 @ 15.8479995727539"
## [1] "2019-10-10 00:00:00 TSLA 1000 @ 16.3159999847412"
## [1] "2019-11-25 00:00:00 TSLA -1000 @ 22.4226665496826"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-26 00:00:00 TSLA -1000 @ 51.9199981689453"
## [1] "2020-04-08 00:00:00 TSLA 1000 @ 36.5893325805664"
## [1] "2020-05-21 00:00:00 TSLA -1000 @ 55.1733322143555"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-25 00:00:00 TSLA -1000 @ 65.7320022583008"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-27 00:00:00 TSLA -1000 @ 102.639999389648"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-11-19 00:00:00 TSLA 1000 @ 166.42333984375"
## [1] "2020-12-24 00:00:00 TSLA -1000 @ 220.589996337891"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-25 00:00:00 TSLA -1000 @ 293.600006103516"
## [1] "2021-04-05 00:00:00 TSLA 1000 @ 230.350006103516"
## [1] "2021-05-04 00:00:00 TSLA -1000 @ 224.533340454102"
## [1] "2021-05-28 00:00:00 TSLA 1000 @ 208.406661987305"
## [1] "2021-07-19 00:00:00 TSLA -1000 @ 215.406661987305"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-27 00:00:00 TSLA 1000 @ 263.786682128906"
## [1] "2021-11-12 00:00:00 TSLA -1000 @ 344.473327636719"
## [1] "2021-12-29 00:00:00 TSLA 1000 @ 362.063323974609"
## [1] "2022-01-12 00:00:00 TSLA -1000 @ 368.739990234375"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-03-03 00:00:00 TSLA 1000 @ 279.763336181641"
## [1] "2022-03-08 00:00:00 TSLA -1000 @ 274.799987792969"
## [1] "2022-03-10 00:00:00 TSLA 1000 @ 279.433319091797"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-13 00:00:00 TSLA -1000 @ 340.790008544922"
## [1] "2022-06-02 00:00:00 TSLA 1000 @ 258.333343505859"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-23 00:00:00 TSLA -1000 @ 296.453338623047"
## [1] "2022-09-16 00:00:00 TSLA 1000 @ 303.350006103516"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-31 00:00:00 TSLA 1000 @ 227.539993286133"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-30 00:00:00 TSLA 1000 @ 194.699996948242"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-13 00:00:00 TSLA 1000 @ 122.400001525879"
## [1] "2023-03-03 00:00:00 TSLA -1000 @ 197.789993286133"
## [1] "2023-04-03 00:00:00 TSLA 1000 @ 194.770004272461"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-11 00:00:00 TSLA 1000 @ 172.080001831055"
## 策略绩效指标:
## 夏普比率: -13.1638
## 总回报率: 0.3459
## 最大回撤: 0.1093

参数优化
MACD指标的主要参数包括快速EMA周期(nFast)、慢速EMA周期(nSlow)和信号线周期(nSig)。为了找到最佳参数组合,我们将进行参数网格搜索:
# 设置参数网格
nFast_values <- c(8, 12, 16) # 快速EMA周期
nSlow_values <- c(22, 26, 30) # 慢速EMA周期
nSig_values <- c(7, 9, 11) # 信号线周期
# 创建参数组合
param_grid <- expand.grid(nFast = nFast_values,
nSlow = nSlow_values,
nSig = nSig_values)
# 过滤无效组合(确保nFast < nSlow)
param_grid <- param_grid[param_grid$nFast < param_grid$nSlow, ]
n_combinations <- nrow(param_grid)
# 初始化结果存储
results <- data.frame(
nFast = numeric(n_combinations),
nSlow = numeric(n_combinations),
nSig = numeric(n_combinations),
SharpeRatio = numeric(n_combinations),
Return = numeric(n_combinations),
MaxDrawdown = numeric(n_combinations),
TradeCount = numeric(n_combinations)
)
# 循环测试不同参数组合
for (i in 1:n_combinations) {
cat(paste0("测试参数组合 ", i, "/", n_combinations, ": nFast=",
param_grid$nFast[i], ", nSlow=", param_grid$nSlow[i],
", nSig=", param_grid$nSig[i], "\n"))
# 重置历史环境
reset_strategy_env()
# 清除之前的策略
rm(list = ls(.blotter))
rm(list = ls(.strategy))
# 初始化新策略
initPortf(portfolio.st, symbols = symbols.st)
initAcct(account.st, portfolios = portfolio.st, initEq = initEq.st)
initOrders(portfolio = portfolio.st)
strategy(strategy.st, store = TRUE)
# 添加MACD指标,使用当前参数组合
indicator_label <- paste0("MACD_",
param_grid$nFast[i],
"_",
param_grid$nSlow[i],
"_",
param_grid$nSig[i])
add.indicator(strategy.st,
name = "MACD",
arguments = list(x = quote(Cl(mktdata)),
nFast = param_grid$nFast[i],
nSlow = param_grid$nSlow[i],
nSig = param_grid$nSig[i]),
label = indicator_label
)
# 生成指标列名
macd_col <- paste0("macd.", indicator_label)
signal_col <- paste0("signal.", indicator_label)
# 添加与之前相同的交易信号和规则
# 买入信号
add.signal(strategy.st,
name = "sigCrossover",
arguments = list(columns = c(macd_col,signal_col),
relationship = "gte"),
label = "Buy_Signal")
# 卖出信号
add.signal(strategy.st,
name = "sigCrossover",
arguments = list(columns = c(macd_col,signal_col),
relationship = "lte"),
label = "Sell_Signal")
# 添加交易规则
add.rule(strategy.st,
name = "ruleSignal",
arguments = list(sigcol = "Buy_Signal",
sigval = TRUE,
orderqty = 1000,
ordertype = "market",
orderside = "long",
replace = FALSE,
prefer = "Close"),
type = "enter",
label = "Enter_Long")
add.rule(strategy.st,
name = "ruleSignal",
arguments = list(sigcol = "Sell_Signal",
sigval = TRUE,
orderqty = "all",
ordertype = "market",
orderside = "long",
replace = FALSE,
prefer = "Close"),
type = "exit",
label = "Exit_Long")
# 运行回测
out <- try(applyStrategy(strategy = strategy.st,
portfolios = portfolio.st),
silent = TRUE)
if (!inherits(out, "try-error")) {
# 分析结果
updatePortf(portfolio.st)
updateAcct(account.st)
updateEndEq(account.st)
# 获取策略收益
port_ret <- PortfReturns(account.st)
# 计算评估指标
if (nrow(port_ret) > 0) {
sharpe_ratio <- SharpeRatio.annualized(port_ret)
total_return <- Return.cumulative(port_ret)
max_drawdown <- maxDrawdown(port_ret)
trade_count <- length(index(getTxns(Portfolio = portfolio.st,
Symbol = symbols.st)
)
)
# 存储结果
results[i, ] <- c(param_grid$nFast[i],
param_grid$nSlow[i],
param_grid$nSig[i],
sharpe_ratio,
total_return,
max_drawdown,
trade_count)
}
}
}
## 测试参数组合 1/27: nFast=8, nSlow=22, nSig=7
## 策略环境已重置
## [1] "2018-02-21 00:00:00 TSLA 1000 @ 22.2199993133545"
## [1] "2018-03-02 00:00:00 TSLA -1000 @ 22.3413333892822"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-25 00:00:00 TSLA -1000 @ 18.71266746521"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-07-20 00:00:00 TSLA 1000 @ 20.9053325653076"
## [1] "2018-07-23 00:00:00 TSLA -1000 @ 20.2133331298828"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-16 00:00:00 TSLA -1000 @ 22.3633327484131"
## [1] "2018-09-14 00:00:00 TSLA 1000 @ 19.6800003051758"
## [1] "2018-10-01 00:00:00 TSLA -1000 @ 20.7133331298828"
## [1] "2018-10-02 00:00:00 TSLA 1000 @ 20.068000793457"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-17 00:00:00 TSLA 1000 @ 18.1186676025391"
## [1] "2018-11-13 00:00:00 TSLA -1000 @ 22.5820007324219"
## [1] "2018-12-06 00:00:00 TSLA 1000 @ 24.2040004730225"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-08 00:00:00 TSLA 1000 @ 22.3566665649414"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-01 00:00:00 TSLA 1000 @ 20.8139991760254"
## [1] "2019-02-21 00:00:00 TSLA -1000 @ 19.4153327941895"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-14 00:00:00 TSLA 1000 @ 19.3306674957275"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-12 00:00:00 TSLA -1000 @ 17.8466663360596"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-06 00:00:00 TSLA 1000 @ 17.0226669311523"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-05 00:00:00 TSLA 1000 @ 13.1059999465942"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-08-30 00:00:00 TSLA 1000 @ 15.0406665802002"
## [1] "2019-09-24 00:00:00 TSLA -1000 @ 14.8806667327881"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-10 00:00:00 TSLA 1000 @ 16.3159999847412"
## [1] "2019-10-24 00:00:00 TSLA -1000 @ 19.978666305542"
## [1] "2019-10-25 00:00:00 TSLA 1000 @ 21.8753337860107"
## [1] "2019-11-07 00:00:00 TSLA -1000 @ 22.3693332672119"
## [1] "2019-11-08 00:00:00 TSLA 1000 @ 22.4759998321533"
## [1] "2019-11-14 00:00:00 TSLA -1000 @ 23.2900009155273"
## [1] "2019-12-12 00:00:00 TSLA 1000 @ 23.978666305542"
## [1] "2020-01-02 00:00:00 TSLA -1000 @ 28.6840000152588"
## [1] "2020-01-06 00:00:00 TSLA 1000 @ 30.1026668548584"
## [1] "2020-01-21 00:00:00 TSLA -1000 @ 36.4799995422363"
## [1] "2020-01-22 00:00:00 TSLA 1000 @ 37.9706687927246"
## [1] "2020-01-28 00:00:00 TSLA -1000 @ 37.7933311462402"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-12 00:00:00 TSLA -1000 @ 51.1526679992676"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-24 00:00:00 TSLA -1000 @ 55.5859985351562"
## [1] "2020-03-26 00:00:00 TSLA 1000 @ 35.2106666564941"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-22 00:00:00 TSLA -1000 @ 66.2880020141602"
## [1] "2020-07-01 00:00:00 TSLA 1000 @ 74.6419982910156"
## [1] "2020-07-20 00:00:00 TSLA -1000 @ 109.533332824707"
## [1] "2020-07-21 00:00:00 TSLA 1000 @ 104.557334899902"
## [1] "2020-07-22 00:00:00 TSLA -1000 @ 106.155334472656"
## [1] "2020-08-14 00:00:00 TSLA 1000 @ 110.047332763672"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-17 00:00:00 TSLA 1000 @ 141.143325805664"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-02 00:00:00 TSLA 1000 @ 138.363327026367"
## [1] "2020-10-05 00:00:00 TSLA -1000 @ 141.893325805664"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-13 00:00:00 TSLA -1000 @ 136.16667175293"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-11 00:00:00 TSLA -1000 @ 203.330001831055"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-19 00:00:00 TSLA -1000 @ 281.516662597656"
## [1] "2021-03-11 00:00:00 TSLA 1000 @ 233.199996948242"
## [1] "2021-03-26 00:00:00 TSLA -1000 @ 206.236663818359"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-25 00:00:00 TSLA 1000 @ 201.563339233398"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-26 00:00:00 TSLA 1000 @ 233.720001220703"
## [1] "2021-09-14 00:00:00 TSLA -1000 @ 248.163330078125"
## [1] "2021-09-27 00:00:00 TSLA 1000 @ 263.786682128906"
## [1] "2021-10-05 00:00:00 TSLA -1000 @ 260.196655273438"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-09 00:00:00 TSLA -1000 @ 341.166656494141"
## [1] "2021-12-23 00:00:00 TSLA 1000 @ 355.666656494141"
## [1] "2022-01-10 00:00:00 TSLA -1000 @ 352.706665039062"
## [1] "2022-02-07 00:00:00 TSLA 1000 @ 302.446655273438"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-01 00:00:00 TSLA 1000 @ 288.123321533203"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-07 00:00:00 TSLA -1000 @ 352.420013427734"
## [1] "2022-05-27 00:00:00 TSLA 1000 @ 253.210006713867"
## [1] "2022-06-14 00:00:00 TSLA -1000 @ 220.889999389648"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-09 00:00:00 TSLA -1000 @ 283.333343505859"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-20 00:00:00 TSLA 1000 @ 207.279998779297"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-09 00:00:00 TSLA -1000 @ 179.050003051758"
## [1] "2022-12-12 00:00:00 TSLA 1000 @ 167.820007324219"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-14 00:00:00 TSLA -1000 @ 209.25"
## [1] "2023-02-16 00:00:00 TSLA 1000 @ 202.039993286133"
## [1] "2023-02-17 00:00:00 TSLA -1000 @ 208.309997558594"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-05 00:00:00 TSLA 1000 @ 170.059997558594"
## 测试参数组合 2/27: nFast=12, nSlow=22, nSig=7
## 策略环境已重置
## [1] "2018-02-22 00:00:00 TSLA 1000 @ 23.0779991149902"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-14 00:00:00 TSLA -1000 @ 22.9333324432373"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-10 00:00:00 TSLA -1000 @ 24.3433322906494"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-14 00:00:00 TSLA 1000 @ 19.3306674957275"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-18 00:00:00 TSLA -1000 @ 23.3326663970947"
## [1] "2019-12-13 00:00:00 TSLA 1000 @ 23.8926677703857"
## [1] "2020-01-28 00:00:00 TSLA -1000 @ 37.7933311462402"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-27 00:00:00 TSLA 1000 @ 34.2906684875488"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-22 00:00:00 TSLA -1000 @ 106.155334472656"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-22 00:00:00 TSLA 1000 @ 141.410003662109"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-02 00:00:00 TSLA 1000 @ 138.363327026367"
## [1] "2020-10-05 00:00:00 TSLA -1000 @ 141.893325805664"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-30 00:00:00 TSLA 1000 @ 243.636672973633"
## [1] "2021-09-15 00:00:00 TSLA -1000 @ 251.943328857422"
## [1] "2021-09-16 00:00:00 TSLA 1000 @ 252.330001831055"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-11 00:00:00 TSLA -1000 @ 354.799987792969"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-08 00:00:00 TSLA 1000 @ 307.333343505859"
## [1] "2022-02-15 00:00:00 TSLA -1000 @ 307.476654052734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-08 00:00:00 TSLA -1000 @ 341.829986572266"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-25 00:00:00 TSLA 1000 @ 222.419998168945"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-17 00:00:00 TSLA -1000 @ 208.309997558594"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 3/27: nFast=16, nSlow=22, nSig=7
## 策略环境已重置
## [1] "2018-02-23 00:00:00 TSLA 1000 @ 23.4699993133545"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-15 00:00:00 TSLA -1000 @ 23.2293338775635"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-13 00:00:00 TSLA -1000 @ 15.1339998245239"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-16 00:00:00 TSLA 1000 @ 25.4333324432373"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-30 00:00:00 TSLA 1000 @ 33.4753341674805"
## [1] "2020-05-06 00:00:00 TSLA -1000 @ 52.1720008850098"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-23 00:00:00 TSLA -1000 @ 100.87133026123"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-09 00:00:00 TSLA 1000 @ 140.419998168945"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-16 00:00:00 TSLA -1000 @ 207.589996337891"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-15 00:00:00 TSLA 1000 @ 235.979995727539"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-09 00:00:00 TSLA -1000 @ 218.983337402344"
## [1] "2021-07-13 00:00:00 TSLA 1000 @ 222.846664428711"
## [1] "2021-07-14 00:00:00 TSLA -1000 @ 217.793334960938"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-12 00:00:00 TSLA -1000 @ 368.739990234375"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-09 00:00:00 TSLA 1000 @ 310.666656494141"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-11 00:00:00 TSLA -1000 @ 286.630004882812"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-24 00:00:00 TSLA 1000 @ 190.410003662109"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 4/27: nFast=8, nSlow=26, nSig=7
## 策略环境已重置
## [1] "2018-02-20 00:00:00 TSLA 1000 @ 22.318000793457"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-25 00:00:00 TSLA -1000 @ 18.71266746521"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-16 00:00:00 TSLA -1000 @ 22.3633327484131"
## [1] "2018-09-14 00:00:00 TSLA 1000 @ 19.6800003051758"
## [1] "2018-10-01 00:00:00 TSLA -1000 @ 20.7133331298828"
## [1] "2018-10-02 00:00:00 TSLA 1000 @ 20.068000793457"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-17 00:00:00 TSLA 1000 @ 18.1186676025391"
## [1] "2018-11-13 00:00:00 TSLA -1000 @ 22.5820007324219"
## [1] "2018-12-06 00:00:00 TSLA 1000 @ 24.2040004730225"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-08 00:00:00 TSLA 1000 @ 22.3566665649414"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-21 00:00:00 TSLA -1000 @ 19.4153327941895"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-14 00:00:00 TSLA 1000 @ 19.3306674957275"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-12 00:00:00 TSLA -1000 @ 17.8466663360596"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-06 00:00:00 TSLA 1000 @ 17.0226669311523"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-05 00:00:00 TSLA 1000 @ 13.1059999465942"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-08-30 00:00:00 TSLA 1000 @ 15.0406665802002"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-10 00:00:00 TSLA 1000 @ 16.3159999847412"
## [1] "2019-10-24 00:00:00 TSLA -1000 @ 19.978666305542"
## [1] "2019-10-25 00:00:00 TSLA 1000 @ 21.8753337860107"
## [1] "2019-11-15 00:00:00 TSLA -1000 @ 23.4780006408691"
## [1] "2019-12-12 00:00:00 TSLA 1000 @ 23.978666305542"
## [1] "2020-01-21 00:00:00 TSLA -1000 @ 36.4799995422363"
## [1] "2020-01-22 00:00:00 TSLA 1000 @ 37.9706687927246"
## [1] "2020-01-28 00:00:00 TSLA -1000 @ 37.7933311462402"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-12 00:00:00 TSLA -1000 @ 51.1526679992676"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-26 00:00:00 TSLA 1000 @ 35.2106666564941"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-22 00:00:00 TSLA -1000 @ 66.2880020141602"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-20 00:00:00 TSLA -1000 @ 109.533332824707"
## [1] "2020-07-21 00:00:00 TSLA 1000 @ 104.557334899902"
## [1] "2020-07-22 00:00:00 TSLA -1000 @ 106.155334472656"
## [1] "2020-08-14 00:00:00 TSLA 1000 @ 110.047332763672"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-21 00:00:00 TSLA 1000 @ 149.796661376953"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-02 00:00:00 TSLA 1000 @ 138.363327026367"
## [1] "2020-10-05 00:00:00 TSLA -1000 @ 141.893325805664"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-12 00:00:00 TSLA -1000 @ 137.253326416016"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-11 00:00:00 TSLA -1000 @ 203.330001831055"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-19 00:00:00 TSLA -1000 @ 281.516662597656"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-26 00:00:00 TSLA -1000 @ 206.236663818359"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-25 00:00:00 TSLA 1000 @ 201.563339233398"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-26 00:00:00 TSLA 1000 @ 233.720001220703"
## [1] "2021-08-27 00:00:00 TSLA -1000 @ 237.306671142578"
## [1] "2021-08-30 00:00:00 TSLA 1000 @ 243.636672973633"
## [1] "2021-09-14 00:00:00 TSLA -1000 @ 248.163330078125"
## [1] "2021-09-17 00:00:00 TSLA 1000 @ 253.163330078125"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-27 00:00:00 TSLA 1000 @ 263.786682128906"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-10 00:00:00 TSLA -1000 @ 352.706665039062"
## [1] "2022-02-07 00:00:00 TSLA 1000 @ 302.446655273438"
## [1] "2022-02-15 00:00:00 TSLA -1000 @ 307.476654052734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-07 00:00:00 TSLA -1000 @ 352.420013427734"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-14 00:00:00 TSLA -1000 @ 220.889999389648"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-09 00:00:00 TSLA -1000 @ 283.333343505859"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-20 00:00:00 TSLA 1000 @ 207.279998779297"
## [1] "2022-10-21 00:00:00 TSLA -1000 @ 214.440002441406"
## [1] "2022-10-24 00:00:00 TSLA 1000 @ 211.25"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-09 00:00:00 TSLA -1000 @ 179.050003051758"
## [1] "2022-12-12 00:00:00 TSLA 1000 @ 167.820007324219"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-17 00:00:00 TSLA -1000 @ 208.309997558594"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-05 00:00:00 TSLA 1000 @ 170.059997558594"
## 测试参数组合 5/27: nFast=12, nSlow=26, nSig=7
## 策略环境已重置
## [1] "2018-02-22 00:00:00 TSLA 1000 @ 23.0779991149902"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-27 00:00:00 TSLA 1000 @ 19.6053333282471"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-14 00:00:00 TSLA -1000 @ 22.9333324432373"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-10 00:00:00 TSLA -1000 @ 24.3433322906494"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-13 00:00:00 TSLA 1000 @ 23.8926677703857"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-27 00:00:00 TSLA 1000 @ 34.2906684875488"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-23 00:00:00 TSLA -1000 @ 100.87133026123"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-09 00:00:00 TSLA -1000 @ 218.983337402344"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-11 00:00:00 TSLA -1000 @ 354.799987792969"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-09 00:00:00 TSLA 1000 @ 310.666656494141"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-23 00:00:00 TSLA 1000 @ 192.220001220703"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 6/27: nFast=16, nSlow=26, nSig=7
## 策略环境已重置
## [1] "2018-02-23 00:00:00 TSLA 1000 @ 23.4699993133545"
## [1] "2018-03-06 00:00:00 TSLA -1000 @ 21.8799991607666"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-17 00:00:00 TSLA -1000 @ 18.9693336486816"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-21 00:00:00 TSLA -1000 @ 22.5459995269775"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-16 00:00:00 TSLA -1000 @ 18.2240009307861"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-13 00:00:00 TSLA -1000 @ 15.1339998245239"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-01-30 00:00:00 TSLA -1000 @ 42.7206687927246"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-14 00:00:00 TSLA -1000 @ 53.335334777832"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-31 00:00:00 TSLA 1000 @ 34.9333343505859"
## [1] "2020-05-08 00:00:00 TSLA -1000 @ 54.6279983520508"
## [1] "2020-05-11 00:00:00 TSLA 1000 @ 54.0859985351562"
## [1] "2020-05-14 00:00:00 TSLA -1000 @ 53.5553321838379"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-09 00:00:00 TSLA 1000 @ 140.419998168945"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-16 00:00:00 TSLA -1000 @ 207.589996337891"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-15 00:00:00 TSLA 1000 @ 235.979995727539"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-12 00:00:00 TSLA -1000 @ 228.566665649414"
## [1] "2021-07-13 00:00:00 TSLA 1000 @ 222.846664428711"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-12 00:00:00 TSLA -1000 @ 368.739990234375"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-10 00:00:00 TSLA 1000 @ 301.516662597656"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-12 00:00:00 TSLA -1000 @ 300.029998779297"
## [1] "2022-08-16 00:00:00 TSLA 1000 @ 306.563323974609"
## [1] "2022-08-18 00:00:00 TSLA -1000 @ 302.869995117188"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-27 00:00:00 TSLA 1000 @ 191.809997558594"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 7/27: nFast=8, nSlow=30, nSig=7
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-25 00:00:00 TSLA -1000 @ 18.71266746521"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-16 00:00:00 TSLA -1000 @ 22.3633327484131"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-01 00:00:00 TSLA -1000 @ 20.7133331298828"
## [1] "2018-10-02 00:00:00 TSLA 1000 @ 20.068000793457"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-17 00:00:00 TSLA 1000 @ 18.1186676025391"
## [1] "2018-11-13 00:00:00 TSLA -1000 @ 22.5820007324219"
## [1] "2018-12-06 00:00:00 TSLA 1000 @ 24.2040004730225"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-08 00:00:00 TSLA 1000 @ 22.3566665649414"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-21 00:00:00 TSLA -1000 @ 19.4153327941895"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-14 00:00:00 TSLA 1000 @ 19.3306674957275"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-12 00:00:00 TSLA -1000 @ 17.8466663360596"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-10 00:00:00 TSLA 1000 @ 16.3159999847412"
## [1] "2019-11-18 00:00:00 TSLA -1000 @ 23.3326663970947"
## [1] "2019-12-13 00:00:00 TSLA 1000 @ 23.8926677703857"
## [1] "2020-01-21 00:00:00 TSLA -1000 @ 36.4799995422363"
## [1] "2020-01-22 00:00:00 TSLA 1000 @ 37.9706687927246"
## [1] "2020-01-28 00:00:00 TSLA -1000 @ 37.7933311462402"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-12 00:00:00 TSLA -1000 @ 51.1526679992676"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-26 00:00:00 TSLA 1000 @ 35.2106666564941"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-22 00:00:00 TSLA -1000 @ 66.2880020141602"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-22 00:00:00 TSLA -1000 @ 106.155334472656"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-21 00:00:00 TSLA 1000 @ 149.796661376953"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-02 00:00:00 TSLA 1000 @ 138.363327026367"
## [1] "2020-10-05 00:00:00 TSLA -1000 @ 141.893325805664"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-19 00:00:00 TSLA -1000 @ 281.516662597656"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-25 00:00:00 TSLA -1000 @ 213.463333129883"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-25 00:00:00 TSLA 1000 @ 201.563339233398"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-26 00:00:00 TSLA 1000 @ 233.720001220703"
## [1] "2021-08-27 00:00:00 TSLA -1000 @ 237.306671142578"
## [1] "2021-08-30 00:00:00 TSLA 1000 @ 243.636672973633"
## [1] "2021-09-15 00:00:00 TSLA -1000 @ 251.943328857422"
## [1] "2021-09-16 00:00:00 TSLA 1000 @ 252.330001831055"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-27 00:00:00 TSLA 1000 @ 263.786682128906"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-10 00:00:00 TSLA -1000 @ 352.706665039062"
## [1] "2022-02-07 00:00:00 TSLA 1000 @ 302.446655273438"
## [1] "2022-02-15 00:00:00 TSLA -1000 @ 307.476654052734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-08 00:00:00 TSLA -1000 @ 341.829986572266"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-14 00:00:00 TSLA -1000 @ 220.889999389648"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-25 00:00:00 TSLA 1000 @ 222.419998168945"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-09 00:00:00 TSLA -1000 @ 179.050003051758"
## [1] "2022-12-12 00:00:00 TSLA 1000 @ 167.820007324219"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-17 00:00:00 TSLA -1000 @ 208.309997558594"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 8/27: nFast=12, nSlow=30, nSig=7
## 策略环境已重置
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-27 00:00:00 TSLA 1000 @ 19.6053333282471"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-15 00:00:00 TSLA -1000 @ 23.2293338775635"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-10 00:00:00 TSLA -1000 @ 24.3433322906494"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-13 00:00:00 TSLA -1000 @ 15.1339998245239"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-16 00:00:00 TSLA 1000 @ 25.4333324432373"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-30 00:00:00 TSLA 1000 @ 33.4753341674805"
## [1] "2020-05-05 00:00:00 TSLA -1000 @ 51.2140007019043"
## [1] "2020-05-11 00:00:00 TSLA 1000 @ 54.0859985351562"
## [1] "2020-05-13 00:00:00 TSLA -1000 @ 52.7306671142578"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-23 00:00:00 TSLA -1000 @ 100.87133026123"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-16 00:00:00 TSLA -1000 @ 207.589996337891"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-15 00:00:00 TSLA 1000 @ 235.979995727539"
## [1] "2021-03-26 00:00:00 TSLA -1000 @ 206.236663818359"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-09 00:00:00 TSLA -1000 @ 218.983337402344"
## [1] "2021-07-13 00:00:00 TSLA 1000 @ 222.846664428711"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-11 00:00:00 TSLA -1000 @ 354.799987792969"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-09 00:00:00 TSLA 1000 @ 310.666656494141"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-11 00:00:00 TSLA -1000 @ 286.630004882812"
## [1] "2022-08-16 00:00:00 TSLA 1000 @ 306.563323974609"
## [1] "2022-08-18 00:00:00 TSLA -1000 @ 302.869995117188"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-23 00:00:00 TSLA 1000 @ 192.220001220703"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 9/27: nFast=16, nSlow=30, nSig=7
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-17 00:00:00 TSLA -1000 @ 18.9693336486816"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-27 00:00:00 TSLA -1000 @ 22.966667175293"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-09-19 00:00:00 TSLA -1000 @ 19.9346675872803"
## [1] "2018-09-20 00:00:00 TSLA 1000 @ 19.8886661529541"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-23 00:00:00 TSLA -1000 @ 21.7220001220703"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-16 00:00:00 TSLA -1000 @ 18.2240009307861"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-05-08 00:00:00 TSLA 1000 @ 16.3226661682129"
## [1] "2019-05-10 00:00:00 TSLA -1000 @ 15.9680004119873"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-04 00:00:00 TSLA 1000 @ 14.7119998931885"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-01 00:00:00 TSLA 1000 @ 16.3126678466797"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-18 00:00:00 TSLA -1000 @ 57.2266654968262"
## [1] "2020-02-19 00:00:00 TSLA 1000 @ 61.1613311767578"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-01 00:00:00 TSLA 1000 @ 32.1040000915527"
## [1] "2020-04-03 00:00:00 TSLA -1000 @ 32.0006675720215"
## [1] "2020-04-07 00:00:00 TSLA 1000 @ 36.3633346557617"
## [1] "2020-05-14 00:00:00 TSLA -1000 @ 53.5553321838379"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-19 00:00:00 TSLA -1000 @ 143.610000610352"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-17 00:00:00 TSLA -1000 @ 218.633331298828"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-16 00:00:00 TSLA 1000 @ 225.626663208008"
## [1] "2021-03-25 00:00:00 TSLA -1000 @ 213.463333129883"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-12 00:00:00 TSLA -1000 @ 368.739990234375"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-10 00:00:00 TSLA 1000 @ 301.516662597656"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-12 00:00:00 TSLA -1000 @ 300.029998779297"
## [1] "2022-08-15 00:00:00 TSLA 1000 @ 309.320007324219"
## [1] "2022-08-19 00:00:00 TSLA -1000 @ 296.666656494141"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-27 00:00:00 TSLA 1000 @ 225.089996337891"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-23 00:00:00 TSLA -1000 @ 202.070007324219"
## [1] "2023-03-30 00:00:00 TSLA 1000 @ 195.279998779297"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 10/27: nFast=8, nSlow=22, nSig=9
## 策略环境已重置
## [1] "2018-02-22 00:00:00 TSLA 1000 @ 23.0779991149902"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-01 00:00:00 TSLA -1000 @ 20.7133331298828"
## [1] "2018-10-02 00:00:00 TSLA 1000 @ 20.068000793457"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-13 00:00:00 TSLA -1000 @ 22.5820007324219"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-08 00:00:00 TSLA 1000 @ 22.3566665649414"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-14 00:00:00 TSLA 1000 @ 19.3306674957275"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-12 00:00:00 TSLA -1000 @ 17.8466663360596"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-15 00:00:00 TSLA -1000 @ 23.4780006408691"
## [1] "2019-12-13 00:00:00 TSLA 1000 @ 23.8926677703857"
## [1] "2020-01-21 00:00:00 TSLA -1000 @ 36.4799995422363"
## [1] "2020-01-22 00:00:00 TSLA 1000 @ 37.9706687927246"
## [1] "2020-01-28 00:00:00 TSLA -1000 @ 37.7933311462402"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-12 00:00:00 TSLA -1000 @ 51.1526679992676"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-24 00:00:00 TSLA -1000 @ 55.5859985351562"
## [1] "2020-03-26 00:00:00 TSLA 1000 @ 35.2106666564941"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-22 00:00:00 TSLA -1000 @ 66.2880020141602"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-22 00:00:00 TSLA -1000 @ 106.155334472656"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-22 00:00:00 TSLA 1000 @ 141.410003662109"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-02 00:00:00 TSLA 1000 @ 138.363327026367"
## [1] "2020-10-05 00:00:00 TSLA -1000 @ 141.893325805664"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-13 00:00:00 TSLA -1000 @ 136.16667175293"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-25 00:00:00 TSLA 1000 @ 201.563339233398"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-30 00:00:00 TSLA 1000 @ 243.636672973633"
## [1] "2021-09-15 00:00:00 TSLA -1000 @ 251.943328857422"
## [1] "2021-09-17 00:00:00 TSLA 1000 @ 253.163330078125"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-10 00:00:00 TSLA -1000 @ 352.706665039062"
## [1] "2022-02-07 00:00:00 TSLA 1000 @ 302.446655273438"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-08 00:00:00 TSLA -1000 @ 341.829986572266"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-24 00:00:00 TSLA 1000 @ 211.25"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-17 00:00:00 TSLA -1000 @ 208.309997558594"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 11/27: nFast=12, nSlow=22, nSig=9
## 策略环境已重置
## [1] "2018-02-23 00:00:00 TSLA 1000 @ 23.4699993133545"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-15 00:00:00 TSLA -1000 @ 23.2293338775635"
## [1] "2018-12-12 00:00:00 TSLA 1000 @ 24.4400005340576"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-16 00:00:00 TSLA 1000 @ 25.4333324432373"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-30 00:00:00 TSLA 1000 @ 33.4753341674805"
## [1] "2020-05-05 00:00:00 TSLA -1000 @ 51.2140007019043"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-23 00:00:00 TSLA -1000 @ 100.87133026123"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-15 00:00:00 TSLA -1000 @ 211.08332824707"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-15 00:00:00 TSLA 1000 @ 235.979995727539"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-09 00:00:00 TSLA -1000 @ 218.983337402344"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-12 00:00:00 TSLA -1000 @ 368.739990234375"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-09 00:00:00 TSLA 1000 @ 310.666656494141"
## [1] "2022-02-15 00:00:00 TSLA -1000 @ 307.476654052734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-24 00:00:00 TSLA 1000 @ 190.410003662109"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 12/27: nFast=16, nSlow=22, nSig=9
## 策略环境已重置
## [1] "2018-02-23 00:00:00 TSLA 1000 @ 23.4699993133545"
## [1] "2018-03-06 00:00:00 TSLA -1000 @ 21.8799991607666"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-17 00:00:00 TSLA -1000 @ 18.9693336486816"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-06-27 00:00:00 TSLA -1000 @ 22.966667175293"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-21 00:00:00 TSLA -1000 @ 22.5459995269775"
## [1] "2018-12-14 00:00:00 TSLA 1000 @ 24.3806667327881"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-16 00:00:00 TSLA -1000 @ 18.2240009307861"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-05-09 00:00:00 TSLA 1000 @ 16.1319999694824"
## [1] "2019-05-10 00:00:00 TSLA -1000 @ 15.9680004119873"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-04 00:00:00 TSLA 1000 @ 14.7119998931885"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-20 00:00:00 TSLA -1000 @ 23.4813327789307"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-01-30 00:00:00 TSLA -1000 @ 42.7206687927246"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-18 00:00:00 TSLA -1000 @ 57.2266654968262"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-31 00:00:00 TSLA 1000 @ 34.9333343505859"
## [1] "2020-05-08 00:00:00 TSLA -1000 @ 54.6279983520508"
## [1] "2020-05-11 00:00:00 TSLA 1000 @ 54.0859985351562"
## [1] "2020-05-13 00:00:00 TSLA -1000 @ 52.7306671142578"
## [1] "2020-06-04 00:00:00 TSLA 1000 @ 57.6253318786621"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-17 00:00:00 TSLA -1000 @ 218.633331298828"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-16 00:00:00 TSLA 1000 @ 225.626663208008"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-10 00:00:00 TSLA 1000 @ 301.516662597656"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-06-21 00:00:00 TSLA -1000 @ 237.036666870117"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-12 00:00:00 TSLA -1000 @ 300.029998779297"
## [1] "2022-08-16 00:00:00 TSLA 1000 @ 306.563323974609"
## [1] "2022-08-18 00:00:00 TSLA -1000 @ 302.869995117188"
## [1] "2022-09-14 00:00:00 TSLA 1000 @ 302.609985351562"
## [1] "2022-09-26 00:00:00 TSLA -1000 @ 276.010009765625"
## [1] "2022-10-27 00:00:00 TSLA 1000 @ 225.089996337891"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-23 00:00:00 TSLA -1000 @ 202.070007324219"
## [1] "2023-03-28 00:00:00 TSLA 1000 @ 189.190002441406"
## [1] "2023-03-29 00:00:00 TSLA -1000 @ 193.880004882812"
## [1] "2023-03-30 00:00:00 TSLA 1000 @ 195.279998779297"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 13/27: nFast=8, nSlow=26, nSig=9
## 策略环境已重置
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-01 00:00:00 TSLA -1000 @ 20.7133331298828"
## [1] "2018-10-02 00:00:00 TSLA 1000 @ 20.068000793457"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-14 00:00:00 TSLA -1000 @ 22.9333324432373"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-14 00:00:00 TSLA 1000 @ 19.3306674957275"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-12 00:00:00 TSLA -1000 @ 17.8466663360596"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-18 00:00:00 TSLA -1000 @ 23.3326663970947"
## [1] "2019-12-13 00:00:00 TSLA 1000 @ 23.8926677703857"
## [1] "2020-01-28 00:00:00 TSLA -1000 @ 37.7933311462402"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-27 00:00:00 TSLA 1000 @ 34.2906684875488"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-22 00:00:00 TSLA -1000 @ 106.155334472656"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-22 00:00:00 TSLA 1000 @ 141.410003662109"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-02 00:00:00 TSLA 1000 @ 138.363327026367"
## [1] "2020-10-05 00:00:00 TSLA -1000 @ 141.893325805664"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-30 00:00:00 TSLA 1000 @ 243.636672973633"
## [1] "2021-09-15 00:00:00 TSLA -1000 @ 251.943328857422"
## [1] "2021-09-16 00:00:00 TSLA 1000 @ 252.330001831055"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-10 00:00:00 TSLA -1000 @ 352.706665039062"
## [1] "2022-02-08 00:00:00 TSLA 1000 @ 307.333343505859"
## [1] "2022-02-15 00:00:00 TSLA -1000 @ 307.476654052734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-08 00:00:00 TSLA -1000 @ 341.829986572266"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-25 00:00:00 TSLA 1000 @ 222.419998168945"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-21 00:00:00 TSLA -1000 @ 197.369995117188"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 14/27: nFast=12, nSlow=26, nSig=9
## 策略环境已重置
## [1] "2018-02-22 00:00:00 TSLA 1000 @ 23.0779991149902"
## [1] "2018-03-06 00:00:00 TSLA -1000 @ 21.8799991607666"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-17 00:00:00 TSLA -1000 @ 18.9693336486816"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-19 00:00:00 TSLA 1000 @ 17.3333320617676"
## [1] "2018-10-22 00:00:00 TSLA -1000 @ 17.3966674804688"
## [1] "2018-10-23 00:00:00 TSLA 1000 @ 19.6093330383301"
## [1] "2018-11-20 00:00:00 TSLA -1000 @ 23.1660003662109"
## [1] "2018-12-12 00:00:00 TSLA 1000 @ 24.4400005340576"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-16 00:00:00 TSLA -1000 @ 18.2240009307861"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-08 00:00:00 TSLA 1000 @ 16.3226661682129"
## [1] "2019-05-13 00:00:00 TSLA -1000 @ 15.1339998245239"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-14 00:00:00 TSLA -1000 @ 53.335334777832"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-30 00:00:00 TSLA 1000 @ 33.4753341674805"
## [1] "2020-05-06 00:00:00 TSLA -1000 @ 52.1720008850098"
## [1] "2020-05-11 00:00:00 TSLA 1000 @ 54.0859985351562"
## [1] "2020-05-12 00:00:00 TSLA -1000 @ 53.9606666564941"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-09 00:00:00 TSLA 1000 @ 140.419998168945"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-16 00:00:00 TSLA -1000 @ 207.589996337891"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-15 00:00:00 TSLA 1000 @ 235.979995727539"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-12 00:00:00 TSLA -1000 @ 228.566665649414"
## [1] "2021-07-13 00:00:00 TSLA 1000 @ 222.846664428711"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-12 00:00:00 TSLA -1000 @ 368.739990234375"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-10 00:00:00 TSLA 1000 @ 301.516662597656"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-12 00:00:00 TSLA -1000 @ 300.029998779297"
## [1] "2022-08-17 00:00:00 TSLA 1000 @ 303.996673583984"
## [1] "2022-08-18 00:00:00 TSLA -1000 @ 302.869995117188"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-24 00:00:00 TSLA 1000 @ 190.410003662109"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 15/27: nFast=16, nSlow=26, nSig=9
## 策略环境已重置
## [1] "2018-02-23 00:00:00 TSLA 1000 @ 23.4699993133545"
## [1] "2018-03-06 00:00:00 TSLA -1000 @ 21.8799991607666"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-10 00:00:00 TSLA 1000 @ 20.3133335113525"
## [1] "2018-05-18 00:00:00 TSLA -1000 @ 18.4546661376953"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-06-27 00:00:00 TSLA -1000 @ 22.966667175293"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-20 00:00:00 TSLA 1000 @ 19.8886661529541"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-23 00:00:00 TSLA -1000 @ 21.7220001220703"
## [1] "2018-12-12 00:00:00 TSLA 1000 @ 24.4400005340576"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-29 00:00:00 TSLA -1000 @ 15.7180004119873"
## [1] "2019-09-04 00:00:00 TSLA 1000 @ 14.7119998931885"
## [1] "2019-09-26 00:00:00 TSLA -1000 @ 16.1706676483154"
## [1] "2019-09-30 00:00:00 TSLA 1000 @ 16.0580005645752"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-18 00:00:00 TSLA -1000 @ 57.2266654968262"
## [1] "2020-02-19 00:00:00 TSLA 1000 @ 61.1613311767578"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-01 00:00:00 TSLA 1000 @ 32.1040000915527"
## [1] "2020-04-03 00:00:00 TSLA -1000 @ 32.0006675720215"
## [1] "2020-04-07 00:00:00 TSLA 1000 @ 36.3633346557617"
## [1] "2020-05-14 00:00:00 TSLA -1000 @ 53.5553321838379"
## [1] "2020-06-04 00:00:00 TSLA 1000 @ 57.6253318786621"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-24 00:00:00 TSLA -1000 @ 64.0566635131836"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-19 00:00:00 TSLA -1000 @ 143.610000610352"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-17 00:00:00 TSLA -1000 @ 218.633331298828"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-16 00:00:00 TSLA 1000 @ 225.626663208008"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-30 00:00:00 TSLA -1000 @ 236.479995727539"
## [1] "2021-05-28 00:00:00 TSLA 1000 @ 208.406661987305"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-11 00:00:00 TSLA -1000 @ 354.503326416016"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-11 00:00:00 TSLA 1000 @ 286.666656494141"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-03 00:00:00 TSLA 1000 @ 279.763336181641"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-06-21 00:00:00 TSLA -1000 @ 237.036666870117"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-19 00:00:00 TSLA -1000 @ 296.666656494141"
## [1] "2022-09-15 00:00:00 TSLA 1000 @ 303.75"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-27 00:00:00 TSLA 1000 @ 225.089996337891"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-24 00:00:00 TSLA -1000 @ 196.880004882812"
## [1] "2023-03-30 00:00:00 TSLA 1000 @ 195.279998779297"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 16/27: nFast=8, nSlow=30, nSig=9
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-14 00:00:00 TSLA -1000 @ 22.9333324432373"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-13 00:00:00 TSLA 1000 @ 23.8926677703857"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-27 00:00:00 TSLA 1000 @ 34.2906684875488"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-23 00:00:00 TSLA -1000 @ 100.87133026123"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-22 00:00:00 TSLA 1000 @ 141.410003662109"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-26 00:00:00 TSLA -1000 @ 206.236663818359"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-30 00:00:00 TSLA 1000 @ 243.636672973633"
## [1] "2021-09-15 00:00:00 TSLA -1000 @ 251.943328857422"
## [1] "2021-09-16 00:00:00 TSLA 1000 @ 252.330001831055"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-11 00:00:00 TSLA -1000 @ 354.799987792969"
## [1] "2022-02-09 00:00:00 TSLA 1000 @ 310.666656494141"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-08 00:00:00 TSLA -1000 @ 341.829986572266"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 17/27: nFast=12, nSlow=30, nSig=9
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-17 00:00:00 TSLA -1000 @ 18.9693336486816"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-21 00:00:00 TSLA -1000 @ 22.5459995269775"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-16 00:00:00 TSLA -1000 @ 18.2240009307861"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-08 00:00:00 TSLA 1000 @ 16.3226661682129"
## [1] "2019-05-13 00:00:00 TSLA -1000 @ 15.1339998245239"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-04 00:00:00 TSLA 1000 @ 14.7119998931885"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-18 00:00:00 TSLA -1000 @ 57.2266654968262"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-31 00:00:00 TSLA 1000 @ 34.9333343505859"
## [1] "2020-05-14 00:00:00 TSLA -1000 @ 53.5553321838379"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-17 00:00:00 TSLA -1000 @ 218.633331298828"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-16 00:00:00 TSLA 1000 @ 225.626663208008"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-12 00:00:00 TSLA -1000 @ 228.566665649414"
## [1] "2021-07-13 00:00:00 TSLA 1000 @ 222.846664428711"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-12 00:00:00 TSLA -1000 @ 368.739990234375"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-10 00:00:00 TSLA 1000 @ 301.516662597656"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-12 00:00:00 TSLA -1000 @ 300.029998779297"
## [1] "2022-08-16 00:00:00 TSLA 1000 @ 306.563323974609"
## [1] "2022-08-19 00:00:00 TSLA -1000 @ 296.666656494141"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-27 00:00:00 TSLA 1000 @ 225.089996337891"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-23 00:00:00 TSLA -1000 @ 202.070007324219"
## [1] "2023-03-28 00:00:00 TSLA 1000 @ 189.190002441406"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 18/27: nFast=16, nSlow=30, nSig=9
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-11 00:00:00 TSLA 1000 @ 20.0620002746582"
## [1] "2018-05-18 00:00:00 TSLA -1000 @ 18.4546661376953"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-06-28 00:00:00 TSLA -1000 @ 23.3286666870117"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-20 00:00:00 TSLA 1000 @ 19.8886661529541"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-23 00:00:00 TSLA -1000 @ 21.7220001220703"
## [1] "2018-12-12 00:00:00 TSLA 1000 @ 24.4400005340576"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-11 00:00:00 TSLA 1000 @ 23.1506671905518"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-29 00:00:00 TSLA -1000 @ 15.7180004119873"
## [1] "2019-09-05 00:00:00 TSLA 1000 @ 15.3053331375122"
## [1] "2019-09-26 00:00:00 TSLA -1000 @ 16.1706676483154"
## [1] "2019-09-30 00:00:00 TSLA 1000 @ 16.0580005645752"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-07 00:00:00 TSLA 1000 @ 36.3633346557617"
## [1] "2020-05-15 00:00:00 TSLA -1000 @ 53.2779998779297"
## [1] "2020-06-04 00:00:00 TSLA 1000 @ 57.6253318786621"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-24 00:00:00 TSLA -1000 @ 64.0566635131836"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-19 00:00:00 TSLA -1000 @ 143.610000610352"
## [1] "2020-11-19 00:00:00 TSLA 1000 @ 166.42333984375"
## [1] "2020-12-23 00:00:00 TSLA -1000 @ 215.32666015625"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-22 00:00:00 TSLA -1000 @ 282.213317871094"
## [1] "2021-03-17 00:00:00 TSLA 1000 @ 233.936660766602"
## [1] "2021-03-25 00:00:00 TSLA -1000 @ 213.463333129883"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-30 00:00:00 TSLA -1000 @ 236.479995727539"
## [1] "2021-05-28 00:00:00 TSLA 1000 @ 208.406661987305"
## [1] "2021-07-16 00:00:00 TSLA -1000 @ 214.740005493164"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-11 00:00:00 TSLA -1000 @ 354.503326416016"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-17 00:00:00 TSLA 1000 @ 292.116668701172"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-03 00:00:00 TSLA 1000 @ 279.763336181641"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-06-21 00:00:00 TSLA -1000 @ 237.036666870117"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-22 00:00:00 TSLA -1000 @ 289.913330078125"
## [1] "2022-09-15 00:00:00 TSLA 1000 @ 303.75"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-28 00:00:00 TSLA 1000 @ 228.520004272461"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-27 00:00:00 TSLA -1000 @ 207.630004882812"
## [1] "2023-03-31 00:00:00 TSLA 1000 @ 207.460006713867"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 19/27: nFast=8, nSlow=22, nSig=11
## 策略环境已重置
## [1] "2018-02-23 00:00:00 TSLA 1000 @ 23.4699993133545"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-27 00:00:00 TSLA 1000 @ 19.6053333282471"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-14 00:00:00 TSLA -1000 @ 22.9333324432373"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-10 00:00:00 TSLA -1000 @ 24.3433322906494"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-04 00:00:00 TSLA 1000 @ 20.8593330383301"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-18 00:00:00 TSLA -1000 @ 23.3326663970947"
## [1] "2019-12-13 00:00:00 TSLA 1000 @ 23.8926677703857"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-27 00:00:00 TSLA 1000 @ 34.2906684875488"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-23 00:00:00 TSLA -1000 @ 100.87133026123"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-22 00:00:00 TSLA 1000 @ 141.410003662109"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-15 00:00:00 TSLA -1000 @ 251.943328857422"
## [1] "2021-09-16 00:00:00 TSLA 1000 @ 252.330001831055"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-11 00:00:00 TSLA -1000 @ 354.799987792969"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-08 00:00:00 TSLA 1000 @ 307.333343505859"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-08 00:00:00 TSLA -1000 @ 341.829986572266"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-25 00:00:00 TSLA 1000 @ 222.419998168945"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-21 00:00:00 TSLA -1000 @ 197.369995117188"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 20/27: nFast=12, nSlow=22, nSig=11
## 策略环境已重置
## [1] "2018-02-23 00:00:00 TSLA 1000 @ 23.4699993133545"
## [1] "2018-03-05 00:00:00 TSLA -1000 @ 22.2233333587646"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-17 00:00:00 TSLA -1000 @ 18.9693336486816"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-20 00:00:00 TSLA -1000 @ 23.1660003662109"
## [1] "2018-12-13 00:00:00 TSLA 1000 @ 25.1193332672119"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-23 00:00:00 TSLA -1000 @ 19.1726665496826"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-16 00:00:00 TSLA -1000 @ 18.2240009307861"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-08 00:00:00 TSLA 1000 @ 16.3226661682129"
## [1] "2019-05-13 00:00:00 TSLA -1000 @ 15.1339998245239"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-01-30 00:00:00 TSLA -1000 @ 42.7206687927246"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-14 00:00:00 TSLA -1000 @ 53.335334777832"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-31 00:00:00 TSLA 1000 @ 34.9333343505859"
## [1] "2020-05-07 00:00:00 TSLA -1000 @ 52.0026664733887"
## [1] "2020-06-04 00:00:00 TSLA 1000 @ 57.6253318786621"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-09 00:00:00 TSLA 1000 @ 140.419998168945"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-16 00:00:00 TSLA -1000 @ 207.589996337891"
## [1] "2021-01-07 00:00:00 TSLA 1000 @ 272.013336181641"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-15 00:00:00 TSLA 1000 @ 235.979995727539"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-12 00:00:00 TSLA -1000 @ 228.566665649414"
## [1] "2021-07-13 00:00:00 TSLA 1000 @ 222.846664428711"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-10 00:00:00 TSLA 1000 @ 301.516662597656"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-21 00:00:00 TSLA -1000 @ 237.036666870117"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-12 00:00:00 TSLA -1000 @ 300.029998779297"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-26 00:00:00 TSLA -1000 @ 276.010009765625"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-27 00:00:00 TSLA 1000 @ 191.809997558594"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 21/27: nFast=16, nSlow=22, nSig=11
## 策略环境已重置
## [1] "2018-02-26 00:00:00 TSLA 1000 @ 23.8279991149902"
## [1] "2018-03-06 00:00:00 TSLA -1000 @ 21.8799991607666"
## [1] "2018-04-11 00:00:00 TSLA 1000 @ 20.0620002746582"
## [1] "2018-05-18 00:00:00 TSLA -1000 @ 18.4546661376953"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-06-28 00:00:00 TSLA -1000 @ 23.3286666870117"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-20 00:00:00 TSLA 1000 @ 19.8886661529541"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-23 00:00:00 TSLA -1000 @ 21.7220001220703"
## [1] "2018-12-14 00:00:00 TSLA 1000 @ 24.3806667327881"
## [1] "2018-12-17 00:00:00 TSLA -1000 @ 23.2280006408691"
## [1] "2019-01-11 00:00:00 TSLA 1000 @ 23.1506671905518"
## [1] "2019-01-23 00:00:00 TSLA -1000 @ 19.1726665496826"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-29 00:00:00 TSLA -1000 @ 15.7180004119873"
## [1] "2019-09-04 00:00:00 TSLA 1000 @ 14.7119998931885"
## [1] "2019-09-26 00:00:00 TSLA -1000 @ 16.1706676483154"
## [1] "2019-09-30 00:00:00 TSLA 1000 @ 16.0580005645752"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-18 00:00:00 TSLA -1000 @ 57.2266654968262"
## [1] "2020-02-19 00:00:00 TSLA 1000 @ 61.1613311767578"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-01 00:00:00 TSLA 1000 @ 32.1040000915527"
## [1] "2020-04-03 00:00:00 TSLA -1000 @ 32.0006675720215"
## [1] "2020-04-06 00:00:00 TSLA 1000 @ 34.4160003662109"
## [1] "2020-05-14 00:00:00 TSLA -1000 @ 53.5553321838379"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-24 00:00:00 TSLA -1000 @ 64.0566635131836"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-17 00:00:00 TSLA -1000 @ 218.633331298828"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-07 00:00:00 TSLA 1000 @ 272.013336181641"
## [1] "2021-01-22 00:00:00 TSLA -1000 @ 282.213317871094"
## [1] "2021-03-16 00:00:00 TSLA 1000 @ 225.626663208008"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-30 00:00:00 TSLA -1000 @ 236.479995727539"
## [1] "2021-05-28 00:00:00 TSLA 1000 @ 208.406661987305"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-11 00:00:00 TSLA -1000 @ 354.503326416016"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-03 00:00:00 TSLA 1000 @ 279.763336181641"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-08-19 00:00:00 TSLA -1000 @ 296.666656494141"
## [1] "2022-09-15 00:00:00 TSLA 1000 @ 303.75"
## [1] "2022-09-26 00:00:00 TSLA -1000 @ 276.010009765625"
## [1] "2022-10-27 00:00:00 TSLA 1000 @ 225.089996337891"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-24 00:00:00 TSLA -1000 @ 196.880004882812"
## [1] "2023-03-31 00:00:00 TSLA 1000 @ 207.460006713867"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 22/27: nFast=8, nSlow=26, nSig=11
## 策略环境已重置
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-04-26 00:00:00 TSLA -1000 @ 19.0319995880127"
## [1] "2018-04-27 00:00:00 TSLA 1000 @ 19.6053333282471"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-17 00:00:00 TSLA -1000 @ 20.3666667938232"
## [1] "2018-09-17 00:00:00 TSLA 1000 @ 19.6560001373291"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-14 00:00:00 TSLA -1000 @ 22.9333324432373"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-10 00:00:00 TSLA -1000 @ 24.3433322906494"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-16 00:00:00 TSLA 1000 @ 25.4333324432373"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-27 00:00:00 TSLA 1000 @ 34.2906684875488"
## [1] "2020-05-05 00:00:00 TSLA -1000 @ 51.2140007019043"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-23 00:00:00 TSLA -1000 @ 100.87133026123"
## [1] "2020-08-17 00:00:00 TSLA 1000 @ 122.375999450684"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-14 00:00:00 TSLA -1000 @ 213.276672363281"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-20 00:00:00 TSLA -1000 @ 283.483337402344"
## [1] "2021-03-12 00:00:00 TSLA 1000 @ 231.24333190918"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-26 00:00:00 TSLA 1000 @ 206.376663208008"
## [1] "2021-07-09 00:00:00 TSLA -1000 @ 218.983337402344"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-11 00:00:00 TSLA -1000 @ 354.799987792969"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-09 00:00:00 TSLA 1000 @ 310.666656494141"
## [1] "2022-02-15 00:00:00 TSLA -1000 @ 307.476654052734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-10 00:00:00 TSLA -1000 @ 294.356658935547"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-23 00:00:00 TSLA 1000 @ 192.220001220703"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 23/27: nFast=12, nSlow=26, nSig=11
## 策略环境已重置
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-10 00:00:00 TSLA 1000 @ 20.3133335113525"
## [1] "2018-05-17 00:00:00 TSLA -1000 @ 18.9693336486816"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-06-27 00:00:00 TSLA -1000 @ 22.966667175293"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-20 00:00:00 TSLA 1000 @ 19.8886661529541"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-21 00:00:00 TSLA -1000 @ 22.5459995269775"
## [1] "2018-12-12 00:00:00 TSLA 1000 @ 24.4400005340576"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-10 00:00:00 TSLA 1000 @ 22.9979991912842"
## [1] "2019-01-23 00:00:00 TSLA -1000 @ 19.1726665496826"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-16 00:00:00 TSLA -1000 @ 18.2240009307861"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-04 00:00:00 TSLA 1000 @ 14.7119998931885"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-18 00:00:00 TSLA -1000 @ 57.2266654968262"
## [1] "2020-02-19 00:00:00 TSLA 1000 @ 61.1613311767578"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-01 00:00:00 TSLA 1000 @ 32.1040000915527"
## [1] "2020-05-14 00:00:00 TSLA -1000 @ 53.5553321838379"
## [1] "2020-06-04 00:00:00 TSLA 1000 @ 57.6253318786621"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-24 00:00:00 TSLA -1000 @ 64.0566635131836"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-17 00:00:00 TSLA -1000 @ 218.633331298828"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-16 00:00:00 TSLA 1000 @ 225.626663208008"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-30 00:00:00 TSLA -1000 @ 236.479995727539"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-11 00:00:00 TSLA -1000 @ 354.503326416016"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-10 00:00:00 TSLA 1000 @ 301.516662597656"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-06-21 00:00:00 TSLA -1000 @ 237.036666870117"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-12 00:00:00 TSLA -1000 @ 300.029998779297"
## [1] "2022-08-16 00:00:00 TSLA 1000 @ 306.563323974609"
## [1] "2022-08-19 00:00:00 TSLA -1000 @ 296.666656494141"
## [1] "2022-09-15 00:00:00 TSLA 1000 @ 303.75"
## [1] "2022-09-26 00:00:00 TSLA -1000 @ 276.010009765625"
## [1] "2022-10-27 00:00:00 TSLA 1000 @ 225.089996337891"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-23 00:00:00 TSLA -1000 @ 202.070007324219"
## [1] "2023-03-30 00:00:00 TSLA 1000 @ 195.279998779297"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 24/27: nFast=16, nSlow=26, nSig=11
## 策略环境已重置
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-11 00:00:00 TSLA 1000 @ 20.0620002746582"
## [1] "2018-05-18 00:00:00 TSLA -1000 @ 18.4546661376953"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-07-02 00:00:00 TSLA -1000 @ 22.3379993438721"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-20 00:00:00 TSLA 1000 @ 19.8886661529541"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-23 00:00:00 TSLA -1000 @ 21.7220001220703"
## [1] "2018-12-14 00:00:00 TSLA 1000 @ 24.3806667327881"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-11 00:00:00 TSLA 1000 @ 23.1506671905518"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-29 00:00:00 TSLA -1000 @ 15.7180004119873"
## [1] "2019-09-06 00:00:00 TSLA 1000 @ 15.1633329391479"
## [1] "2019-09-26 00:00:00 TSLA -1000 @ 16.1706676483154"
## [1] "2019-09-27 00:00:00 TSLA 1000 @ 16.1420001983643"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-07 00:00:00 TSLA 1000 @ 36.3633346557617"
## [1] "2020-05-15 00:00:00 TSLA -1000 @ 53.2779998779297"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-24 00:00:00 TSLA -1000 @ 64.0566635131836"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-27 00:00:00 TSLA -1000 @ 102.639999389648"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-19 00:00:00 TSLA -1000 @ 143.610000610352"
## [1] "2020-11-19 00:00:00 TSLA 1000 @ 166.42333984375"
## [1] "2020-12-23 00:00:00 TSLA -1000 @ 215.32666015625"
## [1] "2021-01-07 00:00:00 TSLA 1000 @ 272.013336181641"
## [1] "2021-01-22 00:00:00 TSLA -1000 @ 282.213317871094"
## [1] "2021-03-17 00:00:00 TSLA 1000 @ 233.936660766602"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-30 00:00:00 TSLA -1000 @ 236.479995727539"
## [1] "2021-05-28 00:00:00 TSLA 1000 @ 208.406661987305"
## [1] "2021-07-16 00:00:00 TSLA -1000 @ 214.740005493164"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-11 00:00:00 TSLA -1000 @ 354.503326416016"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-17 00:00:00 TSLA 1000 @ 292.116668701172"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-03 00:00:00 TSLA 1000 @ 279.763336181641"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-08-22 00:00:00 TSLA -1000 @ 289.913330078125"
## [1] "2022-09-16 00:00:00 TSLA 1000 @ 303.350006103516"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-28 00:00:00 TSLA 1000 @ 228.520004272461"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-27 00:00:00 TSLA -1000 @ 207.630004882812"
## [1] "2023-04-03 00:00:00 TSLA 1000 @ 194.770004272461"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-10 00:00:00 TSLA 1000 @ 168.539993286133"
## 测试参数组合 25/27: nFast=8, nSlow=30, nSig=11
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-09 00:00:00 TSLA 1000 @ 19.3106670379639"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-26 00:00:00 TSLA -1000 @ 22.7999992370605"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-18 00:00:00 TSLA 1000 @ 18.9973335266113"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-18 00:00:00 TSLA 1000 @ 17.5939998626709"
## [1] "2018-11-15 00:00:00 TSLA -1000 @ 23.2293338775635"
## [1] "2018-11-19 00:00:00 TSLA 1000 @ 23.5646667480469"
## [1] "2018-11-20 00:00:00 TSLA -1000 @ 23.1660003662109"
## [1] "2018-12-07 00:00:00 TSLA 1000 @ 23.8646678924561"
## [1] "2018-12-10 00:00:00 TSLA -1000 @ 24.3433322906494"
## [1] "2018-12-11 00:00:00 TSLA 1000 @ 24.4506664276123"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-09 00:00:00 TSLA 1000 @ 22.5686664581299"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-05 00:00:00 TSLA 1000 @ 21.4233322143555"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-15 00:00:00 TSLA 1000 @ 18.3619995117188"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-15 00:00:00 TSLA -1000 @ 17.7586669921875"
## [1] "2019-04-17 00:00:00 TSLA 1000 @ 18.0820007324219"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-07 00:00:00 TSLA 1000 @ 16.470666885376"
## [1] "2019-05-13 00:00:00 TSLA -1000 @ 15.1339998245239"
## [1] "2019-06-06 00:00:00 TSLA 1000 @ 13.7299995422363"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-09-03 00:00:00 TSLA 1000 @ 15.0006666183472"
## [1] "2019-09-25 00:00:00 TSLA -1000 @ 15.2466669082642"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-19 00:00:00 TSLA -1000 @ 23.9680004119873"
## [1] "2019-12-16 00:00:00 TSLA 1000 @ 25.4333324432373"
## [1] "2020-01-29 00:00:00 TSLA -1000 @ 38.732666015625"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-13 00:00:00 TSLA -1000 @ 53.5999984741211"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-03-30 00:00:00 TSLA 1000 @ 33.4753341674805"
## [1] "2020-05-06 00:00:00 TSLA -1000 @ 52.1720008850098"
## [1] "2020-05-11 00:00:00 TSLA 1000 @ 54.0859985351562"
## [1] "2020-05-13 00:00:00 TSLA -1000 @ 52.7306671142578"
## [1] "2020-06-03 00:00:00 TSLA 1000 @ 58.8639984130859"
## [1] "2020-06-23 00:00:00 TSLA -1000 @ 66.7853317260742"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-10-14 00:00:00 TSLA 1000 @ 153.766662597656"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-09 00:00:00 TSLA 1000 @ 140.419998168945"
## [1] "2020-11-11 00:00:00 TSLA -1000 @ 139.043334960938"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-16 00:00:00 TSLA -1000 @ 207.589996337891"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-21 00:00:00 TSLA -1000 @ 281.663330078125"
## [1] "2021-03-15 00:00:00 TSLA 1000 @ 235.979995727539"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-29 00:00:00 TSLA -1000 @ 225.66667175293"
## [1] "2021-05-27 00:00:00 TSLA 1000 @ 210.283340454102"
## [1] "2021-07-09 00:00:00 TSLA -1000 @ 218.983337402344"
## [1] "2021-07-13 00:00:00 TSLA 1000 @ 222.846664428711"
## [1] "2021-07-15 00:00:00 TSLA -1000 @ 216.866668701172"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-06 00:00:00 TSLA -1000 @ 260.916656494141"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-10 00:00:00 TSLA -1000 @ 355.983337402344"
## [1] "2021-12-27 00:00:00 TSLA 1000 @ 364.646667480469"
## [1] "2022-01-11 00:00:00 TSLA -1000 @ 354.799987792969"
## [1] "2022-01-13 00:00:00 TSLA 1000 @ 343.853332519531"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-09 00:00:00 TSLA 1000 @ 310.666656494141"
## [1] "2022-02-14 00:00:00 TSLA -1000 @ 291.920013427734"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-02 00:00:00 TSLA 1000 @ 293.296661376953"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-11 00:00:00 TSLA -1000 @ 325.309997558594"
## [1] "2022-05-31 00:00:00 TSLA 1000 @ 252.753326416016"
## [1] "2022-06-15 00:00:00 TSLA -1000 @ 233"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-11 00:00:00 TSLA -1000 @ 286.630004882812"
## [1] "2022-08-16 00:00:00 TSLA 1000 @ 306.563323974609"
## [1] "2022-08-18 00:00:00 TSLA -1000 @ 302.869995117188"
## [1] "2022-09-13 00:00:00 TSLA 1000 @ 292.130004882812"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-26 00:00:00 TSLA 1000 @ 224.639999389648"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-11 00:00:00 TSLA 1000 @ 123.220001220703"
## [1] "2023-02-22 00:00:00 TSLA -1000 @ 200.860000610352"
## [1] "2023-03-24 00:00:00 TSLA 1000 @ 190.410003662109"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-08 00:00:00 TSLA 1000 @ 171.789993286133"
## 测试参数组合 26/27: nFast=12, nSlow=30, nSig=11
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-10 00:00:00 TSLA 1000 @ 20.3133335113525"
## [1] "2018-05-18 00:00:00 TSLA -1000 @ 18.4546661376953"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-06-28 00:00:00 TSLA -1000 @ 23.3286666870117"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-20 00:00:00 TSLA 1000 @ 19.8886661529541"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-23 00:00:00 TSLA -1000 @ 21.7220001220703"
## [1] "2018-12-12 00:00:00 TSLA 1000 @ 24.4400005340576"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-11 00:00:00 TSLA 1000 @ 23.1506671905518"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-24 00:00:00 TSLA -1000 @ 17.2439994812012"
## [1] "2019-06-07 00:00:00 TSLA 1000 @ 13.6333332061768"
## [1] "2019-07-29 00:00:00 TSLA -1000 @ 15.7180004119873"
## [1] "2019-09-04 00:00:00 TSLA 1000 @ 14.7119998931885"
## [1] "2019-09-26 00:00:00 TSLA -1000 @ 16.1706676483154"
## [1] "2019-09-30 00:00:00 TSLA 1000 @ 16.0580005645752"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-21 00:00:00 TSLA -1000 @ 23.6553325653076"
## [1] "2019-12-17 00:00:00 TSLA 1000 @ 25.2660007476807"
## [1] "2020-02-18 00:00:00 TSLA -1000 @ 57.2266654968262"
## [1] "2020-02-19 00:00:00 TSLA 1000 @ 61.1613311767578"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-01 00:00:00 TSLA 1000 @ 32.1040000915527"
## [1] "2020-04-03 00:00:00 TSLA -1000 @ 32.0006675720215"
## [1] "2020-04-07 00:00:00 TSLA 1000 @ 36.3633346557617"
## [1] "2020-05-14 00:00:00 TSLA -1000 @ 53.5553321838379"
## [1] "2020-06-04 00:00:00 TSLA 1000 @ 57.6253318786621"
## [1] "2020-06-05 00:00:00 TSLA -1000 @ 59.0439987182617"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-24 00:00:00 TSLA -1000 @ 64.0566635131836"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-24 00:00:00 TSLA -1000 @ 94.466667175293"
## [1] "2020-08-18 00:00:00 TSLA 1000 @ 125.805999755859"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-10-15 00:00:00 TSLA 1000 @ 149.626663208008"
## [1] "2020-10-19 00:00:00 TSLA -1000 @ 143.610000610352"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-17 00:00:00 TSLA -1000 @ 218.633331298828"
## [1] "2020-12-21 00:00:00 TSLA 1000 @ 216.619995117188"
## [1] "2020-12-22 00:00:00 TSLA -1000 @ 213.446670532227"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-22 00:00:00 TSLA -1000 @ 282.213317871094"
## [1] "2021-03-16 00:00:00 TSLA 1000 @ 225.626663208008"
## [1] "2021-03-29 00:00:00 TSLA -1000 @ 203.763336181641"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-30 00:00:00 TSLA -1000 @ 236.479995727539"
## [1] "2021-05-28 00:00:00 TSLA 1000 @ 208.406661987305"
## [1] "2021-07-16 00:00:00 TSLA -1000 @ 214.740005493164"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-07 00:00:00 TSLA -1000 @ 264.536682128906"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-11 00:00:00 TSLA -1000 @ 354.503326416016"
## [1] "2021-12-28 00:00:00 TSLA 1000 @ 362.823333740234"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-16 00:00:00 TSLA 1000 @ 307.796661376953"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-03 00:00:00 TSLA 1000 @ 279.763336181641"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-12 00:00:00 TSLA -1000 @ 328.983337402344"
## [1] "2022-06-01 00:00:00 TSLA 1000 @ 246.789993286133"
## [1] "2022-06-21 00:00:00 TSLA -1000 @ 237.036666870117"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-22 00:00:00 TSLA -1000 @ 289.913330078125"
## [1] "2022-09-15 00:00:00 TSLA 1000 @ 303.75"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-27 00:00:00 TSLA 1000 @ 225.089996337891"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-29 00:00:00 TSLA 1000 @ 180.830001831055"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-12 00:00:00 TSLA 1000 @ 123.559997558594"
## [1] "2023-02-24 00:00:00 TSLA -1000 @ 196.880004882812"
## [1] "2023-03-30 00:00:00 TSLA 1000 @ 195.279998779297"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-09 00:00:00 TSLA 1000 @ 169.149993896484"
## 测试参数组合 27/27: nFast=16, nSlow=30, nSig=11
## 策略环境已重置
## [1] "2018-03-13 00:00:00 TSLA 1000 @ 22.7893333435059"
## [1] "2018-03-16 00:00:00 TSLA -1000 @ 21.4233322143555"
## [1] "2018-04-11 00:00:00 TSLA 1000 @ 20.0620002746582"
## [1] "2018-05-21 00:00:00 TSLA -1000 @ 18.9659996032715"
## [1] "2018-06-01 00:00:00 TSLA 1000 @ 19.4546661376953"
## [1] "2018-07-02 00:00:00 TSLA -1000 @ 22.3379993438721"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-20 00:00:00 TSLA -1000 @ 20.5626678466797"
## [1] "2018-09-21 00:00:00 TSLA 1000 @ 19.9400005340576"
## [1] "2018-10-08 00:00:00 TSLA -1000 @ 16.7040004730225"
## [1] "2018-10-24 00:00:00 TSLA 1000 @ 19.2333335876465"
## [1] "2018-11-26 00:00:00 TSLA -1000 @ 23.0666675567627"
## [1] "2018-12-12 00:00:00 TSLA 1000 @ 24.4400005340576"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-11 00:00:00 TSLA 1000 @ 23.1506671905518"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-06 00:00:00 TSLA 1000 @ 21.1480007171631"
## [1] "2019-02-22 00:00:00 TSLA -1000 @ 19.6473331451416"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-29 00:00:00 TSLA 1000 @ 18.6573333740234"
## [1] "2019-04-25 00:00:00 TSLA -1000 @ 16.5086669921875"
## [1] "2019-06-10 00:00:00 TSLA 1000 @ 14.1920003890991"
## [1] "2019-07-29 00:00:00 TSLA -1000 @ 15.7180004119873"
## [1] "2019-09-06 00:00:00 TSLA 1000 @ 15.1633329391479"
## [1] "2019-09-26 00:00:00 TSLA -1000 @ 16.1706676483154"
## [1] "2019-09-27 00:00:00 TSLA 1000 @ 16.1420001983643"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-11 00:00:00 TSLA 1000 @ 16.5259990692139"
## [1] "2019-11-22 00:00:00 TSLA -1000 @ 22.2026672363281"
## [1] "2019-12-18 00:00:00 TSLA 1000 @ 26.2099990844727"
## [1] "2020-02-25 00:00:00 TSLA -1000 @ 53.3273315429688"
## [1] "2020-04-08 00:00:00 TSLA 1000 @ 36.5893325805664"
## [1] "2020-05-18 00:00:00 TSLA -1000 @ 54.242000579834"
## [1] "2020-06-09 00:00:00 TSLA 1000 @ 62.7113342285156"
## [1] "2020-06-25 00:00:00 TSLA -1000 @ 65.7320022583008"
## [1] "2020-07-02 00:00:00 TSLA 1000 @ 80.5773315429688"
## [1] "2020-07-27 00:00:00 TSLA -1000 @ 102.639999389648"
## [1] "2020-08-19 00:00:00 TSLA 1000 @ 125.235336303711"
## [1] "2020-09-08 00:00:00 TSLA -1000 @ 110.069999694824"
## [1] "2020-11-19 00:00:00 TSLA 1000 @ 166.42333984375"
## [1] "2020-12-23 00:00:00 TSLA -1000 @ 215.32666015625"
## [1] "2021-01-06 00:00:00 TSLA 1000 @ 251.99333190918"
## [1] "2021-01-22 00:00:00 TSLA -1000 @ 282.213317871094"
## [1] "2021-03-18 00:00:00 TSLA 1000 @ 217.720001220703"
## [1] "2021-03-22 00:00:00 TSLA -1000 @ 223.33332824707"
## [1] "2021-03-23 00:00:00 TSLA 1000 @ 220.720001220703"
## [1] "2021-03-25 00:00:00 TSLA -1000 @ 213.463333129883"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-05-03 00:00:00 TSLA -1000 @ 228.300003051758"
## [1] "2021-05-28 00:00:00 TSLA 1000 @ 208.406661987305"
## [1] "2021-07-19 00:00:00 TSLA -1000 @ 215.406661987305"
## [1] "2021-08-02 00:00:00 TSLA 1000 @ 236.556671142578"
## [1] "2021-08-18 00:00:00 TSLA -1000 @ 229.663330078125"
## [1] "2021-08-31 00:00:00 TSLA 1000 @ 245.240005493164"
## [1] "2021-09-21 00:00:00 TSLA -1000 @ 246.460006713867"
## [1] "2021-09-28 00:00:00 TSLA 1000 @ 259.186676025391"
## [1] "2021-10-12 00:00:00 TSLA -1000 @ 268.573333740234"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-12 00:00:00 TSLA -1000 @ 344.473327636719"
## [1] "2021-12-29 00:00:00 TSLA 1000 @ 362.063323974609"
## [1] "2022-01-14 00:00:00 TSLA -1000 @ 349.869995117188"
## [1] "2022-02-17 00:00:00 TSLA 1000 @ 292.116668701172"
## [1] "2022-02-22 00:00:00 TSLA -1000 @ 273.843322753906"
## [1] "2022-03-03 00:00:00 TSLA 1000 @ 279.763336181641"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-13 00:00:00 TSLA -1000 @ 340.790008544922"
## [1] "2022-06-02 00:00:00 TSLA 1000 @ 258.333343505859"
## [1] "2022-06-21 00:00:00 TSLA -1000 @ 237.036666870117"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-22 00:00:00 TSLA -1000 @ 289.913330078125"
## [1] "2022-09-16 00:00:00 TSLA 1000 @ 303.350006103516"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-28 00:00:00 TSLA 1000 @ 228.520004272461"
## [1] "2022-11-09 00:00:00 TSLA -1000 @ 177.589996337891"
## [1] "2022-11-30 00:00:00 TSLA 1000 @ 194.699996948242"
## [1] "2022-12-14 00:00:00 TSLA -1000 @ 156.800003051758"
## [1] "2023-01-13 00:00:00 TSLA 1000 @ 122.400001525879"
## [1] "2023-02-28 00:00:00 TSLA -1000 @ 205.710006713867"
## [1] "2023-04-03 00:00:00 TSLA 1000 @ 194.770004272461"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-10 00:00:00 TSLA 1000 @ 168.539993286133"
# 找出最佳参数组合(基于夏普比率)
best_params <- results[which.max(results$SharpeRatio), ]
print("最佳参数组合:")
## [1] "最佳参数组合:"
print(best_params)
## nFast nSlow nSig SharpeRatio Return MaxDrawdown TradeCount
## 1 8 22 7 0.7357213 0.3363681 0.1447274 126
# 可视化参数优化结果
ggplot(results, aes(x = as.factor(nFast),
y = SharpeRatio,
fill = as.factor(nSig))) +
geom_boxplot() +
facet_wrap(~ nSlow) +
labs(title = "MACD参数优化结果(夏普比率)",
x = "快速EMA周期(nFast)",
y = "年化夏普比率",
fill = "信号线周期(nSig)") +
theme_minimal(base_family = "SimHei")

基于最佳参数的回测
根据参数优化结果,我们使用最佳参数组合重新进行回测,并详细分析策略表现:
# 清理历史环境。
reset_strategy_env()
## 策略环境已重置
rm(list = ls(.blotter))
rm(list = ls(.strategy))
# 设置初始参数
initEq.st <- 1000000
portfolio.st <- "MACD_Portfolio"
strategy.st <- "MACD_Strategy"
account.st <- "MACD_Account"
symbols.st <- "TSLA"
# 初始化quantstrat
currency("USD")
## [1] "USD"
stock("TSLA", currency = "USD", multiplier = 1)
## [1] "TSLA"
initPortf(portfolio.st, symbols = symbols.st)
## [1] "MACD_Portfolio"
initAcct(account.st, portfolios = portfolio.st, initEq = initEq.st)
## [1] "MACD_Account"
initOrders(portfolio.st, symbols.st, initDate = initDate)
strategy(strategy.st, store = TRUE)
#
indicator_label <- paste0("MACD_",
best_params$nFast,
"_",
best_params$nSlow,
"_",
best_params$nSig)
# 添加MACD指标,使用最佳参数
add.indicator(strategy.st,
name = "MACD",
arguments = list(x = quote(Cl(mktdata)),
nFast = best_params$nFast,
nSlow = best_params$nSlow,
nSig = best_params$nSig),
label = indicator_label
)
## [1] "MACD_Strategy"
#
macd_col <- paste0("macd.MACD_",
best_params$nFast,
"_",
best_params$nSlow,
"_",
best_params$nSig)
signal_col<- paste0("signal.MACD_",
best_params$nFast,
"_",
best_params$nSlow,
"_",
best_params$nSig)
# 添加相同的交易信号和规则
# 买入信号
add.signal(strategy.st,
name = "sigCrossover",
arguments = list(columns =c(macd_col, signal_col),
relationship = "gte"),
label = "Buy_Signal")
## [1] "MACD_Strategy"
# 卖出信号
add.signal(strategy.st,
name = "sigCrossover",
arguments = list(columns = c(macd_col, signal_col),
relationship = "lte"),
label = "Sell_Signal")
## [1] "MACD_Strategy"
# 添加交易规则
add.rule(strategy.st,
name = "ruleSignal",
arguments = list(sigcol = "Buy_Signal",
sigval = TRUE,
orderqty = 1000,
ordertype = "market",
orderside = "long",
replace = FALSE,
prefer = "Close"),
type = "enter",
label = "Enter_Long")
## [1] "MACD_Strategy"
add.rule(strategy.st,
name = "ruleSignal",
arguments = list(sigcol = "Sell_Signal",
sigval = TRUE,
orderqty = "all",
ordertype = "market",
orderside = "long",
replace = FALSE,
prefer = "Close"),
type = "exit",
label = "Exit_Long")
## [1] "MACD_Strategy"
# 运行回测
applyStrategy(strategy = strategy.st, portfolios = portfolio.st)
## [1] "2018-02-21 00:00:00 TSLA 1000 @ 22.2199993133545"
## [1] "2018-03-02 00:00:00 TSLA -1000 @ 22.3413333892822"
## [1] "2018-03-14 00:00:00 TSLA 1000 @ 21.775333404541"
## [1] "2018-03-15 00:00:00 TSLA -1000 @ 21.7066669464111"
## [1] "2018-04-06 00:00:00 TSLA 1000 @ 19.953332901001"
## [1] "2018-04-25 00:00:00 TSLA -1000 @ 18.71266746521"
## [1] "2018-04-30 00:00:00 TSLA 1000 @ 19.5933322906494"
## [1] "2018-05-16 00:00:00 TSLA -1000 @ 19.0986671447754"
## [1] "2018-05-31 00:00:00 TSLA 1000 @ 18.9820003509521"
## [1] "2018-06-25 00:00:00 TSLA -1000 @ 22.2006664276123"
## [1] "2018-07-20 00:00:00 TSLA 1000 @ 20.9053325653076"
## [1] "2018-07-23 00:00:00 TSLA -1000 @ 20.2133331298828"
## [1] "2018-08-03 00:00:00 TSLA 1000 @ 23.211332321167"
## [1] "2018-08-16 00:00:00 TSLA -1000 @ 22.3633327484131"
## [1] "2018-09-14 00:00:00 TSLA 1000 @ 19.6800003051758"
## [1] "2018-10-01 00:00:00 TSLA -1000 @ 20.7133331298828"
## [1] "2018-10-02 00:00:00 TSLA 1000 @ 20.068000793457"
## [1] "2018-10-05 00:00:00 TSLA -1000 @ 17.4633331298828"
## [1] "2018-10-17 00:00:00 TSLA 1000 @ 18.1186676025391"
## [1] "2018-11-13 00:00:00 TSLA -1000 @ 22.5820007324219"
## [1] "2018-12-06 00:00:00 TSLA 1000 @ 24.2040004730225"
## [1] "2018-12-18 00:00:00 TSLA -1000 @ 22.4686660766602"
## [1] "2019-01-08 00:00:00 TSLA 1000 @ 22.3566665649414"
## [1] "2019-01-22 00:00:00 TSLA -1000 @ 19.92799949646"
## [1] "2019-02-01 00:00:00 TSLA 1000 @ 20.8139991760254"
## [1] "2019-02-21 00:00:00 TSLA -1000 @ 19.4153327941895"
## [1] "2019-02-28 00:00:00 TSLA 1000 @ 21.3253326416016"
## [1] "2019-03-05 00:00:00 TSLA -1000 @ 18.4360008239746"
## [1] "2019-03-14 00:00:00 TSLA 1000 @ 19.3306674957275"
## [1] "2019-03-18 00:00:00 TSLA -1000 @ 17.9659996032715"
## [1] "2019-03-28 00:00:00 TSLA 1000 @ 18.5746669769287"
## [1] "2019-04-12 00:00:00 TSLA -1000 @ 17.8466663360596"
## [1] "2019-04-18 00:00:00 TSLA 1000 @ 18.2173328399658"
## [1] "2019-04-23 00:00:00 TSLA -1000 @ 17.5933322906494"
## [1] "2019-05-06 00:00:00 TSLA 1000 @ 17.0226669311523"
## [1] "2019-05-14 00:00:00 TSLA -1000 @ 15.4873332977295"
## [1] "2019-06-05 00:00:00 TSLA 1000 @ 13.1059999465942"
## [1] "2019-07-26 00:00:00 TSLA -1000 @ 15.2026672363281"
## [1] "2019-08-30 00:00:00 TSLA 1000 @ 15.0406665802002"
## [1] "2019-09-24 00:00:00 TSLA -1000 @ 14.8806667327881"
## [1] "2019-10-02 00:00:00 TSLA 1000 @ 16.208667755127"
## [1] "2019-10-04 00:00:00 TSLA -1000 @ 15.4286670684814"
## [1] "2019-10-10 00:00:00 TSLA 1000 @ 16.3159999847412"
## [1] "2019-10-24 00:00:00 TSLA -1000 @ 19.978666305542"
## [1] "2019-10-25 00:00:00 TSLA 1000 @ 21.8753337860107"
## [1] "2019-11-07 00:00:00 TSLA -1000 @ 22.3693332672119"
## [1] "2019-11-08 00:00:00 TSLA 1000 @ 22.4759998321533"
## [1] "2019-11-14 00:00:00 TSLA -1000 @ 23.2900009155273"
## [1] "2019-12-12 00:00:00 TSLA 1000 @ 23.978666305542"
## [1] "2020-01-02 00:00:00 TSLA -1000 @ 28.6840000152588"
## [1] "2020-01-06 00:00:00 TSLA 1000 @ 30.1026668548584"
## [1] "2020-01-21 00:00:00 TSLA -1000 @ 36.4799995422363"
## [1] "2020-01-22 00:00:00 TSLA 1000 @ 37.9706687927246"
## [1] "2020-01-28 00:00:00 TSLA -1000 @ 37.7933311462402"
## [1] "2020-01-31 00:00:00 TSLA 1000 @ 43.3713340759277"
## [1] "2020-02-12 00:00:00 TSLA -1000 @ 51.1526679992676"
## [1] "2020-02-20 00:00:00 TSLA 1000 @ 59.9606666564941"
## [1] "2020-02-24 00:00:00 TSLA -1000 @ 55.5859985351562"
## [1] "2020-03-26 00:00:00 TSLA 1000 @ 35.2106666564941"
## [1] "2020-05-04 00:00:00 TSLA -1000 @ 50.7459983825684"
## [1] "2020-06-02 00:00:00 TSLA 1000 @ 58.7706680297852"
## [1] "2020-06-22 00:00:00 TSLA -1000 @ 66.2880020141602"
## [1] "2020-07-01 00:00:00 TSLA 1000 @ 74.6419982910156"
## [1] "2020-07-20 00:00:00 TSLA -1000 @ 109.533332824707"
## [1] "2020-07-21 00:00:00 TSLA 1000 @ 104.557334899902"
## [1] "2020-07-22 00:00:00 TSLA -1000 @ 106.155334472656"
## [1] "2020-08-14 00:00:00 TSLA 1000 @ 110.047332763672"
## [1] "2020-09-04 00:00:00 TSLA -1000 @ 139.440002441406"
## [1] "2020-09-17 00:00:00 TSLA 1000 @ 141.143325805664"
## [1] "2020-09-23 00:00:00 TSLA -1000 @ 126.786666870117"
## [1] "2020-10-02 00:00:00 TSLA 1000 @ 138.363327026367"
## [1] "2020-10-05 00:00:00 TSLA -1000 @ 141.893325805664"
## [1] "2020-10-13 00:00:00 TSLA 1000 @ 148.883331298828"
## [1] "2020-10-20 00:00:00 TSLA -1000 @ 140.646667480469"
## [1] "2020-11-06 00:00:00 TSLA 1000 @ 143.316665649414"
## [1] "2020-11-13 00:00:00 TSLA -1000 @ 136.16667175293"
## [1] "2020-11-18 00:00:00 TSLA 1000 @ 162.213333129883"
## [1] "2020-12-11 00:00:00 TSLA -1000 @ 203.330001831055"
## [1] "2021-01-05 00:00:00 TSLA 1000 @ 245.036666870117"
## [1] "2021-01-19 00:00:00 TSLA -1000 @ 281.516662597656"
## [1] "2021-03-11 00:00:00 TSLA 1000 @ 233.199996948242"
## [1] "2021-03-26 00:00:00 TSLA -1000 @ 206.236663818359"
## [1] "2021-04-01 00:00:00 TSLA 1000 @ 220.58332824707"
## [1] "2021-04-28 00:00:00 TSLA -1000 @ 231.466659545898"
## [1] "2021-05-25 00:00:00 TSLA 1000 @ 201.563339233398"
## [1] "2021-07-08 00:00:00 TSLA -1000 @ 217.603332519531"
## [1] "2021-07-30 00:00:00 TSLA 1000 @ 229.066665649414"
## [1] "2021-08-17 00:00:00 TSLA -1000 @ 221.903335571289"
## [1] "2021-08-26 00:00:00 TSLA 1000 @ 233.720001220703"
## [1] "2021-09-14 00:00:00 TSLA -1000 @ 248.163330078125"
## [1] "2021-09-27 00:00:00 TSLA 1000 @ 263.786682128906"
## [1] "2021-10-05 00:00:00 TSLA -1000 @ 260.196655273438"
## [1] "2021-10-08 00:00:00 TSLA 1000 @ 261.829986572266"
## [1] "2021-10-11 00:00:00 TSLA -1000 @ 263.980010986328"
## [1] "2021-10-13 00:00:00 TSLA 1000 @ 270.359985351562"
## [1] "2021-11-09 00:00:00 TSLA -1000 @ 341.166656494141"
## [1] "2021-12-23 00:00:00 TSLA 1000 @ 355.666656494141"
## [1] "2022-01-10 00:00:00 TSLA -1000 @ 352.706665039062"
## [1] "2022-02-07 00:00:00 TSLA 1000 @ 302.446655273438"
## [1] "2022-02-23 00:00:00 TSLA -1000 @ 254.679992675781"
## [1] "2022-03-01 00:00:00 TSLA 1000 @ 288.123321533203"
## [1] "2022-03-15 00:00:00 TSLA -1000 @ 267.296661376953"
## [1] "2022-03-17 00:00:00 TSLA 1000 @ 290.533325195312"
## [1] "2022-04-07 00:00:00 TSLA -1000 @ 352.420013427734"
## [1] "2022-05-27 00:00:00 TSLA 1000 @ 253.210006713867"
## [1] "2022-06-14 00:00:00 TSLA -1000 @ 220.889999389648"
## [1] "2022-06-16 00:00:00 TSLA 1000 @ 213.100006103516"
## [1] "2022-06-17 00:00:00 TSLA -1000 @ 216.759994506836"
## [1] "2022-06-22 00:00:00 TSLA 1000 @ 236.086669921875"
## [1] "2022-08-09 00:00:00 TSLA -1000 @ 283.333343505859"
## [1] "2022-09-12 00:00:00 TSLA 1000 @ 304.420013427734"
## [1] "2022-09-23 00:00:00 TSLA -1000 @ 275.329986572266"
## [1] "2022-10-20 00:00:00 TSLA 1000 @ 207.279998779297"
## [1] "2022-11-08 00:00:00 TSLA -1000 @ 191.300003051758"
## [1] "2022-11-28 00:00:00 TSLA 1000 @ 182.919998168945"
## [1] "2022-12-09 00:00:00 TSLA -1000 @ 179.050003051758"
## [1] "2022-12-12 00:00:00 TSLA 1000 @ 167.820007324219"
## [1] "2022-12-13 00:00:00 TSLA -1000 @ 160.949996948242"
## [1] "2023-01-10 00:00:00 TSLA 1000 @ 118.849998474121"
## [1] "2023-02-14 00:00:00 TSLA -1000 @ 209.25"
## [1] "2023-02-16 00:00:00 TSLA 1000 @ 202.039993286133"
## [1] "2023-02-17 00:00:00 TSLA -1000 @ 208.309997558594"
## [1] "2023-03-22 00:00:00 TSLA 1000 @ 191.149993896484"
## [1] "2023-04-06 00:00:00 TSLA -1000 @ 185.059997558594"
## [1] "2023-05-05 00:00:00 TSLA 1000 @ 170.059997558594"
updatePortf(portfolio.st)
## [1] "MACD_Portfolio"
updateAcct(account.st)
## [1] "MACD_Account"
updateEndEq(account.st)
## [1] "MACD_Account"
# 获取策略收益
port_ret_best <- PortfReturns(account.st)
# 计算评估指标
sharpe_ratio_best <- SharpeRatio.annualized(port_ret_best)
total_return_best <- Return.cumulative(port_ret_best)
max_drawdown_best <- maxDrawdown(port_ret_best)
trade_count_best <- length(index(getTxns(Portfolio = portfolio.st,
Symbol = symbols.st)
)
)
# 计算买入持有策略的收益作为基准
buy_hold_ret <- dailyReturn(Cl(TSLA))
sharpe_ratio_bh <- SharpeRatio.annualized(buy_hold_ret)
total_return_bh <- Return.cumulative(buy_hold_ret)
max_drawdown_bh <- maxDrawdown(buy_hold_ret)
# 输出评估结果
results_df <- data.frame(
Strategy = c("MACD策略", "买入持有"),
年化夏普比率 = c(sharpe_ratio_best, sharpe_ratio_bh),
总收益率 = c(total_return_best, total_return_bh),
最大回撤 = c(max_drawdown_best, max_drawdown_bh),
交易次数 = c(trade_count_best, NA)
)
print("策略评估结果:")
## [1] "策略评估结果:"
print(results_df)
## Strategy 年化夏普比率 总收益率 最大回撤 交易次数
## 1 MACD策略 0.7357213 0.3363681 0.1447274 126
## 2 买入持有 0.7942006 8.5434117 0.7363222 NA
# 可视化策略收益
charts.PerformanceSummary(cbind(port_ret_best, buy_hold_ret),
main = "MACD策略与买入持有策略收益对比",
colorset = bluefocus,
wealth.index = TRUE)

交易信号可视化
为了更直观地理解MACD指标的交易信号,我们将可视化价格走势和MACD指标,并标记买卖点:
# 1. 计算MACD指标
macd_values <- MACD(Cl(TSLA),
nFast = best_params$nFast,
nSlow = best_params$nSlow,
nSig = best_params$nSig)
# 2. 生成交易信号
txns <- getTxns(portfolio.st, "TSLA") # 获取交易记录
signals <- generateSimpleSignalChain(txns, type = "numeric")[-1, ] # 生成信号
# 3. 准备价格数据
price_data <- data.frame(
date = index(TSLA),
close = as.numeric(Cl(TSLA))
)
# 4. 准备MACD指标数据
macd_data <- data.frame(
date = index(macd_values),
macd = as.numeric(macd_values$macd),
signal_line = as.numeric(macd_values$signal), # 避免与交易信号重名
histogram = as.numeric(macd_values$macd - macd_values$signal)
)
# 5. 准备交易信号数据
signal_data <- data.frame(
date = as.Date(index(signals)),
signal_value = as.numeric(signals$Signal)
)
# 6. 数据合并(以价格数据为基准,左连接)
merged_data <- price_data %>%
left_join(macd_data, by = "date") %>%
left_join(signal_data, by = "date") %>%
# 填充缺失的信号值为0(无交易)
mutate(signal_value = ifelse(is.na(signal_value), 0, signal_value))
# 7. 提取买卖点
buy_points <- merged_data %>% filter(signal_value == 1)
sell_points <- merged_data %>% filter(signal_value == -1)
# 8. 价格与交易信号图(修复版)
# 预先计算移动平均线和趋势带(使用rollapply替代rollsd)
merged_data <- merged_data %>%
mutate(
ma20 = zoo::rollmean(close, 20, fill = NA), # 20日移动平均线
ma20_lower = ma20 * 0.98, # 趋势带下轨(±2%)
ma20_upper = ma20 * 1.02, # 趋势带上轨
# 使用rollapply计算滚动标准差
ma20_sd = zoo::rollapply(close, 20, sd, fill = NA),
bb_lower = ma20 - 1.5 * ma20_sd, # 布林带下轨(±1.5σ)
bb_upper = ma20 + 1.5 * ma20_sd, # 布林带上轨
direction = ifelse(histogram >= 0, "1", "-1") # 新增方向列
)
price_plot <- ggplot(merged_data, aes(x = date, y = close)) +
# 价格线
geom_line(color = "#2c3e50", size = 0.5) +
# 移动平均线
geom_line(aes(y = ma20), color = "#e74c3c", size = 1, linetype = "dashed") +
# 固定百分比趋势带
#geom_ribbon(
# aes(ymin = ma20_lower, ymax = ma20_upper),
# fill = "grey", alpha = 0.5
#) +
# 布林带式趋势带
geom_ribbon(
aes(ymin = bb_lower, ymax = bb_upper),
fill = "blue", alpha = 0.2
) +
# 买卖点标记
geom_point(data = buy_points,
aes(y = close),
color = "#27ae60",
size = 1,
shape = 16,
fill = "white",
alpha = 0.9) +
geom_point(data = sell_points,
aes(y = close),
color = "#e74c3c",
size = 1,
shape = 16,
fill = "white",
alpha = 0.9) +
# 标题和坐标轴设置
labs(
title = "TSLA价格走势与MACD交易信号",
subtitle = paste0("参数: Fast=", best_params$nFast,
", Slow=", best_params$nSlow,
", Signal=", best_params$nSig),
y = "收盘价",
x = ""
) +
# 自定义主题
theme_minimal(base_size = 12,
base_family = "SimHei") +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
plot.subtitle = element_text(hjust = 0.5, size = 10, color = "gray50"),
axis.text.x = element_text(angle = 45, hjust = 1),
legend.position = "top",
panel.grid.minor = element_blank()
) +
# 优化坐标轴显示
scale_x_date(
date_breaks = "3 months",
date_labels = "%Y-%m",
expand = c(0, 5)
) +
# 添加图例说明
scale_color_manual(
values = c("价格" = "#2c3e50", "20日均线" = "#e74c3c"),
labels = c("价格", "20日移动平均线")
) +
# 添加参考线和标记
geom_hline(yintercept = mean(merged_data$close, na.rm = TRUE),
color = "gray", linetype = "dashed", size = 0.7) +
annotate("text", x = max(merged_data$date, na.rm = TRUE),
y = mean(merged_data$close, na.rm = TRUE) * 0.97,
label = "平均价格", color = "gray", size = 3.5, hjust = 1)
# 9. MACD指标图(优化方向填充色对比)
macd_plot <- ggplot(merged_data, aes(x = date)) +
geom_line(aes(y = macd, color = "DIF线"), size = 0.5) +
geom_line(aes(y = signal_line, color = "DEA线"), size = 0.5) +
# 优化柱状图填充和边框
geom_bar(aes(y = histogram, fill = direction),
stat = "identity", width = 1.5, alpha = 0.8,
color = ifelse(merged_data$direction == "1", "#1E8449", "#B03A2E"),
size = 0.5) + # 边框粗细
# 优化填充颜色对比
scale_fill_manual(
values = c(
"1" = "#2ECC71", # 更明亮的绿色(多头)
"-1" = "#E74C3C" # 更鲜明的红色(空头)
),
guide = FALSE # 移除填充图例
) +
# 标记零轴参考线
geom_hline(yintercept = 0, color = "gray", linetype = "dashed", size = 0.5) +
# 标记多空区域(与direction列对应)
annotate("text",
x = min(merged_data$date, na.rm = TRUE),
y = 0.1,
label = "多头区域",
color = "#2ECC71",
size = 3.5,
fontface = "italic") +
annotate("text",
x = min(merged_data$date,na.rm = TRUE),
y = -0.1,
label = "空头区域",
color = "#E74C3C",
size = 3.5,
fontface = "italic") +
# 标记买卖点
geom_point(data = buy_points, aes(y = macd),
color = "#2ECC71", size = 2, shape = 16, alpha = 0.7) +
geom_point(data = sell_points, aes(y = macd),
color = "#E74C3C", size = 2, shape = 16, alpha = 0.7) +
# 标题和坐标轴
labs(
title = "MACD技术指标",
y = "指标值",
x = "日期"
) +
# 主题设置
theme_minimal(base_size = 12, base_family = "SimHei") +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
axis.text.x = element_text(angle = 45, hjust = 1),
legend.position = "top",
panel.grid.minor = element_blank()
) +
# 颜色映射
scale_color_manual(
values = c("DIF线" = "#3498DB", "DEA线" = "#E74C3C"),
labels = c("DIF线 (快线)", "DEA线 (慢线)")
) +
# 优化坐标轴显示
scale_x_date(
date_breaks = "3 months",
date_labels = "%Y-%m",
expand = c(0, 5)
)
# 10. 组合图表
combined_plot <- gridExtra::grid.arrange(
price_plot, macd_plot,
nrow = 2,
heights = c(2, 1.8),
top = grid::textGrob(
"基于MACD指标的TSLA交易信号分析",
gp = grid::gpar(fontsize = 18, fontface = "bold")
)
)

# 显示图表
print(combined_plot)
## TableGrob (3 x 1) "arrange": 3 grobs
## z cells name grob
## 1 1 (2-2,1-1) arrange gtable[layout]
## 2 2 (3-3,1-1) arrange gtable[layout]
## 3 3 (1-1,1-1) arrange text[GRID.text.499]
交易频率分析
接下来,我们分析交易频率和持有期,这对于评估策略的实用性非常重要:
# 假设getTxns(portfolio.st,"AAPL")已获取交易数据
trades <- getTxns(portfolio.st,symbols.st)
# 数据预处理
if (nrow(trades) > 0) {
# 转换为data.frame并添加日期列
trades_df <- as.data.frame(trades)
trades_df$Date <- as.Date(index(trades))
# 提取买卖交易
buy_trades <- trades_df[trades_df$Txn.Qty > 0, ]
sell_trades <- trades_df[trades_df$Txn.Qty < 0, ]
# 确保买卖交易数量匹配
n_trades <- min(nrow(buy_trades), nrow(sell_trades))
if (n_trades > 0) {
# 按时间排序
buy_trades <- buy_trades[order(buy_trades$Date), ]
sell_trades <- sell_trades[order(sell_trades$Date), ]
# 取前n_trades笔交易进行匹配
buy_trades <- buy_trades[1:n_trades, ]
sell_trades <- sell_trades[1:n_trades, ]
# 计算持有期(天数)
hold_periods <- as.numeric(sell_trades$Date - buy_trades$Date)
# 计算持有期统计数据
stats <- data.frame(
总交易次数 = n_trades,
平均持有期 = round(mean(hold_periods), 1),
最长持有期 = max(hold_periods),
最短持有期 = min(hold_periods),
持有期标准差 = round(sd(hold_periods), 1)
)
# 输出统计结果
print("交易持有期统计:")
print(stats)
# 1. 持有期分布直方图 - 使用ggplot2
hold_dist_plot <- ggplot(data.frame(hold_periods), aes(x = hold_periods)) +
geom_histogram(aes(y = ..density..),
bins = 20,
fill = "#3366CC",
color = "white") +
geom_density(alpha = 0.2,
fill = "#FF9900") +
geom_vline(xintercept = mean(hold_periods),
color = "red",
linetype = "dashed",
size = 1) +
labs(
title = "交易持有期分布",
x = "持有天数",
y = "密度",
subtitle = paste("平均持有期: ", mean(hold_periods), "天")
) +
theme_minimal(base_family = "SimHei") +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
plot.subtitle = element_text(hjust = 0.5, size = 12),
axis.text = element_text(size = 10),
panel.grid.minor = element_blank()
)
# 2. 持有期箱线图 - 展示分布特征
hold_boxplot <- ggplot(data.frame(hold_periods),
aes(x = "", y = hold_periods)) +
geom_boxplot(fill = "#3366CC", alpha = 0.7) +
geom_jitter(color = "#FF9900", alpha = 0.5) +
labs(
title = "持有期分布箱线图",
y = "持有天数"
) +
theme_minimal(base_family = "SimHei") +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
axis.text.x = element_blank(),
panel.grid.minor = element_blank()
)
# 3. 交易频率分析 - 按月统计
trades_df$YearMonth <- format(trades_df$Date, "%Y-%m")
trade_frequency <- trades_df %>%
group_by(YearMonth) %>%
summarise(交易次数 = n())
# 交易频率柱状图
freq_barplot <- ggplot(trade_frequency, aes(x = YearMonth, y = 交易次数)) +
geom_bar(stat = "identity", fill = "#33CC99", color = "white") +
labs(
title = "月度交易频率",
x = "年月",
y = "交易次数"
) +
theme_minimal(base_family = "SimHei") +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
axis.text.x = element_text(angle = 45, hjust = 1, size = 8),
panel.grid.minor = element_blank()
)
# 4. 组合图表
library(patchwork)
combined_plot <- (hold_dist_plot + hold_boxplot) / freq_barplot +
plot_annotation(title = "AAPL交易持有期与交易频率分析",
theme = theme(plot.title = element_text(hjust = 0.5,
size = 18,
face = "bold")))
# 显示图表
print(combined_plot)
# 保存图表(可选)
# ggsave("trading_analysis.png",
# combined_plot,
# width = 12,
# height = 8,
# dpi = 300)
} else {
cat("没有足够的买卖交易对进行分析\n")
}
} else {
cat("没有交易数据可供分析\n")
}
## [1] "交易持有期统计:"
## 总交易次数 平均持有期 最长持有期 最短持有期 持有期标准差
## 1 62 15.1 51 1 11.4

结论与展望
研究结论
通过对MACD指标的参数优化和回测分析,我们得出以下结论:
- 在研究期间内,基于MACD指标的择时策略在特定参数组合下能够取得优于简单买入持有策略的风险调整后收益。
- 最佳参数组合显示,快速EMA周期、慢速EMA周期和信号线周期对策略表现有显著影响。
- 策略的交易频率适中,平均持有期符合中期投资风格。
策略局限性
尽管MACD指标在趋势市场中表现良好,但仍存在以下局限性:
- 回测结果受历史数据限制,未来表现可能与历史表现不同。
- 策略在震荡市场环境中可能产生更多的虚假信号。
- 交易成本和滑点未被充分考虑,实际应用中可能降低策略收益。
未来研究方向
- 结合其他技术指标(如KDJ、RSI等)构建多指标复合策略。
- 研究不同市场环境下MACD指标的适用性,开发自适应参数机制。
- 考虑交易成本、滑点和税费等实际因素,优化策略实现。
通过本研究,我们展示了如何使用R语言和相关金融包实现技术指标的回测和优化,为量化交易策略的开发提供了实用的方法和思路。
这篇文章提供了一个完整的MACD指标择时交易策略分析流程,包括数据获取、指标计算、策略实现、参数优化、回测分析和可视化。您可以直接将代码复制到R Markdown环境中运行,或者根据需要进行调整和扩展。希望这对您的研究和实践有所帮助!如果有任何问题或需要进一步的讨论,请随时联系我。