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

CT策略之线性回归斜率策略

Author: 扫地僧, Date: 2021-11-04 09:38:10
Tags: 商品期货震荡My语言


(*backtest
start: 2015-02-22 00:00:00
end: 2021-11-03 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_CTP","currency":"FUTURES"}]
*)

N:=35;
AMOUNT:=INTPART(MONEYTOT*0.25/(C*UNIT*0.15));
ABOVE^^HHV(H,N);
FOLLOW^^LLV(L,N);
MIDDLE^^(ABOVE+FOLLOW)/2;
AVGMIDDLE^^MA(MIDDLE,N);
AVGMIDDLESLOPE:SLOPE(AVGMIDDLE,N);
AVGMIDDLESLOPE>REF(AVGMIDDLESLOPE,1)&&REF(AVGMIDDLESLOPE,1)>REF(AVGMIDDLESLOPE,2),BPK(AMOUNT);
AVGMIDDLESLOPE<REF(AVGMIDDLESLOPE,1)&&REF(AVGMIDDLESLOPE,1)<REF(AVGMIDDLESLOPE,2),SPK(AMOUNT);
AUTOFILTER;


相关内容

更多内容