- UID
- 2
- 积分
- 2874674
- 威望
- 1387366 布
- 龙e币
- 1487308 刀
- 在线时间
- 13156 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
源码如下:
- //kdj,macd组合策略例子
- N:=26;P1:=12;P2:=9;
- DIFF : =EMA(CLOSE,12) - EMA(CLOSE,26);
- DEA : =EMA(DIFF,9);
- RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
- K:=SMA(RSV,P1,1);
- D:=SMA(K,P2,1);
- J:=3*K-2*D;// WWW.CXH99.COM
-
- //MA1:=DIFF;
- //MA2:=DEA ;
-
- //MA3:=J;
- //MA4:=D;
-
- long:=any(CROSS(diff,dea),10) and any(cross(j,d),10) and (cross(diff,dea) or cross(j,d));//((CROSS(diff,dea) and J>D) or (CROSS(J,D) and diff>dea));
-
-
- IF long THEN
- BEGIN
- BUY(long,1,thisclose);
- END
-
- SELL(CROSS(dea,diff),1,thisclose);
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|