策略
Gooners-BTC-Weekly-RSI-Hack-Strategy
Zer3192 · PineScript · 均值回归 · 2022-08-27 21:19:13
源码摘要 自动提取 · 未经作者说明
源码,使用 RSI,检测到 开仓、平仓、仓位;无作者说明,内容由代码自动提取。
交易源码开仓平仓仓位
识别到的术语
RSI
操作术语
无
代码注释
- 无注释
代码行 21 · 函数 0 · 类 0 · 参数 3
参数
| 参数 | 默认值 | 说明 |
|---|---|---|
| v_input_1 | 14 | length |
| v_input_2 | 52 | buylevel |
| v_input_3 | 52 | selllevel |
源码(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")