您現在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔模型>>正文內容

金字塔的橫向統計功能 自定義數據橫向排名統計功能實現策略回測的方法和步驟[金字塔模型]

: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">金字塔的橫向統計功能是一個十分強大的功能,尤其是針對股票市場品種數據大的特點,更是在我們的量化交易統計過程中發揮巨大的優勢。舉例來說:: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">? 我們的策略實現如下功能:尋找漲幅排名在30名之前,并且MA均線處于金叉位置的股票,實現買進,出現死叉的持倉股票,賣出。: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">? 為了實現上述策略,我們要將策略分成2個部分來完成,第一要完成股票在市場當中的漲跌幅排名,第二就是要判斷是否金叉和死叉。: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">? 排名統計就需要借助橫向統計功能,先為我們統計出來個股在整個市場的漲跌幅排名情況。雖然我們可以在公式中自行完成統計工作,但是計算量是十分巨大的,這樣的公式編寫出來也幾乎是沒法正常使用的,幸好金字塔為我們提供了非常有價值的橫向統計自定義數據的功能,有了這個功能,再復雜的統計工作,我們都可以非常輕松的來完成,而且是效率非常高的。并且自定義數據不僅僅可以用來做統計,像類似跨周期數據引用這樣的工作,我們也都可以用他來幫我們完成,喜歡使用跨周期引用的朋友可以自定嘗試,使用自定義數據和你自己在公式中使用STKINDI他們的效率差別。好了言歸正傳,下面來介紹統計橫向排名的步驟:: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">??第一步,建立一個技術指標公式,用來統計漲跌幅,名稱為 Formula2,代碼為:: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">? 第二步,我們進行橫向排名統計,分析菜單->自定義數據,打開自定義數據窗口,本例中我們以日線數據做統計,: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px"> : none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">? 新建一個“證券相關序列”,名稱為“漲幅排”的自定義數據序列,選擇我們前面建立的公式指標,統計周期選擇日線,如果你除了測評外還需要盤中做后臺程序化交易,那么你還需要勾選“自動更新”這個選項,這里的重點選項是需要你勾選“生成橫向排名數據”,只有你勾選了這個選項后,才可以對漲跌幅這個數據做排名的哦。最后確認你的計算范圍,要選擇對“上海A股”整個市場板塊進行統計。: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">? 設置完畢后,我們需要點“刷新”按鈕進行刷新,: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">? 這里重點提醒的是,如果你需要測評,那么你應該選擇刷新指定數量的數據,如果你是做實盤程序化使用,那么這個數量應該盡可能設小,以加快橫向統計的處理速度。: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">??刷新完畢后,我們可以人工打開一個品種看一下刷新的數據是否正確,比如我們以浦發銀行為例:: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px"> : none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?接下來最后一步就是進行程序化交易測評的公式編寫部分了,按照上述的要求編寫的程序化交易的代碼如下:: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?這里重點介紹的函數SELFDATA,用這個函數可以直接讀取我們之前設定的自定義數據。用法非常簡單,我想通過上述的代碼用戶應該不難理解他的使用。: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?上述代碼編寫完畢后,我們就可以進行我們的測試工作啦,下面是測試報告。: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">==========================================================================: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">有關自定義數據的屬性類型的說明:: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">?: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px"> : none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px"> : none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px"> 橫向統計序列:將所有的品種進行統計,統計結果擬合到一個結果中,例如我們可以統計滬深A股的上漲,下跌家數,以及指標值的累加,例如統計滬深A股出現MA均線金叉的家數等等。

?

{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}

?

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯系技術人員 QQ: 511411198  有需要幫忙請點擊這里留言!!!進行 有償 編寫!不貴!點擊查看價格!

 


【字體: 】【打印文章】【查看評論

相關文章

    沒有相關內容
  主站蜘蛛池模板: 久久国产精品99精品国产987| 中国一级黄色片子| 激情五月综合网| 国产乱人伦无无码视频试看| 91区国产福利在线观看午夜| 性无码免费一区二区三区在线| 久草福利在线观看| 欧美黑人性暴力猛交喷水| 国产91乱剧情全集| 欧美疯狂ⅹbbbb另类| 在线观看亚洲精品专区| 中文字幕亚洲天堂| 最新国产三级在线不卡视频| 亚洲综合伊人久久大杳蕉| 美女视频黄频a免费| 国产成人无码专区| 91福利在线观看视频| 小说区综合区首页| 久久人妻少妇嫩草AV| 欧美亚洲国产丝袜在线| 人妻被按摩师玩弄到潮喷| 色婷五月综激情亚洲综合| 国产欧美日韩另类精彩视频| 99在线小视频| 少妇无码太爽了在线播放 | 亚洲欧美日韩一区在线观看| 精品精品国产自在97香蕉| 国产午夜无码福利在线看网站 | 120秒男女动态视频免费| 外国女性用一对父子精液生子引争议 | 亚洲精品短视频| 精品无码久久久久久国产| 国产在播放一区| 午夜精品福利视频| 国产美女口爆吞精普通话| heyzo亚洲精品日韩| 成人免费视频软件网站| 久久99精品久久久久久动态图| 日韩精品视频在线观看免费| 亚洲午夜精品一区二区公牛电影院 | 最近免费韩国电影hd视频|