Home    |    Trading Alchemy Manual    |    Alchemy Functions Index

AlchemyPivotStopFC (Function)

AlchemyPivotStopFC is a multiple-output fast calculation function that provides the real time swing high, swing low, trend and pivot stop of the Alchemy PivotStop indicator.

AlchemyPivotStopFC ( UseStrategyEntries,EntrTime,EntrDate_YYYYMMDD,LongStop,ShrtStop,RetrPivLength,MinRetrPercent,MinimumPenetration,NewSwingDistFactor,NewSwingDistLength,oHigh,oLow,oLongStop,oShortStop );

Parameters

 

UseStrategyEntries

When set to true, the function automatically detects a strategy position and starts a new swing calculation starting with the entry bar.  Please note that in order to utilize a continuous calculation or when this function is not being used in conjunction with an entry strategy, this input needs to be set to false.

EntrTime

Specifies the time of the first bar from when the function will start calculating the pivot trailing stops.  The time format is in military time (e.g. 1:00pm=1300).  This input is ignored on daily, weekly and monthly charts.  In order for the function to start calculating the pivot trailing stops from the beginning of the chart, both, EntrTime and EntrDate have to be set to 0.

EntrDate_YYYYMMDD

Specifies the date of the first bar from when the function will start calculating the pivot trailing stops.  The date format is as follows:  Year-Month-Day (e.g. 20010510 = May 5th, 2001).  If applied on a Daily, Weekly or Monthly chart, a setting of 0 will disable the pivot trailing stop.    In order for the function to start calculating the pivot trailing stops from the beginning of the chart, both, EntrTime and EntrDate have to be set to 0.

LongStop Enables/disables the pivot trailing stop for a long entry.  A setting of "True" enables the pivot trailing stop for a long entry and a setting of "False" disables the pivot trailing stop for a long entry.
ShrtStop

Enables/disables the pivot trailing stop for a short entry.  A setting of "True" enables the pivot trailing stop for a short entry and a setting of "False" disables the pivot trailing stop for a short entry.

RetrPivLength Specifies the minimum requirement for number of bars making lower highs following a swing high in an uptrend or making higher lows following a swing low in a downtrend, in order to qualifiy for a retracement pivot.
MinRetrPercent Specifies the minimum required retracement percent for a qualifying retracement pivot, whereas a setting of 0 disables this requirement.
MinimumPenetration Specifies the minimum cent, tick or pip distance for the price to penetrate through a previous retracement pivot in order for the trend to change.
NewSwingDistFactor Specifies the minimum required retracement factor for a qualifying retracement pivot of a new swing that is being made, whereas the factor is based on a proprietary ATR calculation.  A setting of 0 disables this requirement.
NewSwingDistLength Specifies the lookback length of the minimum required retracement factor for a qualifying retracement pivot of a new swing that is being made, whereas the factor is based on a proprietary ATR calculation.  A setting of 0 disables this requirement.
oHigh A numeric reference that receives the swing high price.
oLow A numeric reference that receives the swing low price.
oLongStop A numeric reference that receives the pivot long stop price. When the trend is down, this input returns a value of 0.
oShortStop A numeric reference that receives the pivot short stop price. When the trend is up, this input returns a value of 0.

 

Returns

AlchemyPivotStopFC returns a 1 if the current swing is up and it returns a -1 if the current swing is down.  The value for the swing high price is passed by reference back to the variable oHigh.  The value for the swing low price is passed by reference back to the variable oLow.  The value for the pivot long stop price is passed by reference back to the variable oLongStop.  The value for the pivot short stop price is passed by reference back to the variable oShortStop.

Home    |    Trading Alchemy Manual    |    Alchemy Functions Index