| double iMACD( |
string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int mode, int shift) |
Calculates the Moving averages convergence/divergence and returns its value. In the systems where OsMA is called MACD Histogram, this indicator is displayed as two lines.
In the Client Terminal, the Moving Average Convergence/Divergence is drawn as a histogram.
Parameters:
| symbol |
- |
Symbol the data of which should be used to calculate indicator. NULL means the current symbol. |
| timeframe |
- |
Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe. |
| fast_ema_period |
- |
Number of periods for fast moving average calculation. |
| slow_ema_period |
- |
Number of periods for slow moving average calculation. |
| signal_period |
- |
Number of periods for signal moving average calculation. |
| applied_price |
- |
Applied price. It can be any of Applied price enumeration values. |
| mode |
- |
Indicator line index. It can be any of the Indicators line identifiers enumeration value. |
| shift |
- |
Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago). |
Sample:
if(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0)) return(0);
|