ISLASTBK 和SLASTSK是什么意思?
[此貼子已經(jīng)被作者于2015/1/27 14:10:30編輯過]
ISLASTBK
判斷上一個信號是否是BK
用法:
ISLASTBK 如果上一個交易信號是BK則返回1(Yes),否則返回0(No)
ISLASTSK
判斷上一個信號是否是SK
用法:
ISLASTSK 如果上一個交易信號是SK則返回1(Yes),否則返回0(No)
tTR:MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));//定義TR
ATR:MA(tTR,26);//ATR定義
//TC:INTPART((MONEYTOT*0.01)/(UNIT*ATR));//頭寸計(jì)算
MTC:=4*N; //最大頭寸
if CROSS(C,HHV(H,10)) and type(1)<>1 and type(1)<>3 then buy(holding=0,1,market);//價格突破前20周期高點(diǎn),買開倉
if CROSS(C,LLV(L,10)) and type(1)<>1 and type(1)<>3 then buyshort(holding=0,1,market);//價格突破前20周期點(diǎn)點(diǎn),賣開倉
if C>=enterPRICE+0.5*ATR and holding<MTC and type(1)<>1 then buy(1,1,market);//價格上漲0.5倍ATR加倉
if C<=enterPRICE-0.5*ATR and holding<MTC and type(1)<>3 then buyshort(1,1,market);;//價格下跌0.5倍ATR加倉
if C<=(enterPRICE-1.5*ATR) and holding>0 then sell(1,holding,market);//價格下跌2倍ATR止損
if C>=(enterPRICE+1.5*ATR) and holding<0 then sellshort(1,holding,market);//價格上漲2倍ATR止損
if CROSS(H,HhV(H,5)) and holding<0 then sellshort(1,holding,market);;//價格突破前10周期高點(diǎn),空單出場
if CROSS(L,LlV(L,5)) and holding>0 then sell(1,holding,market);//價格突破前10周期低點(diǎn),多單出場
[此貼子已經(jīng)被作者于2015/1/27 15:26:52編輯過]