 
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
cond1:close>valuewhen(todaybar=1,open);
cond2:close<valuewhen(todaybar=1,open);
DIFF : =EMA(CLOSE,12) - EMA(CLOSE,26),NOAXIS;
DEA := EMA(DIFF,9),NOAXIS;
MACD1 : =2*(DIFF-DEA), COLORSTICK,NOAXIS;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,12,1);
D:=SMA(K,12,1);
J:=3*K-2*D;
ti:(time>0900 and time<1458) or (time>2100 and time<2258);
if cond1 and diff>dea and dea>0 and k>d and ti and dea>0 then
begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
end
if diff<dea and dea>0 then sell(1,holding,marketr);
if cond2 and diff<dea and dea<0 and k<d and ti then
begin
sell(1,holding,marketr);
buyshort(1,1,marketr);
end
if diff>dea and diff<0 then sellshort(1,holding,marketr); |
|