Channel strategy based on ATR
- Strategy name: Channel strategy based on ATR volatility index - Strategy idea: Channel Adaptive Strategy, Fixed Stop + Floating Stop - Data Cycle: Multi-Cycle - Main chart: Draw UBAND, formula: UBAND ^^ MAC + MATR…
Strategy name: Channel strategy based on ATR volatility index
Strategy idea: Channel Adaptive Strategy, Fixed Stop + Floating Stop
Data Cycle: Multi-Cycle

Main chart: Draw UBAND, formula: UBAND ^^ MAC + MATR; Draw DBAND, formula: DBAND ^^ MAC-MATR;
Secondary chart: none
Parameters
| Name | Default | What it controls |
|---|---|---|
| SLOSS | 2 | Stop Loss Percentage | stop loss percentage |
| N | 200 | ATRMetric parameters | ATR index parameter |
| M | 4 | Upper and lower rail coefficients | upper and lower track coefficients |
Source MyLanguage
(*backtest
start: 2018-06-01 00:00:00
end: 2018-07-01 00:00:00
period: 1h
exchanges: [{"eid":"Futures_OKCoin","currency":"BTC_USD"}]
args: [["TradeAmount",10,126961],["ContractType","this_week",126961]]
*)
TR1:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR:=MA(TR1,N);
MAC:=MA(C,N);
UBAND^^MAC+M*ATR;
DBAND^^MAC-M*ATR;
H>=HHV(H,N),BPK;
L<=LLV(L,N),SPK;
(H>=HHV(H,M*N) OR C<=UBAND) AND BKHIGH>=BKPRICE*(1+M*SLOSS*0.01),SP;
(L<=LLV(L,M*N) OR C>=DBAND) AND SKLOW<=SKPRICE*(1-M*SLOSS*0.01),BP;
// stop loss
// stop loss
C>=SKPRICE*(1+SLOSS*0.01),BP;
C<=BKPRICE*(1-SLOSS*0.01),SP;
AUTOFILTER;Published by 阿基米德的浴缸 on the FMZ strategy square · last modified 2018-12-18. 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/Channel-strategy-based-on-ATR.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
- Channel strategy based on ATR volatility indicatorMyLanguage · Volatility
- Dual EMA Volatility Adaptive Trading Strategy with Multi Tiered Profit Optimization SystemPine Script · Volatility · 1d
- Dynamic ATR Trailing Stop Trading Strategy Market Volatility Adaptive SystemPine Script · Volatility · 1d
- Multi Indicator Volatility Trading RSI EMA ATR StrategyPine Script · Volatility · 3m
- RWI Volatility Contrarian StrategyPine Script · Volatility · 1h
- Dynamic Volatility Trading System Multi Timeframe Nested Technical Indicator Strategy with Extreme Market Condition Monitoring for FuturesPine Script · Volatility · 1h