|
//////////////////////////////////////////
//等价改写,1分钟周期
input:k(0.7,0.1,1,0.1);
N:=barslast(date<>ref(date,1))+1;
predayhigh:=ref(hhv(h,N),N); //昨日最高价
predaylow:=ref(LLv(L,N),N); //昨日最低价
predayclose:=VALUEWHEN(DATE<>REF(DATE,1),REF(CLOSE,1)); //昨收
predayrange:=max(predayhigh-predayclose,predayclose-predaylow);
dayopen:=valuewhen(date<>ref(date,1),o); //当日开盘价
upperband:=dayopen+k*predayrange;
lowerband:=dayopen-k*predayrange;
if low<=lowerband then
begin
sell(holding>0,holding,limitr,min(open,lowerband));
buyshort(holding=0,volunit,limitr,min(open,lowerband));
end
if high>=upperband then
begin
sellshort(holding<0,holding,limitr,max(open,upperband));
buy(holding=0,volunit,limitr,max(open,upperband));
end
if time>=closetime(0)-300 then
begin
sell(holding>0,holding,limitr,close);
sellshort(holding<0,holding,limitr,close);
end
资产:asset,noaxis,colorred,linethick2;
/////////////////////////////////////////
复制到金字塔软件中没有任何显示 |
|