Syntax
Public Function MovingAverageEnvelope(chart_ID As Long, applyTo As ENUM_APPLIED_PRICE, period As Integer, Ma As ENUM_MA_METHOD, Shift As Double) As String
Description
Moving Average Envelopes consist of moving averages calculated from the underling price, shifted up and down by a fixed percentage.
Moving Average Envelopes (or trading bands) can be imposed over an actual price or another indicator.
When prices raise above the upper band or fall below the lower band, a change in direction may occur when the price penetrates the band after a small reversal from the opposite direction.
Parameters
Key | Description |
chart_ID | Chart identifier, 0 is the current chart ,value of type Long |
applyTo | Applied price ,value of type ENUM_APPLIED_PRICE. |
Period | The calculation period, on which the indicator will be calculated, value of type Integer. |
Ma | Moving average method , can be one of ENUM_MA_METHOD. |
Shift | Horizontalshiftoftheindicator,value of type Double. |
Return value
Returns the handles of a technical indicator, in case of failure returns a empty string.
Sample
Public Sub main()AlertMessage (MovingAverageEnvelope(0,PRICE_CLOSE,14,0,1.0)) 'Draws the indicator on chart & shows an Alert Message with 'the indicator name.End Sub
See Also