Strategy vault / Trend following
Super Trend Strategy SuperTrend
At the request of platform users, FMZ is compatible with TradingView's Pine language function library, which has now entered a stable version Syntax fully compatible with v5 version taAll indicators in the library…
At the request of platform users, FMZ is compatible with TradingView's Pine language function library, which has now entered a stable version
- Syntax fully compatible with v5 version
- taAll indicators in the library fully implemented
- mathLibrary fully implemented
- stringLibrary fully implemented
- arrayLibrary fully implemented
- inputInput parameters automatically recognized by the interface
- request.securitySupport for heikinashi
- strategyLibrary implementation (supports stop-loss/take-profit/trailing take-profit/condition orders and full support)
- plot/plotchar/plotshape/plotcandle/alert/alertcondition And other compatible
Full support for language functions is an ongoing effort; this public release is made public early to facilitate user testing
In the future, FMZ will continue to add and improve the function library support for TradingView's Pine language. If you have any needs, you can leave a message on this policy.
Note: If you encounter an undefined variable that proves that this attribute is not supported, you can delete the relevant call, or send a work order to contact technical personnel to solve the problem.

Source Pine Script
/*backtest
start: 2022-08-17 08:00:00
end: 2024-08-29 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
strategy("supertrend", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 50)
[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()
Published by 发明者量化 on the FMZ strategy square · last modified 2024-08-30. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Super-Trend-Strategy-SuperTrend.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Heiken Ashi and Super Trend Combination StrategyPine Script · Trend following · 1d
- Heiken Ashi Trend Following Strategy Multi Timeframe Trend Identification System with Multi Layer Stop Loss MechanismPine Script · Trend following · 1d
- SuperTrend Trailing Stop Strategy Based on Heikin AshiPine Script · Trend following · 4h
- Multi Technical Indicator Gold Real Time Movement Detection and Risk Management StrategyPine Script · Trend following · 1d
- Bitcoin Multi factor Trading StrategyPine Script · Trend following · 10m
- Heiken Ashi and Super Trend StrategyPine Script · Trend following · 1d