- 策略广场
- CT策略之线性回归斜率策略
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;
template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6