linmike 發表於 14-10-27 20:35

取得畫面中最高價X軸的BARCOUNT

請問大大如何取得畫面中最高價X軸的BARCOUNT,Thanks.

joshsmi 發表於 14-10-31 00:30

Highest price of whole barcount?

hprice = Highest( H );

linmike 發表於 14-10-31 08:07

Thanks,但我所要的是畫面中最高價的barindex.

Sirius 發表於 14-11-1 10:06

HighestSinceBars - bars since highest value since condition met

不知這個是不是你要的?

Sirius 發表於 14-11-1 10:25

畫面中的最高價的barindex,可以
一、先求出畫面中最前與最後的barindex
二、再用一個for迴圈求出其中的最高價,取得其barindex


一、用status( ''statuscode'' ),其中的
"firstvisiblebar", "lastvisiblebar", "firstvisiblebarindex", "lastvisiblebarindex"

二、for迴圈,應該不用我多嘴了


畫面參考:4.畫面中最高、低點價位及漲跌幅。

linmike 發表於 14-11-1 14:24

thanks everyone,我已有抓到,但 顯則到最高價左邊則barindex為empty
,我在試試.,謝謝

joshsmi 發表於 14-11-1 19:42

linmike 發表於 14-10-31 08:07 static/image/common/back.gif
Thanks,但我所要的是畫面中最高價的barindex.

So like this one?

hprice = Highest( H );
hbi = ValueWhen( H == hprice, BarIndex() );

Plot( hbi, "Barindex of Highest value", colorRed, styleHistogram );

joshsmi 發表於 14-11-1 19:55

本帖最後由 joshsmi 於 14-11-1 19:57 編輯

Sort function of AmiBroker 5.88Version( 5.88 );
SetBarsRequired( sbrall );
Plot( Sort( H, 0, -1, True ), "Barindex of Sorted Highest value", colorRed, styleHistogram );

joshsmi 發表於 14-11-1 20:00

barssinceH = HighestSinceBars( H == Highest( H ), H );
Plot( barssinceH, "Bars Since Highest value", colorRed, styleHistogram );

joshsmi 發表於 14-11-1 22:03

joshsmi 發表於 14-11-1 20:00 static/image/common/back.gif


Actually

barssinceH = BarsSince( H == Highest( H ) );
Plot( barssinceH, "Bars Since Highest value", colorRed, styleHistogram );

linmike 發表於 14-11-2 10:23

thanks everyone,i have got it that i wanted.
頁: [1]
查看完整版本: 取得畫面中最高價X軸的BARCOUNT