以前一日的最高价(high)和最低价(low)及两者的50%均价为参照,
一、当low<P<low+100时,做多;当high-100<p<high时,做空;
二、在做空的情况下,如果3个连续5分钟K线的收盘价高于high,则以第4根K线的开盘价进行止损;
如果low<P<low+100,买入止赢。
在做多的情况下,如果3个连续5分钟K线的收盘价低于low,则以第4根K线的开盘价进行止损;
如果high<p<high+200.卖出止赢
O(∩_∩)O谢谢
zh:=REFDATE(h,ref(date,1));//high
zl:=REFDATE(l,ref(date,1));//low
zz:=(zh+zl)/2;//p
//一、当low<P<low+100时,做多;当high-100<p<high时,做空;
if zl<zz and zz<zl+100 then buy(holding=0,1,market);
if zh-100<zz and zz<zh then buyshort(holding=0,1,market);
//二、在做空的情况下,如果3个连续5分钟K线的收盘价高于high,则以第4根K线的开盘价进行止损;
// 如果low<P<low+100,买入止赢。
if holding<0 and ref(c,3)>zh and ref(c,2)>zh and ref(c,1)>zh then
begin
sellshort(holding<0,0,limit,o);
if zl<zz and zz<zl+100 then sellshort(holding<0,1,market);
end
//在做多的情况下,如果3个连续5分钟K线的收盘价低于low,则以第4根K线的开盘价进行止损;
// 如果high<p<high+200.卖出止赢
if holding>0 and ref(c,3)<zl and ref(c,2)<zl and ref(c,1)<zl then
begin
sell(holding>0,0,limit,o);
if zh<zz and zz<zh+200 then sell(holding>0,0,market);
end