老師幫忙指點一下 [金字塔]
-
咨詢內(nèi)容:
? ? ? ? ? ??
現(xiàn)在有兩個進場條件 CondA ?和 CondB ?
我想實現(xiàn)的進場方式的,,1,CondA 條件進場 2 手, 當cond 2 條件 滿足之后,,, 再 進場 ?2 手 , 總共4手, ??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2, ?當condB 滿足,而CondA不滿足時候,只進場CondB 2 手, 也就是說,,,CondB進場 不受 CondA 限制 ?不管有沒有持倉, 滿足CondB 則進場( 即便CondA 已經(jīng)進場了),而 CondA 進場 的前提是 holding 必須= 0 ,也就是空倉!
我寫語句是這樣的
if time > 093000 then begin
? ? ? ? ? ? ?if holding = 0 and CondA then buyshort( 1 , 2 , limitr, ?open ? * mindiff ), ignorecheckprice ; ? ? ? ? ? ? ? ? ? ? ? ? ? ?if holding = -2 or holding = 0 and CondB then buyshort( 1 , 2 , limitr, ?open ? * mindiff ), ignorecheckprice ;
end
這樣造成的問題就是,,,條件 CondB 滿足之后,,一下子進 4 手, 我只想要進2手,怎么改,,也就是說,不過有沒有持倉, 條件Cond B 進場 就 2 手,只進場一次
? ? ? ? ? ? ? ? ? ? ? ? ? 條件Cond A 進場的前提是 空倉
麻煩老師幫忙理清一下表達思路,,,謝謝
?
-
金字塔客服:
你的需求表述總結
1,在沒有倉位時,并且CondA成立則開倉,若cond2 滿足則加倉2手。
2.condB滿足就開倉2手。
?
如果上述理解沒有問題就是
if condA and HOLDING=0 then buy();
if cond2 then buy();if condB? then buy();
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯(lián)系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內(nèi)容