- UID
- 2
- 积分
- 2869668
- 威望
- 1384862 布
- 龙e币
- 1484806 刀
- 在线时间
- 13082 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-15
|
源码如下:
- //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);
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|