不好意思又來麻煩小幫手了
如題 當沖警示
value1 = getField("最高價", "D");
value2 = (high-low[1])/low[1]*100;
value3 = (high-low[1])/low[1]*100;
if Barinterval=1 and barfreq ="Min"
and date <> date[1] then Begin
if time > 090500 and time < 100000//十點之前
and high = value6//創新高
and value2 > 1.5//漲1.5%
計算滿3次後警示的腳本如何寫呢?
爬了很多資料 試寫了很多次 實在不行才來請教
是用while 來寫嗎?
用意是想急漲創新高後三次在空它
variable: n(0);
variable: count(0);
if Barinterval=1 and barfreq ="Min" then Begin
value1 = getField("最高價", "D");
value2 = (openD(0)-closeD(1))/closeD(1);
value3 = (high-low[1])/low[1]*100;
condition1=false;
if time > 090500
then begin
if high = value1
and value3 > 1
and value2 >= 0 and value2 < 0.01
then condition1=true;
n = 1;
while n <=3 begin //以下的陳述(到end;為止),n=1執行一次,n=2執行一次,一直到n=3
if condition1 then
count+=1;
n = n + 1;
end;
end;
//設定警示條件:if.. then ret=1;
if count = 3 and time < 100000
then ret=1;
end;
為什麼有些隔天一開盤會警示進場呢?
2 評論