variable:n=0;
趋势线:MA(CLOSE,P1);
生命线:MA(CLOSE,P2);
kk:cross(生命线,c);
kd:cross(c,生命线);
pk:cross(c,趋势线);
pd:cross(趋势线,c);
sellshort(holding<0 and kk,holding,market);
buy(holding=0 and kd,1,market);
sell(holding>0 and pd,holding,market);
buyshort(holding=0 and pk,1,market);
if 生命线>趋势线 and pd and holding=-1 then buyshort(holding<0,1,market);
if 生命线<趋势线 and pk and holding=1 then buy(holding>0,1,market);