開平倉問題
作者:MC 來源:cxh99.com 發(fā)布時(shí)間:2015年01月17日
- 咨詢內(nèi)容:
本帖最后由 hangdoa 于 2014-10-15 13:57 編輯
滿足條件1平空倉一手,同時(shí)開多倉一手,滿足條件2時(shí)平多倉一手,同時(shí)開空倉一手,如何寫?
if condition1 then
Buy ( "BEntry" ) 1 share this bar at close ;
if (MarketPosition = 1) and condition2 then begin
sell from entry("BEntry") this bar at close;
end;
if condition2 then
Sell Short ( "SEntry" ) 1 share this bar at close ;
if (MarketPosition = -1) and condition1 then begin
buytocover from entry("SEntry") this bar at close;
end;
Sell Short優(yōu)先如何用,盤中會出現(xiàn)2手的賣,且買有時(shí)不開倉啊?
- MC技術(shù)部:
if condition1 then
buy next bar at market;
if condition2 then
sellshort next bar at market;
buy /sellshort 在有倉位時(shí)是平倉反向 無倉位時(shí)是開倉