S:=1;
SS:=INTPART((MONEYTOT-INITMONEY)/5000)*1;
B:MA(C,6);
D:MA(C,15);
AA:REF(O<REF(C,1)-60*MINPRICE,DAYBARPOS-1),NODRAW;
BB:REF(O>REF(C,1)+60*MINPRICE,DAYBARPOS-1),NODRAW;
CROSS(B,D)&&AA=0&&BB=0&&NOT(C>=SKPRICE+15*MINPRICE)&&BKVOL=0,BPK(SS+S);
CROSSDOWN(B,D)&&BB=0&&AA=0&&NOT(C<=BKPRICE-15*MINPRICE)&&SKVOL=0,SPK(SS+S);
C<=BKPRICE-15*MINPRICE,SP(BKVOL);
C>=SKPRICE+15*MINPRICE,BP(SKVOL);
( H-BKPRICE>=59 ),SP(BKVOL);
( L<=SKPRICE-59 ), BP(SKVOL);
CHECKSIG(SP,'A',0,'C',0,0);
CHECKSIG(BP,'A',0,'C',0,0);
CHECKSIG(BPK,'B',0,'D',0,0);
CHECKSIG(SPK,'B',0,'D',0,0);
REF(CROSS(B,D),1)&&AA=0&&BB=0&&BKVOL=0&&SKVOL=0,BK(SS+S);
REF(CROSSDOWN(B,D),1)&&AA=0&&BB=0&&BKVOL=0&&SKVOL=0,SK(SS+S);
CHECKSIG(SK,'A',0,'C',0,0);
CHECKSIG(BK,'A',0,'C',0,0);
DAYBARPOS=1&&C>BKPRICE+30*MINPRICE&&V>REF(MA(V,10),1)*3,SP(BKVOL);
DAYBARPOS=1&&C<SKPRICE-30*MINPRICE&&V>REF(MA(V,10),1)*3, BP(SKVOL);
DAYBARPOS>1&&C>BKPRICE+18*MINPRICE&&V>REF(MA(V,10),1)*2.5,SP(BKVOL);
DAYBARPOS>1&&C<SKPRICE-18*MINPRICE&&V>REF(MA(V,10),1)*2.5, BP(SKVOL);
DRAWCOLORLINE(B>D,B,COLORRED,COLORGREEN),LINETHICK1;
DRAWCOLORLINE(B>D,D,COLORRED,COLORGREEN),LINETHICK1;
每赢利5000加一手开仓
S:=1;
SS:=INTPART((asset-ref(ASSET,BARPOS))/5000)*1;
B:MA(C,6);
D:MA(C,15);
AA:REF(O<REF(C,1)-60*MINDIFF,TODAYBAR-1),NODRAW;
BB:REF(O>REF(C,1)+60*MINDIFF,TODAYBAR-1),NODRAW;
IF CROSS(B,D) AND AA=0 AND BB=0 AND NOT(C>=ENTERPRICE+15*MINDIFF) AND HOLDING=0
THEN
BEGIN
SELLSHORT(HOLDING<0,HOLDING,MARKET);
BUY(HOLDING=0,1,MARKET);
END
IF CROSS(D,B) AND BB=0 AND AA=0 AND NOT(C<=ENTERPRICE-15*MINDIFF) AND HOLDING=0
THEN
BEGIN
SELL(HOLDING>0,HOLDING,MARKET);
BUYSHORT(HOLDING=0,1,MARKET);
END
IF C<=ENTERPRICE-15*MINDIFF THEN SELL(HOLDING>0,HOLDING,MARKET);
IF C>=ENTERPRICE+15*MINDIFF THEN SELLSHORT(HOLDING<0,HOLDING,MARKET);
IF ( H-ENTERPRICE>=59 ) THEN SELL(HOLDING>0,HOLDING,MARKET);
IF ( L<=ENTERPRICE-59 ) THEN SELLSHORT(HOLDING<0,HOLDING,MARKET);;
IF REF(CROSS(B,D),1) and AA=0 and BB=0 and HOLDING=0 THEN BUY(1,SS+S,MARKET);
IF REF(CROSS(D,B),1) and AA=0 and BB=0 and HOLDING=0 THEN BUYSHORT(1,SS+S,MARKET);
IF TODAYBAR=1 and C>ENTERPRICE+30*MINDIFF and V>REF(MA(V,10),1)*3 THEN SELL(HOLDING>0,HOLDING,MARKET);
IF TODAYBAR=1 and C<ENTERPRICE-30*MINDIFF and V>REF(MA(V,10),1)*3 THEN SELLSHORT(HOLDING<0,HOLDING,MARKET);
IF TODAYBAR>1 and C>ENTERPRICE+15*MINDIFF and V>REF(MA(V,10),1)*2.5 THEN SELL(HOLDING>0,HOLDING,MARKET);
IF TODAYBAR>1 and C<ENTERPRICE-15*MINDIFF and V>REF(MA(V,10),1)*2.5 THEN SELLSHORT(HOLDING<0,HOLDING,MARKET);
仅供参考。毕竟是2个软件,语法格式上只是相近,各种机制上还是有不少差异,建议在了解和熟悉金字塔的基础上 根据自身的思路进行一些调整。
*“CHECKSIG” 这个无法转换。金字塔没有此类信号复核的机制。金字塔的下单要么是固定N秒检测一次信号,要么就是走完这个K检测信号。