還是老問題:平多盈利執(zhí)行不及時(shí),盈利全部吃光:程序源碼
//開多
IF ( stopprice)<l THEN
BEGIN
SELLSHORT( HOLDING<0,HOLDING,market); //平空操作
BUY( HOLDING=0,1,market);//開多操作
maxprofit:=0;
END
//平倉
SELL((stopprice)>h and HOLDING>0,HOLDING,market);//平多
BUYSHORT((stopprice)>h and HOLDING=0,1,market); //開空操作
if enterbars>=3 then begin
if c>o and holding>0 then sell(1,holding,market);
if c<o and type(1)= 2 then buy(holding>=0,1,market);
end
//空頭為例
if enterbars>=3 then begin
if c>o and holding<0 then sellshort(1,holding,market);
if c<o and type(1)=4 then buyshort(holding<=0,1,market);
end
那根k線是陰線,怎么會(huì)出信號(hào)的?