相關標簽:er模型圖范例,dnf多玩模型修改專區,dnf17173補丁模型專區,cs模型下載專區,dnf鬼劍士模型專區,魔獸爭霸模型專區,dnf武器補丁模型專區,高頻交易策略模型,怎么把ar模型轉換成ma,
模型策略源碼:variable:cc1=0,cc2=0; //第一個模型,大于上10周期最高價買入,低于5周期最低價平倉。做空反之 //第二個模型,連續2根K線收陽線買入,做空反之 //用于測試使用。如果實盤,需用專業版的后臺,因為可能同一根K線圖產生2個同向信號 //或者信號相反時持倉對沖的處理。 yl:=ref(hhv(h,10),1); zc:=ref(llv(l,10),1); yl1:=ref(hhv(h,5),1); zc1:=ref(llv(l,5),1); b2:=ref(c>o,1) and ref(c>o,2); s2:=ref(c<o,1) and ref(c<o,2); /////////////////////////////////////////第二個模型是開盤價觸發,寫在最前面 if cc2>0 and s2 then begin cc2:=0; if holding>0 then sell(1,1,limitr,o); else buyshort(1,1,limitr,o); end if cc2<0 and b2 then begin cc2:=0; if holding<0 then sellshort(1,1,limitr,o); else buy(1,1,limitr,o); end if cc2=0 and b2 then begin cc2:=1; if holding<0 then sellshort(1,1,limitr,o); else buy(1,1,limitr,o); end if cc2=0 and s2 then begin cc2:=-1; if holding>0 then sell(1,1,limitr,o); else buyshort(1,1,limitr,o); end //////////////////////////////////////////////////////////////////////////////////////// if cc1>0 and l<zc1 then begin cc1:=0; if holding>0 then sell(1,1,limitr,min(o,zc1-mindiff)); else buyshort(1,1,limitr,min(o,zc1-mindiff)); end if cc1<0 and h>yl1 then begin cc1:=0; if holding<0 then sellshort(1,1,limitr,max(o,yl1+mindiff)); else buy(1,1,limitr,max(o,yl1+mindiff)); end if cc1=0 and h>yl then begin cc1:=1; if holding<0 then sellshort(1,1,limitr,max(o,yl+mindiff)); else buy(1,1,limitr,max(o,yl+mindiff)); end if cc1=0 and l<zc then begin cc1:=-1; if holding>0 then sell(1,1,limitr,min(o,zc-mindiff)); else buyshort(1,1,limitr,min(o,zc-mindiff)); end 點擊復制上述代碼粘貼到到公式管理器
{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}