Home    |    Trading Alchemy Manual    |    Alchemy Functions Index

AlchemyTrendCatcher (Function)

AlchemyTrendCatcher is a multiple-output function that returns the values of the Alchemy TrendDirection (Alchemy TrendDirection) indicator.

double AlchemyTrendCatcher double Length, double Factor, double MethodType, double UseCloseTrail, double UseCloseStop, double StopAdd, double ConfirmBar, double ConfirmAdd, double ConfirmStop, boolean DetectStrategyPosition, double Trend, double PosHi, boolean oBullConfirm, boolean oBearConfirm )

Parameters

Parameter Name Parameter Type Parameter Description

Length

numeric

Specifies the number of trailing bars to include in the TrendDirection calculation.

Factor

numeric Specifies the TrendDirection sensitivity factor.  For a more long term trend calculation, this factor can be increased and for a more short term trend calculation, this factor can be decreased.

MethodType

numeric

Specifies the calculation method of the TrendDirection and the options are whole numbers from 1 through 4, whereas our Alchemy TrendDirection indicator is hard coded to method type 1

UseCloseTrail numeric Specifies the price to set the trailing distance from.  When set to 1, it uses the close.  When set to 0, it uses the high in an uptrend and the low in a downtrend.  We converted this input in our Alchemy TrendDirection indicator to boolean format true/false.
UseCloseStop numeric Specifies the price to use for changing the trend direction when the trailing stop is penetrated.  When set to 1, it uses the close.  When set to 0, it uses the low in an uptrend and the high in a downtrendWe converted this input in our Alchemy TrendDirection indicator to boolean format true/false.
StopAdd numeric Specifies the minimum distance in number of cents, ticks or pips by which price has to break through the TrendDirection trailing stop in order for the trend to change direction.  With a setting of 0, the trend changes direction when price touches the trailing stop.

ConfirmBar

numeric With ConfirmBar set to 1, the low of the next bar (confirmation bar) has to touch or penetrate the previous TrendDirection stop or the signal bar in order for the TrendDirection to change direction to the downside and vice versa, the high of the next bar (confirmation bar) has to touch or penetrate the previous TrendDirection stop or the signal bar in order for the TrendDirection to change direction to the upside.  With ConfirmBar set to 2, the close of the next bar (confirmation bar) has to touch or penetrate the previous TrendDirection stop or the signal bar in order for the TrendDirection to change direction.  A setting of 0 disables this confirmation feature.

ConfirmAdd

numeric This input works in conjunction with the ConfirmBar input above and it specifies the minimum distance in number of cents, ticks or pips by which price has to break through the TrendDirection trailing stop or the signal bar on the next bar in order for the trend to change direction.  With a setting of 0, the trend changes direction when price touches the trailing stop or the signal bar on the next bar.

ConfirmStop

numeric This input works in conjunction with the ConfirmBar input above and it specifies the price that needs to be touched or penetrated by the confirmation bar.  With ConfirmStop set to 0, the confirmation bar needs to touch or penetrate the previous bar's TrendDirection stop in order for the TrendDirection to change directions.  With ConfirmStop set to 1, the confirmation bar needs to touch or penetrate the low of the previous bar in order for the TrendDirection to change direction to the downside and vice versa, the confirmation bar needs to touch or penetrate the high of the previous bar in order for the TrendDirection to change direction to the upside.  With ConfirmBar set to 2, the confirmation bar needs to touch or penetrate the close of the previous bar in order for the TrendDirection to change direction.

DetectStrategyPosition

truefalse With a setting of 1, the TrendDirection detects all strategy positions on the chart to stay in sync with these strategy positions.  For example, when the TrendDirection displays bullish and a strategy enters a short position, the TrendDirection automatically reverses to bearish and starts its bearish calculation with this new short entry bar.  A setting of 0 disables this feature.
Trend numericref This is an output variable that returns -1 when the TrendDirection is bearish and 1when the TrendDirection is bullish.
PosHi numericref This is an output variable that returns the highest high in bullish trend since the TrendDirection changed from bearish to bullish and it returns the lowest low in bearish trend since the TrendDirection changed from bullish to bearish.
oBullConfirm truefalseref This is an output variable that returns true when there is a confirmed bullish TrendDirection reversal.
oBearConfirm truefalseref This is an output variable that returns true when there is a confirmed bearish TrendDirection reversal.

 

Home    |    Trading Alchemy Manual    |    Alchemy Functions Index