求助語法幫忙

  •   133 
  • 最後發表   Small Chang  2022 十一月 18
Small Chang 發文於   2022/11/13

語法請教。

商品:股票

頻率:一分鐘

目的:想要抓昨日量能第三大的數值。但是9:00跟13:29分這兩根量能,不列入考量。這樣的語法要如何寫出來呢???

煩請小幫手,幫忙一下

排序方式: 標準 | 最新
XQ小幫手 發文於   2022/11/15

 Hello Small Chang,

 

您可以用陣列或變數來保存當日前三大的數值,並用 time 排除不想要的時間。

舉例來說:

array: top3_t[3](0), top3_y[3](0);

 

if issessionfirstbar then begin

    top3_y[1] = top3_t[1];

    top3_y[2] = top3_t[2];

    top3_y[3] = top3_t[3];

    top3_t[1] = 0;

    top3_t[2] = 0;

    top3_t[3] = 0;

    end;

 

if (time <> 090000 or time <> 132900) and volume >= top3_t[1] then begin

    top3_t[3] = top3_t[2];

    top3_t[2] = top3_t[1];

    top3_t[1] = volume;

    end;

 

這樣 top3_y 就會對應到昨日的前三大數值。

Small Chang 發文於   2022/11/18

感謝小幫手幫忙。

稍加修改,已經處理完畢。

發表回覆
Close