I have no idea if this exists, actualy no idea what to look for in help or anywhere, so I thought, I better ask before I start doing something difficult.

I would like to know how many "weights" there are in a WMA.

For example, if we have the WMA(C,10) I know that the first number is in there once, the second twice, and the last one 10 times.

That means there are a total of 55 "weights" in a 10 bar WMA.

Is there an easy way to know these numbers ? Or an easy way to calculate it ?

Your example just demonstrated that the counting of the weights is just the Sum of the series. So for a 20 element series, just sum the series again an you have your number.

Great ! Thank you very much. I am honestly not sure what your code does but that will come when I get some more understanding of AFL but I can see in your output that it is doing exactly what I want it do do.

So thank you very much, it was exactly what I was looking for.

Using this I can calculate what a price needs to be for a WMA to cross my buy limit. With these numbers I can calculate the weight of the last bar, and then, using a 1 period shorter WMA, what the price needs to be. I can then create buy stops for the next bar, hoping ofcourse that the close will also be above the buy limit but that is another story

I allready did it manualy, for a 50 bar WMA, but I wanted to optimize and use that buy limit.

I had the feeling there would be some math way to solve my problem. Unfortunatly I never learned math so I always have to use the difficult solutions so thanks