资源加载中... loading...

波动率ATR轨道突破策略

Author: 扫地僧, Date: 2021-11-04 14:57:38
Tags: 商品期货趋势My语言

  • 公式名称:波动率轨道突破策略
  • 数据周期:15M,30M等
  • 支持:商品期货、数字货币现货、数字货币期货
  • 官方网站:www.quantinfo.com

img

  • 主图: 中轨,公式:MIDLINE^^MA((H + L + C)/3,LENGTH1); 上轨,公式:UPBAND^^MIDLINE + NATR; 下轨,公式:DOWNBAND^^MIDLINE - NATR;

  • 副图: 波动率,公式:ATR:=MA(TR,LENGTH2);


(*backtest
start: 2018-07-01 00:00:00
end: 2018-09-17 00:00:00
period: 1h
exchanges: [{"eid":"Futures_CTP","currency":"FUTURES"}]
args: [["LENGTH2",30],["LENGTH1",100],["ContractType","rb888",126961]]
*)

TR:=MAX(MAX((H-L),ABS(REF(C,1)-H)),ABS(REF(C,1)-L));
ATR:=MA(TR,LENGTH2);

MIDLINE^^MA((H + L + C)/3,LENGTH1);
UPBAND^^MIDLINE + N*ATR;
DOWNBAND^^MIDLINE - N*ATR;


BKVOL=0 AND C>=UPBAND AND REF(C,1)<REF(UPBAND,1),BPK;
SKVOL=0 AND C<=DOWNBAND AND REF(C,1)>REF(DOWNBAND,1),SPK;

BKVOL>0 AND C<=MIDLINE,SP(BKVOL);
SKVOL>0 AND C>=MIDLINE,BP(SKVOL);
AUTOFILTER;
template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6