应平台用户要求, FMZ正在兼容TradingView的Pine语言函数库,现已完成工作
对语言的函数完全支持是一个持续努力的过程, 此公开版本为方便用户测试提前公开
后期FMZ会进行持续不段的增加完善对TradingView的Pine语言的函数库支持, 有需求可以本策略留言
注: 如果遇到变量未定义证明尚不支持此属性可删除相关调用(比如颜色画线相关)后续后逐渐完善支持
/*backtest start: 2020-04-27 00:00:00 end: 2022-04-26 23:59:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Bitfinex","currency":"BTC_USD"}] */ strategy("supertrend", overlay=true) [supertrend, direction] = ta.supertrend(input(5, "factor"), input.int(10, "atrPeriod")) plot(direction < 0 ? supertrend : na, "Up direction", color = color.green, style=plot.style_linebr) plot(direction > 0 ? supertrend : na, "Down direction", color = color.red, style=plot.style_linebr) if direction < 0 if supertrend > supertrend[2] strategy.entry("entry long", strategy.long) else if strategy.position_size < 0 strategy.close_all() else if direction > 0 if supertrend < supertrend[3] strategy.entry("entry short", strategy.short) else if strategy.position_size > 0 strategy.close_all()
Leafar 牛牛牛
夏天不打你 这个下单数量也是通过strategy.entry的qty参数调整吗?
Zer3192 发明者越来越强大了
xunfeng91 牛逼v5,这策略可以直接上实盘了
发明者量化 是的,默认不指定的话就是界面选项里的参数