相關(guān)標(biāo)簽:er模型圖范例,dnf多玩模型修改專區(qū),dnf17173補(bǔ)丁模型專區(qū),cs模型下載專區(qū),dnf鬼劍士模型專區(qū),魔獸爭霸模型專區(qū),dnf武器補(bǔ)丁模型專區(qū),高頻交易策略模型,怎么把a(bǔ)r模型轉(zhuǎn)換成ma,
模型策略源碼:variable:cc1=0,cc2=0; //第一個模型,大于上10周期最高價買入,低于5周期最低價平倉。做空反之 //第二個模型,連續(xù)2根K線收陽線買入,做空反之 //用于測試使用。如果實(shí)盤,需用專業(yè)版的后臺,因?yàn)榭赡芡桓鵎線圖產(chǎn)生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); /////////////////////////////////////////第二個模型是開盤價觸發(fā),寫在最前面 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 點(diǎn)擊復(fù)制上述代碼粘貼到到公式管理器
{別忘了將本網(wǎng)告訴您身邊的朋友,向朋友傳達(dá)有用資料,也是一種人情,你朋友會感謝你的。}