序列運行模式下的 買賣函數分別是什么? [金字塔]
- 咨詢內容:
請教:序列運行模式下的 買賣函數分別是什么?
- 金字塔客服:
...
[此貼子已經被作者于2013/11/25 14:36:20編輯過] - 用戶回復:
后臺 tbuy(開多),tsell(平多),tbuyshort(開空),tsellshort(平空),可在序列或逐k模式運行。
- 網友回復:
//用固定時間間隔 variable:maxprofit=0;//有倉位時最大獲利 buycond:=ref(count(c>o,2)=2,1); if buycond and holding=0 then begin buy(1,1,limitr,o+2*mindiff); maxprofit:=0; end //止損平倉 if holding>0 and low<enterprice-10 then sell(1,1,market);win:=0;win2:=0;if holding > 0 and enterbars > 0 thenbegin win:=(high-enterprice); //記錄最大盈利 if win > maxprofit then maxprofit:=win; win2:=maxprofit-win; //最大盈利后的回調幅度end //如果開倉均價盈利大于50點但小于100點時,跌破盈利段的一半止盈if maxprofit>50 and maxprofit<100 and holding>0 then 止贏1:SELL(win2<0.5*maxprofit,1,market); //如果開倉均價盈利大于100點時,以盈利100點的位置為低點,100+N點為高點,這段距離回落一半止盈if maxprofit>=100 and holding>0 then 止贏2:SELL(win2<100+0.5*(maxprofit-100),1,market);
這個程序中哪些是圖表交易函數,怎么修改才可以運行在序列模式 - 網友回復:
buy(開多),sell(平多),buyshort(開空),sellshort(平空) 都是圖表程序化交易函數
variable定義的全局變量,也是圖表程序化交易的函數,且必須在逐K線模式下運行.
這是你在策略編寫區看到的一個代碼吧
一般的策略,逐K模式就可以的,推薦您先從圖表程序化交易學起
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容