Indicators: Moving Averages, MA

 

Moving Averages, MA:

The Moving Average Indicator shows the mean instrument price value for a certain period of time.

Author: MetaQuotes Software Corp.

 
One element is missing, "Price applied to".
 

I needed this fix in another project so I changed a little the code and I decided to upload the result here. I know it is an old topic but still if someone needs this  "Price applied to" added

 
Nikolay Georgiev #:

I needed this fix in another project so I changed a little the code and I decided to upload the result here. I know it is an old topic but still if someone needs this  "Price applied to" added

Thanks dear, just what I needed. I wanted median price in fact, but never mind I will add it myself to the function Price(int shift).
 
Nikolay Georgiev #:

I needed this fix in another project so I changed a little the code and I decided to upload the result here. I know it is an old topic but still if someone needs this  "Price applied to" added

There is a mistake in line 172, the "lsum-=Price(pos);" should be "lsum-=Price(i);" instead. This causes the LWMA doesn't show correctly.

Attached the fixed code. I also added the median price option.

Note: you need to click Go to discussion link to see the attachment.

Indicators: Moving Averages, MA
Indicators: Moving Averages, MA
  • 2005.11.29
  • www.mql5.com
Moving Averages, MA: Author: MetaQuotes Software Corp...
Files:
Reason: