[PEL] 复制代码 Unit:=1;
Diff := rounds( ema( close,12 )-ema( close,26 ),2 ) ;
Dea := rounds( ema( diff,9 ),2 ) ;
Macd := 2*( diff-dea ), colorstick;
// 出 场
if holding > 0 and ref( cross( dea,diff ),1 ) then
begin
sell( holding > 0,holding,limitr, open - 1 * mindiff ),ignorecheckprice ;
end
if holding < 0 and ref( cross( diff,dea ),1 ) then
begin
sellshort( holding < 0,holding,limitr, open + 1 * mindiff ),ignorecheckprice ;
end
cd:((NUMPROFIT(1)<0 and NUMPROFIT(2)<0) or NUMPROFITPER(1)<=-2) and EXITBARS<10;
// 入 场
if holding = 0 and ref( cross( diff,dea ),1 ) and not(cd) then buy( 1,Unit,limitr, open + 1 * mindiff ),ignorecheckprice ;
if holding = 0 and ref( cross( dea,diff ),1 ) and not(cd) then buyshort( 1,Unit,limitr, open - 1 * mindiff ),ignorecheckprice ; |