小幫手 您好
我想盤中找出1分k,開盤起第1.2.3根都是紅棒,今天預估量是昨量的2倍以上,開高(比昨收高1%),盤中最新價格已漲2%
程式碼如下,結果有出現第1根k就是黑K的情況,請幫我看一下,是哪個地方有錯?謝謝
if barfreq <> "Min" or Barinterval <>1 then RaiseRuntimeError("請設定頻率為1分鐘");
variable:BarNumberOfToday(0);
value1 = GetField("Volume", "D")[1];
value2 = GetField("close", "D")[1];
value3=q_EstimatedTotalVolume;//GetField("估計量")
if Date <> Date[1] then
BarNumberOfToday=1
else
BarNumberOfToday+=1;{記錄今天的Bar數}
if barnumberoftoday=3 then begin
//今天第三根1分鐘K,也就是開盤第三分鐘
if trueall(close>=close[1],3)
//連三根K棒都是紅棒
and GetField("開盤價","D")> value2*1.01
and value3>value1*2
//預估量是昨量兩倍以上
and close>=value2*1.02
//漲2%
then ret=1;
end;

4 評論