A moving Envelope can be used to automatically find a profit target or stop-loss point based off a percentage from a preferred moving average.
The Moving Average Envelope study calculates a moving average of specified type and length and plots it shifted up and down by a specified percentage. Upper and lower bands can be used as overbought and oversold levels respectively.
INPUT PARAMETERS
Parameter | Description |
displace | The horizontal displacement of the moving average, in bars. Positive values signify a backward displacement. |
length | The number of bars used to calculate the moving average |
pct above | The Percentage of the moving average value for upward shift. |
pct below | The Percentage of the moving average value for downward shift. |
price h | The price usde in calculation of the higher moving average. |
price l | The price used in calculation of the lower moving average. |
average type | The type of moving average to be used in calculation: Simple, exponential, weighted, wilder’s, or hull. |
Plots
Plot | Description |
UpperBand | The Upper Band plot; moving average of the specified type shifted up by the specified percentage. |
LowerBand | The LowerBand plot; moving average of the specified type shifted down by the specified percentage. |
Example with $DIA
The green plot is the UpperBand and the Red is the LowerBand. Each Plot is 3 Percent from a 50 day Simple Moving Average.
Giving 6 Percent from bottom to top or top to bottom.