Find Mode statistics function other than Median in Amibroker


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



How will I do if I want to calculate Mode ?


Mode is maximum from distribution. So you need to calculate distribution and then find maximum. To calculate distribution you can use


Hi Tomasz,

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

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.




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.


1 Like

Hi fxshrat,

I attempt to read manual doc as below over the past night.

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.