請老師幫忙寫下股指代碼 [金字塔]
- 咨詢內容:
請老師編寫下股指的指標,如果方便的話,請附上注釋,方便學習,謝謝老師、
開倉信號:以當天開盤價上漲10個點以后開多,例如當天開盤價2013.6 價格漲到2014.8 以2014.8開多倉。 止損10個點。
以當天開盤價下跌10個點以后開空。同上,止損也是10個點。
平倉:開倉后如果盈利>20個點,止損回到開倉價格。如果不碰止損,收盤平倉。
開倉一天只開一次。多頭開倉后,當天不開空頭。
空頭開倉后,當天不開多頭。
- 金字塔客服:
編寫中,請稍等
- 用戶回復:
謝謝老師。
- 網友回復:
oo:=valuewhen(date<>ref(date,1),open);//當天開盤價
tt:=time<=145500;//限定交易時間:在強平前開倉
if h>=oo+10*mindiff and tt then buy(holding=0,1,limitr,high);//超過當天開盤價+10點后,開多if enterprice-l>=10*mindiff and tt then sell(holding>0,0,market);//多單止損,止損10點
if l<=oo-10*mindiff then buyshort(holding=0,1,limitr,l);//低于當天開盤價-10點后,開空
if h-enterprice>=10*mindiff then sellshort(holding<0,0,market);//空單止損,止損10點
if holding>0 and hhv(h,enterbars+1)-enterprice>20*mindiff and l<=enterprice then sell(holding>0,0,market);//浮盈20點,回落到開倉價后平多
if holding<0 and enterprice-llv(l,enterbars+1)>20*mindiff and h>=enterprice then sellshort(holding<0,0,market);//浮盈20點,回落到開倉價后平多
if time>145500 then begin
sellshort(1,0,market);
sell(1,0,market);
end//收盤前平倉 - 網友回復:
老師,測試后,每根K線上都有開平倉。
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容