有关均价线的模型
思路:
1、收盘价大于分时均价线价买入,收盘价小于分时均价线价卖出;
2、最大亏损12跳;
3、盈利4跳至9跳,如果回调至盈利1跳时平仓;盈利10跳至14跳,如果回调至盈利3跳时平仓;盈利15跳至19跳,如果回调至盈利8跳时平仓;盈利20跳至22跳,如果回调至盈利18跳时平仓;23跳以上跟踪止盈,则最新价从上一次高点回撤3跳,止赢;if c>=enterprice+4 and
c<=enterprice+9 and cross(enterprice+1,c) then sell(1,0,market);
if
c>=enterprice+10 and c<=enterprice+14 and cross(enterprice+3,c) then
sell(1,0,market);
if
c>=enterprice+15 and c<=enterprice+19 and cross(enterprice+8,c) then
sell(1,0,market);
if
c>=enterprice+20 and c<=enterprice+22 and cross(enterprice+18,c) then sell(1,0,market);
if
c<=enterprice-4 and c>=enterprice-9 and cross(c,enterprice-1) then
sellshort(1,0,market);
if
c<=enterprice-10 and c>=enterprice-14 and cross(c,enterprice-3) then
sellshort(1,0,market);
if
c<=enterprice-15 and c>=enterprice-19 and cross(c,enterprice-8) then
sellshort(1,0,market);
if
c<=enterprice-20 and c>=enterprice-22 and cross(c,enterprice-18) then
sellshort(1,0,market);
if
hhv(h,enterbars+1)>enterprice+20 and hhv(h,enterbars+1)+23 and
cross(enterprice-2,close) then sell(1,0,market);
if
llv(l,enterbars+1)<enterprice-20 and llv(l,enterbars+1)-23 and
cross(c,enterprice+2) then sellshort(1,0,market);
if
openprofit>=0 and time0>=timetot0(closetime(0))-60*2 then begin
sell(1,0,market);
sellshort(1,0,market);
end
5、盈利4跳至9跳,如果回调至盈利1跳时平仓;盈利10跳至14跳,如果回调至盈利3跳时平仓;盈利15跳至19跳,如果回调至盈利8跳时平仓;盈利20跳至22跳,如果回调至盈利18跳时平仓;23跳以上跟踪止盈,则最新价从上一次高点回撤3跳,止赢。
dm:=4*-INTPART(LOG(C));
n1:=barslast(DATE<>REF(DATE,1))+1;
均线:ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),dm),COLORYELLOW;
if close>均线 then begin
sellshort(1,0,market);
buy(holding=0,1,market);
end
if close<均线 then begin
sell(1,0,market);
buyshort(holding=0,1,market);
end
if openprofit<=-12*mindiff*multiplier then begin
sellshort(1,0,market);
sell(1,0,market);
end
if c>=enterprice+4*mindiff and c<=enterprice+9*mindiff and c<=hhv(h,enterbars+1)-mindiff then sell(1,0,market);
if c>=enterprice+10*mindiff and c<=enterprice+14*mindiff and c<=hhv(h,enterbars+1)-3*mindiff then sell(1,0,market);
if c>=enterprice+15*mindiff and c<=enterprice+19*mindiff and c<=hhv(h,enterbars+1)-8*mindiff then sell(1,0,market);
if c>=enterprice+20*mindiff and c<=enterprice+22*mindiff and c<=hhv(h,enterbars+1)-18*mindiff then sell(1,0,market);
if c<=enterprice-4*mindiff and c>=enterprice-9*mindiff and c>=llv(l,enterbars+1)+mindiff then sellshort(1,0,market);
if c<=enterprice-10*mindiff and c>=enterprice-14*mindiff and c>=llv(l,enterbars+1)+3*mindiff then sellshort(1,0,market);
if c<=enterprice-15*mindiff and c>=enterprice-19*mindiff and c>=llv(l,enterbars+1)+8*mindiff then sellshort(1,0,market);
if c<=enterprice-20*mindiff and c>=enterprice-22*mindiff and c>=llv(l,enterbars+1)+18*mindiff then sellshort(1,0,market);
if hhv(h,enterbars+1)>=enterprice+23*mindiff and close<=hhv(h,enterbars+1)-3*mindiff then sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-23*mindiff and close>=llv(l,enterbars+1)+3*mindiff then sellshort(1,0,market);
这个就是过滤原则的解释吗?
前面的代码做如下修改:
variable:bj=0;
dm:=4*-INTPART(LOG(C));
n1:=todaybar;
均线:ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),dm),COLORYELLOW;
if close>均线 then begin
sellshort(1,0,market);
buy(holding=0 and bj=1,1,market);
bj:=2;
end
if close<均线 then begin
sell(1,0,market);
buyshort(holding=0 and bj=2,1,market);
bj:=1;
end