 
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :=EMA(DIFF,9);
MACD :2*(DIFF-DEA);
if cross(macd,0) and holding<=0 then
begin
sellshort(1,1,marketr);
buy(1,1,marketr);
end
if cross(0,macd) and holding>=0 then
begin
sell(1,1,marketr);
buyshort(1,1,marketr);
end
if ref(high,1)>ref(high,2) and ref(high,1)>high and ref(low,1)>ref(low,2) and ref(low,1)>low and holding>0 then sell(1,holding,marketr);
if ref(high,1)<ref(high,2) and ref(high,1)<high and ref(low,1)<ref(low,2) and ref(low,1)<low and holding<0 then sellshort(1,holding,marketr); |
|