開平倉問題
作者:金字塔 來源:cxh99.com 發(fā)布時間: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平倉k2的多單子用p2平倉
Q1的空單子用D1平倉Q2的空單子用D2平倉開空同理。
- 金字塔客服:
圖標不顯示
- 用戶回復:
你貼完整代碼
- 網(wǎng)友回復:
這樣編寫是正確?
- 網(wǎng)友回復:
還是做空要另外使用一個變量?