Home | Trading Alchemy Manual | Alchemy Functions IndexAlchemyVolatilityPrice (Function)The function AlchemyVolatilityPrice is a multiple-output function that provides the trailing stop value, trend direction and the highest high or lowest low for the newest version of the Alchemy Automatic Volatility Stop indicator (Alchemy VolatStpAuto). AlchemyVolatilityPrice(Price,Length,AvgType,Factor,UseCloseTrail,UseCloseStop,Trend,PosHi) Parameters
|
Price (numericseries) | Specifies the price to be used for the volatility calculation such as truerange, for example |
Length (numericsimple) |
Specifies the trailing bars to consider in the volatility calculation. |
AvgType (numeric) | Specifies the average type for calculating the average price of the trailing bars in the volatility calculation, whereas a value of 1 uses a simple moving average, a value of 2 uses a exponential moving average, a value of 3 uses a weighted moving average, a value of 4 uses a triangular moving average, a value of 5 uses a mid keltner, a value of 6 uses a hull moving average and a value of 7 uses price as specified with the input Price. |
Factor (numericsimple) | Specifies the volatility multiplication factor. |
UseCloseTrail (truefalse) | Specifies whether the trailing stop is based on the close of the bar or on the high of the bar in an up trend and the low of the bar in a down trend, whereas a setting of true uses the close of the bar and a setting of false uses the high/low of the bar. |
UseCloseStop (truefalse) | Specifies whether the trailing stop needs to be taken out by the close of a bar or by the high of a bar in a down trend and by the low of a bar in an up trend in order to change trend. A setting of true uses the close of a bar and a setting of false uses the high/low of a bar. |
Trend (numericref) | A numeric reference that receives 1 if the trend is up and -1 if the trend is down. |
PosHi (numericref) |
A numeric reference that receives the highest high in an uptrend and the lowest low in a down trend. |
ReturnsThe AlchemyVolatilityPrice function returns the trailing stop value for the newest version of the Alchemy Automatic Volatility Stop indicator (Alchemy VolatStpAuto). The value for the trend direction is passed by reference back to the variable Trend. The value for the highest high or lowest low is passed by reference back to the variable PosHi. Home | Trading Alchemy Manual | Alchemy Functions Index |