股票自動下單程序怎么改才能實(shí)現(xiàn)按資金比例下單 [金字塔]
- 咨詢內(nèi)容:
“后臺下單模板”,可用于各種模型。不會寫后臺模型的塔友,以后不用寫了,復(fù)制此模板即OK
只要把此模板放在 模型的最后面,就可以后臺全自動化交易了。此方法還有一個(gè)好處,即使用固定輪詢模式,也不會漏單
注意:把800988替換成自己的賬戶,按ctrl+H 進(jìn)行替換
有個(gè)性化需求的,也可在此模板上的基礎(chǔ)上定制。不會的可以找我
runmode:0;
Globalvariable:hold=drawnull;
……//這里添加上你自己的模型……//這里添加上你自己的模型
cc800988:=holding;//這句放在信號穩(wěn)定的地方,即時(shí)下單的,就放下單語句的后面,K線走完下單的就放下單語句的前面
drawtextex(1,1,800,0,'虛擬持倉為:'+numtostr(cc800988,0));//在圖表上輸出虛擬持倉以便監(jiān)控
if not(islastbar) or workmode<>1 then exit;
xiadan800988:=cc800988-hold;
if xiadan800988>0.5 then begin
cang:=min(xiadan800988,abs(hold));
if hold<0 then tsellshort(1,cang,mkt,0,0,'800988'),allowrepeat;
cang:=xiadan800988+min(hold,0);
if cang>0 then tbuy(1,cang,mkt,0,0,'800988'),allowrepeat;
end
if xiadan800988<-0.5 then begin
cang:=min(abs(xiadan800988),abs(hold));
if hold>0 then tsell(1,cang,mkt,0,0,'800988'),allowrepeat;
cang:=abs(xiadan800988)-max(hold,0);
if cang>0 then tbuyshort(1,cang,mkt,0,0,'800988'),allowrepeat;
end
hold:=cc800988; - 金字塔客服:
或者按等額資金也可。
- 用戶回復(fù):
現(xiàn)在有一個(gè)函數(shù):pertrader來實(shí)現(xiàn)資金百分比下單
- 網(wǎng)友回復(fù):
這個(gè)范本沒有持倉查詢也沒有撤單一類的動作,怎么就能直接用?是我想多了
- 網(wǎng)友回復(fù): 這是一個(gè)簡單的策略,并沒有詳細(xì)的風(fēng)控規(guī)則
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容