How to convert an array to a number? Thanks!
Well, you can’t simply convert the whole array to just one number. By definition an array consists of many numbers. Converting all of them to one number is like converting your name and surname to just one letter. If someone asked you to do that, you would have to pick just one letter - the first, the last or any other. Of course (in case of numbers), you can always calculate average value of the whole array. Study these functions:
http://amibroker.com/guide/afl/selectedvalue.html
http://amibroker.com/guide/afl/beginvalue.html
http://amibroker.com/guide/afl/endvalue.html
http://amibroker.com/guide/afl/valuewhen.html
… but start from this tutorial:
https://www.amibroker.com/guide/h_understandafl.html
Thank you Milosz
I used PriceVolDistribution in the afl and it showed the error about the array problem:
bi = BarIndex();
nd = DateNum() != Ref(DateNum(), -1); //NewDay
eod = Ref(nd, 1); //End of Day
fvb = ValueWhen(nd, bi, 1);
lvb = ValueWhen(eod, bi, 0);
mx = PriceVolDistribution(H, L, V, 100, False, fvb, lvb);