期貨期權(quán)交流percenttrailing止盈語(yǔ)句,如何按at market方式下單 [MC]
-
咨詢內(nèi)容:
percenttrailing止盈語(yǔ)句代碼如下:
[IntrabarOrderGeneration=true];
input:target(10),Percent(30);//,BS(NumericSimple);
vars:intrabarpersist mp(0),intrabarpersist flagB(0),intrabarpersist flagS(0), intrabarpersist valueh(0),intrabarpersist valuel(999999);
once cleardebug;
mp=marketposition;
if mp<>mp[1] then
begin
? ? ? ? valueh=0;
? ? ? ? valuel=999999;
? ? ? ? flagb=0;
? ? ? ? flags=0;
end;
if mp>0 and valueh<=h then
valueh=h;
if mp<0 and valuel>=l then
valuel=l;
if (mp>0 and valueh-entryprice>target) then
flagB=1;
if mp<0 and entryprice-valuel>target then
flags=1;
if mp=1 and flagB=1 then
sell("L_trailing") next bar at valueh-Percent*(valueh-entryprice)/100 stop;
if mp=-1 and flagS=1 then
buytocover("S_trailing") next bar at??valuel+percent*(entryprice-valuel)/100 stop;
我在實(shí)際使用時(shí)遇到了一個(gè)情況:市場(chǎng)價(jià)格變動(dòng)太快,導(dǎo)致止盈指令發(fā)出后沒(méi)有成交。
我的訴求是用at market的方式下單,請(qǐng)問(wèn)老師應(yīng)該如何改動(dòng)上述語(yǔ)句才能達(dá)到目的,謝謝!?
- MC技術(shù)部: 把stop單的發(fā)單價(jià)格做成條件判斷,最后交易語(yǔ)句寫(xiě)成市價(jià)
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容