開平倉問題 [MC]
- 咨詢內容:
本帖最后由 hangdoa 于 2014-10-15 13:57 編輯
滿足條件1平空倉一手,同時開多倉一手,滿足條件2時平多倉一手,同時開空倉一手,如何寫?
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優先如何用,盤中會出現2手的賣,且買有時不開倉啊?
- MC技術部:
if condition1 then
buy next bar at market;
if condition2 then
sellshort next bar at market;
buy /sellshort 在有倉位時是平倉反向 無倉位時是開倉
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容