Find Mode statistics function other than Median in Amibroker

Hi

I would like to find a mode value in order to identify the most significant support/resistance line. I think that it is suitable for me rather than an average function or event median function.

For example, The below show LLV(L,20)
I need to find Mode value as like this Mode(LLV(L,20),100).
but I didn't find this function, It may be similar to median function
https://www.amibroker.com/guide/afl/median.html

mode

mode-inexcel

How will I do if I want to calculate Mode ?

Pongthorn

Mode is maximum from distribution. So you need to calculate distribution and then find maximum. To calculate distribution you can use https://www.amibroker.com/guide/afl/pricevoldistribution.html

3 Likes

Hi Tomasz,

If I prefer to apply the mode function to HHV instead of Volume, How will I do?

https://www.amibroker.com/guide/afl/pricevoldistribution.html
https://www.amibroker.com/guide/afl/matrix.html

PriceVolDistribution( H , L , V , 100, False , fvb, lvb );
this function as your recommendation is likely to apply the only volume.

I try to export csv file to do in python or excel , it is applicable.

mode-python

mode

mode-inexcel

Please advise me.

No, you are wrong.

H, L, V are the default arrays but it's distribution function for any arrays.

What about looking into manual where there is clearly stated:

The function is general purpose frequency distribution function.

It is typically used to create distribution of volume versus price but this is only one of many possible uses.

In your case you have to replace array function arguments with LLV(..) or HHV(..) or whatever array you want to use. Note: priceH argument of PriceVolDistribution has to be larger than priceL argument.

As you can see in below example picture I am outputting most frequent LLV(...) since each new start of day. So variable "MODE" is yellow line.

5

1 Like

Hi fxshrat,

I attempt to read manual doc as below over the past night.
https://www.amibroker.com/guide/afl/pricevoldistribution.html

But I don’t understand yet , please kindly send me sample code as you recent post.

Your code show mode of LLV.

I would like to study your code for more understanding in this case.

Thank you very much for great help and I am pleased to mark your reply to be correct answer.

Pongthorn.