[原創]幫忙修改和回答下我的問題,自己解決不了啦 [金字塔]
- 咨詢內容:
看啦論壇里面阿火的帖子,然后自己修改的,但是發現幾個問題不能解決,麻煩老師幫忙修改和回答下。
謝謝!
http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=9439
這個是阿火的帖子的地址。
我交易的時候不能等K線走完,只要一出信號就交易。
現在是使用多框架的時候我設置30%的,都是幾個品種一起下單,然后提示資金不夠,導致不能成交,
所以想用下面的取得實際持倉的數據,不知道對不對。
runmode:0;
variable:zs=0,cc=0;
Globalvariable:hold=drawnull; //放這里對嗎
開多: =。。。。。。。。。。。。; //多頭開倉條件
平多:=。。。。。。。。。。。。; //空頭平倉條件
開空:=。。。。。。。。。。。。;; //空頭開倉條件
平空: :=。。。。。。。。。。。。;; //空頭平倉條件
cc800988:=holding;//這句放在信號穩定的地方,即時下單的,就放下單語句的后面,K線走完下單的就放下單語句的前面,是放這里嗎
entertime:=time>085959 and time<145900;//我想開盤就成交,只要給出信號,不知道寫085959對不對,還有最后1分鐘前無條件平倉,不知道寫145900對不對
if holding>0 and cc<=0 then sell(1,0,limitr,o); //平多這里是填0還是填30%好?
if holding<0 and cc>=0 then sellshort(1,0,limitr,o); //平空這里是填0還是填30%好?
if holding=0 and cc>0 then buy(1,30%,limitr,o);
if holding=0 and cc<0 then buyshort(1,30%,limitr,o);
if cc>0 and l<zs then begin
sell(1,30%,limitr,min(o,zs-0.6)); //不知道-0.6是什么意思,能解釋下嗎
cc:=0;
end
if cc<0 and h>zs then begin
sellshort(1,30%,limitr,max(o,zs+0.6)); //不知道+0.6是什么意思,能解釋下嗎
cc:=0;
end
if cc>0 and 平多 then cc:=0; //不知道平多放這里對不對,反正測試有問題
if cc<0 and 平空 then cc:=0; //不知道平空放這里對不對,反正測試有問題
if cc=0 and 開多 and entertime then begin
cc:=1;
zs:=c-10; //不明白-10是什么意思,麻煩解釋下
end
//不知道開多放這里對不對,反正測試有問題
if cc=0 and 開空 and entertime then begin
cc:=-1;
zs:=c+10; //不明白+10是什么意思,麻煩解釋下
end
//不知道平空放這里對不對,反正測試有問題
if time>=150000 then begin
cc:=0;
end
drawtextex(1,1,800,0,'虛擬持倉為:'+numtostr(cc800988,0));//在圖表上輸出虛擬持倉以便監控,
感覺這句有問題,放上去后,圖形就差不多是一條直線啦,問下怎么解決
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;
我使用的時候,已經改成我自己的賬戶號碼的 - 金字塔客服:
這是后臺的代碼,你放到圖表上當然無法正常顯示了。
后臺的代碼編寫需要相對較高的用戶基礎水平,請認真學習 http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=332 問題4中的后臺調試技巧,如果你無法勝任這個工作,那么只能勸你暫時放棄后臺,使用圖表交易
- 用戶回復: 謝謝,斑竹的回答,但是我的問題還是沒解決。誰能回答我紅色字體的問題啊
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容