Simple Moving Average of the specified period for the current bar
 
| Visual Basic | 
Public Function MovingAverage ( _ period As Integer, _ barStyle As RealCodeIndicator..::.BarValue _ ) As RealCodeIndicatorCalculation
- period (Int32)
 - moving average period (in bars)
 
- barStyle (RealCodeIndicator..::.BarValue)
 - Which bar data point to use: Open, High, Low, Close
 
Returns a RealCodeIndicatorCalculation. This allows you to call other functions like AVG,XAVG,STOC,RSI
 plot the 5 bar exponential average of the 30 bar moving average of the high of price
 
CopyVB.NET
plot = price.MovingAverage(30,RealCodeIndicator.BarValue.High).XAVG(5)