Home    |    Trading Alchemy Manual    |    Alchemy Functions Index

AlchemyPriceRatio (Function)

AlchemyPriceRatio returns the price ratio between 2 data series applied on the same chart by dividing the specified dividend price by the specified divisor price.

AlchemyPriceRatio (DividendPriceType,DividendDataSeriesNumber,DivisorPriceType,DivisorDataSeriesNumber)

Parameters

DividendPriceType

A numeric series input which specifies the price for the dividend price, whereas a setting of 0 or 4 uses the close of the specified data series, a setting of 1 uses the open of the specified data series, a setting of 2 uses the high of the specified data series, a setting of 3 uses the low of the specified data series, a setting of 4 uses the close of the specified data series, a setting of 5 uses the volume of the specified data series, a setting of 6 uses the up ticks of the specified data series, a setting of 7 uses the down ticks of the specified data series and a setting of 8 uses the ticks of the specified data series.

DividendDataSeriesNumber A numeric series input which specifies the data series number for the dividend price, whereas a setting of 0 automatically uses data series number 1.

DivisorPriceType

A numeric series input which specifies the price for the divisor price, whereas a setting of 0 uses the same price type as specified with the DividendPriceType input, a setting of 1 uses the open of the specified data series, a setting of 2 uses the high of the specified data series, a setting of 3 uses the low of the specified data series, a setting of 4 uses the close of the specified data series, a setting of 5 uses the volume of the specified data series, a setting of 6 uses the up ticks of the specified data series, a setting of 7 uses the down ticks of the specified data series and a setting of 8 uses the ticks of the specified data series.
DivisorDataSeriesNumber A numeric series input which specifies the data series number for the divisor price, whereas a negative setting disables the price ratio and returns the dividend price and a setting of 0 automatically uses the next higher data series number as specified for the dividend price.

 

Returns

AlchemyPriceRatio returns the price ratio between 2 data series applied on the same chart by dividing the specified dividend price by the specified divisor price.

Usage

The AlchemyPriceRatio function returns the price ratio between 2 data series applied on the same chart by dividing the specified dividend price by the specified divisor price and it can replace any price series input of a function, indicator or strategy.  For example, for plotting a moving average of the closing price ratio between data series 1 and data series 2, the moving average indicator Price input close can be replaced with AlchemyPriceRatio(0,0,0,0).

Home    |    Trading Alchemy Manual    |    Alchemy Functions Index