| 
 
 等级: 超级版主 
注册: 2021-5-18曾用名: FireScript | 
| 按20楼逻辑: 
 input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6);
 INPUT:ss(1,1,1000,1);
 DIFF :EMA(CLOSE,S) - EMA(CLOSE,P);
 DEA  :EMA(DIFF,M);
 MACD1 :2*(DIFF-DEA), COLORSTICK;
 
 VARIABLE:zs:=0;
 
 P1:=ref(h+l,1)/2;//中间价,按照(最高+最低)/2 方式计算。可自行调整计算方式
 L1:=ref(l,1);
 H1:=ref(h,1);
 if ref(macd1,1)>1 and holding=0 then
 begin
 buy(holding=0,ss,limit,P1);
 zs:=L1;
 end
 
 
 if ref(macd1,1)<-1  and holding=0 then
 begin
 buyshort(holding=0,ss,limit,P1);
 zs:=H1;
 end
 
 if c<zs then 多止损:sell(1,holding,market);
 if c>zs then 空止损:sellshort(1,holding,market);
 持仓:holding;
 | 
 |