開(kāi)平倉(cāng)問(wèn)題
作者:金字塔 來(lái)源:cxh99.com 發(fā)布時(shí)間:2017年04月28日
- 咨詢內(nèi)容:
VARIABLE:bj=0;
if aspect=0 and holding=0 and bj=0 then begin bj:=1; buy(1,1,thisclose);endif H>=PBUY and C>=MAX(O,PBUY) AND MA1>REF(MA1,1) and holding=0 and bj=0 then begin bj:=2; buy(1,1,thisclose);end if aspect=1 and holding>0 and bj=1 then begin sell(1,0,thisclose); bj:=0;end if C<stopprice and holding>0 and bj=2 then begin sell(1,0,thisclose); bj:=0;end
if aspect=1 and holding=0 and bj=0 then begin bj:=1; BUYSHORT(1,1,thisclose);endif L<=PSELL and C<=MIN(O,PSELL) AND MA1<REF(MA1,1) and bj=0 then begin bj:=2; BUYSHORT(1,1,thisclose);end if aspect=1 and holding>0 and bj=1 then begin SELLSHORT(1,0,thisclose); bj:=0;end if C<stopprice and holding>0 and bj=2 then begin SELLSHORT(1,0,thisclose); bj:=0;end
k1的多單子用p1平倉(cāng)k2的多單子用p2平倉(cāng)
Q1的空單子用D1平倉(cāng)Q2的空單子用D2平倉(cāng)開(kāi)空同理。
- 金字塔客服:
圖標(biāo)不顯示
- 用戶回復(fù):
你貼完整代碼
- 網(wǎng)友回復(fù):
這樣編寫(xiě)是正確?
- 網(wǎng)友回復(fù):
還是做空要另外使用一個(gè)變量?