input:ratio(20);
setinputname(1,"散戶買單比例%");
input:TXT("須逐筆洗價");
setinputname(2,"使用限制");
//單筆外盤成交值低於五十萬元稱為散單 //內外盤:內盤-1 外盤1
variable:
intrabarpersist ACount(0);
variable:
intrabarpersist TimeStamp(0);
if
barfreq ="Min" and currentdate = date then //分鐘線在今天時
begin
TimeStamp =currenttime;
if TimeStamp = TimeStamp[1] then ACount=0;
if TimeStamp[1] <= time then // 盤中開啟 or 換Bar第一個進價
begin
if
q_BidAskFlag > 0 and q_TickVolume *Close <=500 then
ACount = q_TickVolume *Close
else
ACount=0;
end
else
begin
if
q_BidAskFlag > 0 and q_TickVolume *Close <=500 then ACount+=
q_TickVolume *Close;
end;
if ACount >= Ratio/100 * volume*close
and
Close < q_RefPrice*0.985 and
q_DailyHigh < q_RefPrice*1.005 then ret=1;
end;
if
barfreq ="D" then
begin
if
Date <> currentdate then Acount=0;
if
q_BidAskFlag > 0 and q_TickVolume *Close <=500 then ACount+=
q_TickVolume *Close;
if ACount >= Ratio/100 * q_DailyVolume *
q_AvgPrice and
Close < q_RefPrice*0.985 and
q_DailyHigh < q_RefPrice*1.005 then ret=1;
end;
沒有留言:
張貼留言