序列運(yùn)行模式下的 買賣函數(shù)分別是什么?
作者:金字塔 來源:cxh99.com 發(fā)布時間:2014年11月29日
- 咨詢內(nèi)容:
請教:序列運(yùn)行模式下的 買賣函數(shù)分別是什么?
- 金字塔客服:
...
[此貼子已經(jīng)被作者于2013/11/25 14:36:20編輯過]
- 用戶回復(fù):
后臺 tbuy(開多),tsell(平多),tbuyshort(開空),tsellshort(平空),可在序列或逐k模式運(yùn)行。
- 網(wǎng)友回復(fù):
//用固定時間間隔 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; //最大盈利后的回調(diào)幅度end //如果開倉均價盈利大于50點(diǎn)但小于100點(diǎn)時,跌破盈利段的一半止盈if maxprofit>50 and maxprofit<100 and holding>0 then 止贏1:SELL(win2<0.5*maxprofit,1,market); //如果開倉均價盈利大于100點(diǎn)時,以盈利100點(diǎn)的位置為低點(diǎn),100+N點(diǎn)為高點(diǎn),這段距離回落一半止盈if maxprofit>=100 and holding>0 then 止贏2:SELL(win2<100+0.5*(maxprofit-100),1,market);
這個程序中哪些是圖表交易函數(shù),怎么修改才可以運(yùn)行在序列模式
- 網(wǎng)友回復(fù):
buy(開多),sell(平多),buyshort(開空),sellshort(平空) 都是圖表程序化交易函數(shù)
variable定義的全局變量,也是圖表程序化交易的函數(shù),且必須在逐K線模式下運(yùn)行.
這是你在策略編寫區(qū)看到的一個代碼吧
一般的策略,逐K模式就可以的,推薦您先從圖表程序化交易學(xué)起