關(guān)于后臺持倉同步 [金字塔]
-
咨詢內(nèi)容:
請教:以下代碼,是阿火的后臺持倉同步模版,前5行是否并不是后臺用的模版?只是一個圖表的開倉程序?
然后,程序中是指定賬戶下單,如何改成所有賬戶都能下單(用于機(jī)構(gòu)版多賬戶)
cc:=holding; if holding>0 and c<ref(c,1) then sell(1,1,market); if holding<0 and c>ref(c,1) then sellshort(1,1,market); if holding=0 and c>ref(c,1) then buy(1,1,market); if holding=0 and c<ref(c,1) then buyshort(1,1,market); if not(islastbar) or workmode<>1 then exit; tm:=30;//撤單時間 ac:='800988';//下單賬戶 wt:=tremainqty(0,ac,stklabel); buyhold:=tbuyholdingex(ac,stklabel,1); sellhold:=tsellholdingex(ac,stklabel,1); if wt>0.5 and tsubmit(0)>tm then tcancelex(1,0,ac,stklabel);//如果用軟件自帶的撤單功能,這句刪除。 if wt<0.5 then begin ?kc1:=max(cc,0)-buyhold; ?kc2:=abs(min(cc,0))-sellhold; ?if kc1<-0.5 then tsell(1,abs(kc1),mkt,0,0,ac),allowrepeat; ?if kc2<-0.5 then tsellshort(1,abs(kc2),mkt,0,0,ac),allowrepeat; ?if sellhold<0.5 and kc1>0.5 then tbuy(1,kc1,mkt,0,0,ac),allowrepeat; ?if buyhold<0.5? and kc2>0.5 then tbuyshort(1,kc2,mkt,0,0,ac),allowrepeat; end?
-
金字塔客服:
?1.是的。前面部分其實(shí)是圖表的代碼。2.多賬號可以 用多賬號組的方式去下單。這樣就會對所有賬號組下面的賬號下單。進(jìn)入多賬號設(shè)置里面把多個賬號設(shè)成一個組管理就可以了。 你下單語句里面的參數(shù)填寫賬號組的名稱就行了。
此主題相關(guān)圖片如下:temp.png?
?來源:程序化久久網(wǎng)( www.kzuj.com.cn )
-
用戶回復(fù):
關(guān)于2,因?yàn)楹笈_程序里的語句是指定賬戶的,比如:ac:='800988';//下單賬戶
wt:=tremainqty(0,ac,stklabel);這些語句怎么改成所有賬戶的?我試著把第二句改成 wt:=tremainqty(0,stklabel);好像是報(bào)錯!?
-
網(wǎng)友回復(fù):
?
//ac:='800988';//下單賬戶
wt:=tremainqty(0,'',stklabel);?
?
您蹦到的報(bào)錯信息,都是語法錯誤,建議你自己針對錯誤,查看相關(guān)的函數(shù)說明
[此貼子已經(jīng)被作者于2020/9/14 10:57:48編輯過]
有思路,想編寫各種指標(biāo)公式,交易模型,選股公式,還原公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 或微信號:cxh99cxh99 進(jìn)行 有償收費(fèi) 編寫!
(怎么收費(fèi),代編流程等詳情請點(diǎn)擊閱讀!)
(注:由于人數(shù)限制,QQ或微信請選擇方便的一個聯(lián)系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容