策略知识库.EN
策略

Gooners-BTC-Weekly-RSI-Hack-Strategy

Zer3192 · PineScript · 均值回归 · 2022-08-27 21:19:13

全部策略 →
触发器
过滤
—
仓位
—
风控
—
出场
—

背景术语

源码摘要 自动提取 · 未经作者说明

源码,使用 RSI,检测到 开仓、平仓、仓位;无作者说明,内容由代码自动提取。

交易源码开仓平仓仓位

识别到的术语

RSI

操作术语

无

代码注释

  • 无注释

代码行 21 · 函数 0 · 类 0 · 参数 3

参数

参数默认值说明
v_input_114length
v_input_252buylevel
v_input_352selllevel
源码(21 行)
/*backtest
start: 2015-05-08 00:00:00
end: 2022-05-07 23:59:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Gooners BTC Weekly RSI Hack Strategy", overlay = true, default_qty_value = 100, default_qty_type = strategy.percent_of_equity, initial_capital = 1000000)
length = input( 14 )
buylevel = input( 52 )
selllevel = input( 52 )
price = close
rsi = ta.rsi(price, length)
co = ta.crossover(rsi, buylevel)
cu = ta.crossunder(rsi, selllevel)
if (not na(rsi))
	if (co)
		strategy.entry("RsiLE", strategy.long, comment="RsiLE")
	if (cu)
		strategy.close("RsiLE", comment="RsiLC")