如何串接3個警示? 布林上緣買超+寶塔線紅K+成交量突破N倍三個同時達成觸發警示 用於分K線
以下是我串接的邏輯,感覺抓不到我要的點,我該怎麼修改。
// 布林通道超買訊號
Input: Length(20), UpperBand(2);
settotalbar(Length + 3);
SetInputName(1, "期數");
SetInputName(2, "通道上緣");
if High >= bollingerband(Close, Length, UpperBand) then Value2 = 1;
// 寶塔線紅K
input: Length1(4);
variable: _Index(0), HV(0), LV(0);
SetInputName(1, "寶塔天數");
HV = Close[1];
LV = Close[1];
for _Index = 2 to Length1 + 1
begin
if HV <= Close[_Index] then HV = Close[_Index];
if LV >= Close[_Index] then LV = Close[_Index];
end;
if Close > HV then Value1 = 1
else if Close < LV then Value1 = -1;
//成交量突破N倍
//input: length(20); setinputname(1,"均量期數");
input: VolumeXtime(3); setinputname(2,"量增倍數");
settotalbar(3);
setbarback(Length);
if volume > Average( volume[1],length)* VolumeXtime then Value3 = 1;
if Value1 = 1 and Value2 = 1 and Value3 = 1 then ret=1;
2 評論