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

双均线与形态策略

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

  • 策略名称:双均线与形态策略

  • 数据周期:15M

  • 支持:商品期货,数字货币,数字货币期货

  • 官方网站:www.quantinfo.com

    img

  • 主图: MA指标,公式: VAR3^^MA(VAR2,PARAM1); EMA指标,公式:VAR4^^EMA(VAR3,PARAM2);

  • 副图: 无


(*backtest
start: 2018-05-02 00:00:00
end: 2018-06-21 00:00:00
period: 15m
exchanges: [{"eid":"Futures_BitMEX","currency":"XBT_USD"}]
args: [["TradeAmount",1000,126961],["SlideTick",10,126961],["ContractType","XBTUSD",126961]]
*)

DIRECTION:=0;         // 方向控制
                      // Direction control

VAR2:=(HIGH+LOW+CLOSE)/3;
VAR3^^MA(VAR2,PARAM1);
VAR4^^EMA(VAR3,PARAM2);
BOOL1:=CLOSE>REF(C,1) AND HIGH>REF(HIGH,1) AND CLOSE>OPEN;
BOOL2:=CLOSE<REF(C,1) AND LOW<REF(LOW,1) AND CLOSE<OPEN;

BUYPK:=BARPOS>PARAM1 AND CLOSE>VAR3 AND BOOL1 AND VAR3>VAR4;
SELLPK:=BARPOS>PARAM1 AND CLOSE<VAR3 AND BOOL2 AND VAR3<VAR4;

BUYJ:=CLOSE>BKPRICE AND BUYPK;
SELLJ:=CLOSE<SKPRICE AND SELLPK;
SELLS:=CLOSE<BKPRICE*(1-PARAM3*0.01);
BUYS:=CLOSE>SKPRICE*(1+PARAM3*0.01);

BKVOL=0 AND BUYPK AND DIRECTION>=0,BPK;
SKVOL=0 AND SELLPK AND DIRECTION<=0,SPK;
BKVOL>0 AND BUYJ,BK;
SKVOL>0 AND SELLJ,SK;
SELLS,SP;
BUYS,BP;
AUTOFILTER;

相关内容

更多内容