ISLASTBK 和SLASTSK是什么意思?
[此贴子已经被作者于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));//头寸计算
MTC:=4*N; //最大头寸
if CROSS(C,HHV(H,10)) and type(1)<>1 and type(1)<>3 then buy(holding=0,1,market);//价格突破前20周期高点,买开仓
if CROSS(C,LLV(L,10)) and type(1)<>1 and type(1)<>3 then buyshort(holding=0,1,market);//价格突破前20周期点点,卖开仓
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周期高点,空单出场
if CROSS(L,LlV(L,5)) and holding>0 then sell(1,holding,market);//价格突破前10周期低点,多单出场
[此贴子已经被作者于2015/1/27 15:26:52编辑过]