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

均线和高低点相对强弱策略

Author: 扫地僧, Date: 2021-11-05 10:26:58
Tags: 商品期货趋势My语言

  • 策略名称:基于价格相对强的弱策略

  • 数据周期:1H

  • 支持:商品期货

  • 官方网站:www.quantinfo.com

    img

  • 主图: 均线,公式: MAN^^MA(C,N);

  • 副图: 无


(*backtest
start: 2018-02-01 00:00:00
end: 2018-04-27 00:00:00
period: 1h
exchanges: [{"eid":"Futures_CTP","currency":"FUTURES"}]
args: [["ContractType","rb888",126961]]
*)

MAN^^MA(C,N);
B_MA:=C>MAN;
S_MA:=C<MAN;

S_K1:=SUM((H-C)*V,N)/SUM((H-L)*V,N)>0.5;
B_K1:=SUM((C-L)*V,N)/SUM((H-L)*V,N)>0.5;

CO:=IF(C>O,C-O,0);
OC:=IF(C<O,O-C,0);
S_K2:=SUM(OC*V,N)/SUM(ABS(C-O)*V,N)>0.5;
B_K2:=SUM(CO*V,N)/SUM(ABS(C-O)*V,N)>0.5;

B_K1 AND B_K2 AND B_MA AND H>=HHV(H,N),BPK;
S_K1 AND S_K2 AND S_MA AND L<=LLV(L,N),SPK;

STOPLOSS:=M*MA(H-L,N);
C<BKPRICE-STOPLOSS,SP(BKVOL);
C>SKPRICE+STOPLOSS,BP(SKVOL);

S_MA AND BKHIGH>BKPRICE+STOPLOSS,SP(BKVOL);
B_MA AND SKLOW<SKPRICE-STOPLOSS,BP(SKVOL);
template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6