NinjaScript > Language Reference > Indicator Methods > Moving Average - Simple (SMA) |
|
Description The Simple Moving Average is calculated by summing the closing prices of the security for a period of time and then dividing this total by the number of time periods. Sometimes called an arithmetic moving average, the SMA is basically the average stock price over time.
Syntax
Return Value double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.
Parameters
Examples
Source Code You can view this indicator method source code by selecting the menu Tools > Edit NinjaScript > Indicator within the NinjaTrader Control Center window. |