At the request of our platform users, FMZ is compatible with the Pine language function library of TradingView now, and has entered a stable version.
It is a continuous process that provide full support for language functions, and this public version is made available in advance for user testing.
Later, FMZ will continue to increase and improve the function library support for Pine language of TradingView, if necessary, please leave a comment on this strategy.
Remark: If you encounter undefined variables, it is proved that this attribute is not supported. You can delete the relevant call, or send a work order to contact the technician to solve the problem.
/*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()template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6