2024年2月3日发(作者:迷你小汽车)

# candlestick chartp2 = pq_plot(dt_val, date_range = \'10y\',

chart_type = \'candle\')# addtip3 = pq_plot(dt_val, date_range = \'ytd\',

chart_type = \'bar\', addti = list( sma = list(n=20), sma = list(n=50),

pb=list()))

# linear_trend

p4 = pq_plot(dt_val, date_range = \'max\',

chart_type = \'line\', linear_trend = c(-0.8, 0, 0.8))# multiple seriesdat = md_stock(c(\'^000001\', \'^399001\'),

date_range = \'max\', source = \'163\', print_step = 0)p5 = pq_plot(dat, multi_series = list(ncol=2, scales=\'free_y\'), date_range = \'max\',

linear_trend = c(-0.8, 0, 0.8), yaxis_log = TRUE)print(p5$multi_series)

策略开发双均线策略# load datassec = md_stock(\'^000001\', source=\'163\', date_range = \'max\', print_step = 0)# technical indicatorsti = list( sma=list(n=40),

sma=list(n=60), runmin = list(n=30))# long strategylong = list( enter = \'co(sma_40, sma_60)\', exit = \'co(sma_60, sma_40)\', stop_limit = \'close == runmin_30\', price = \'close\', position = 100)w = pedquant:::pq_backtest(ssec, addti=ti,

rule=list(long=long), stp_lmt_pct=0.03)## [INFO] backtesting ...

更多推荐

策略,小汽车,作者,开发,均线