Home    |    Trading Alchemy Manual    |    Alchemy Functions Index

AlchemyXFactoredAvg (Function)

AlchemyXFactoredAvg function is a weighted moving average of the prices of the last length bars. This function returns the current value of the exponentially smoothed moving average using either number of trailing bars or a smoothing factor percentage.

AlchemyXFactoredAvg (FirstBar, Price, Length, Factor)

Parameters

FirstBar

Specifies the bar number of the first bar calculated

Price

Specifies which price of the asset to be used

Length

Specifies the number of bars to consider. 0 uses the smoothing factor determined in Factor.

Factor

Smoothing factor percentage to consider. 0 uses number of trailing bars determined in Length.

 

Returns

A numeric value containing the weighted average of the last Length bars.

Usage

When this moving average is calculated, every bar’s price in the data file will have an effect on the current average. The effects of the first price will never be completely removed, but its weight will continuously shrink as more and more averages are calculated.

Home    |    Trading Alchemy Manual    |    Alchemy Functions Index