//多頭為例
VARIABLE:n=0;
if 開多條件 and holding=0 then buy(1,ss,market);
if 平多條件 and holding>0 then sell(1,holding,market);
if numprofit>0 then n:=1;
if 開多條件 and holding>0 and n=1 then buy(1,2,market);
if NUMPROFIT<0 then n:=2;
if 開多條件 and n=2 holding>0 then buy(1,1,market);