Home    |    Trading Alchemy Manual    |    Alchemy Functions Index

AlchemyPRTTrlSt (Function)

AlchemyPRTTrlSt is a multiple-output function to be used for trailing stop strategies.  It detects if the current position is either long or short and calculates retracement pivots from the entry point forward.  It returns a +1 if the PivotRetracementTrend is up and a -1 if the PivotRetracementTrend is down.  The value for the swing trend is passed by reference back to the variable oTrend.  The value for the swing high is passed by reference back to the variable oPRTHigh.  The value for the swing high bar number is passed by reference back to the variable oPRTHighBar.  The value for the swing low is passed by reference back to the variable oPRTLow.  The value for the swing low bar number is passed by reference back to the variable oPRTLowBar.  The value for the retracement high is passed by reference back to the variable oRetraceHigh.  The value for the retracement high bar number is passed by reference back to the variable oRHBar.  The value for the retracement low is passed by reference back to the variable oRetraceLow.  The value for the retracement low bar number is passed by reference back to the variable oRLBar.

AlchemyPRTTrlSt(InSwg, MinRetr, RetrLength, MinPen, HTrap, LTrap, oTrend, oPRTHigh, oPRTHighBar, oPRTLow, oPRTLowBar, oRetraceHigh, oRHBar, oRetraceLow, oRLBar)

Parameters

 

InSwg

This input lets you adjust the minimum range of the initial swing from which the PivotRetracementTrend is started.  Once a Retracement High or Low is broken, the range from the Swing High to the Swing Low is considered the Initial Swing until a new Retracement High or Low is created.

MinRetr

This is the minimum required retracement for a Retracement High or Low to be valid.

RetrLength

This is the minimum required number of retracement bars in between 2 swing highs for a valid Retracement Low or the minimum required number of retracement bars in between 2 swing lows for a valid Retracement High.

MinPen Minimum Penetration:  With this input you can tell the function by how much the market needs to break the most recent Retracement High or Low in order for the PivotRetracementTrend to be broken.  This gives you the flexibility to ignore a stop running situation where the market marginally breaks the Retracement Pivot and then resumes the trend.  Change the number in the “MINPEN” input to the exact amount of the break and the AlchemyPRTTrlSt function will ignore the break and resume the PivotRetracementTrend.
HTrap/LTrap

The market sometimes makes a big move up or down without any retracements.  Then it will stay within this range for the rest of the day.  If this initial move is so large that you want to start the pivot retracement trend within this range, you can enter the Swing High number into the “HTRAP” input and the Swing Low number into the “LTRAP” input.  This will ignore the large move and it will look for the next swing and start the retracement pivot trend from this point forward.  The “HTRAP/LTRAP” simply subtracts the High from the Low to come up with the maximum allowed swing.  A setting of HTRAP 27 and LTRAP 0 results in a maximum allowed swing of 27 points.  When you change these inputs, you have to remember to reset them back to their original default values once the market breaks through the range you entered.

oTrend The value for the swing trend is passed by reference back to this variable.
oPRTHigh The value for the swing high is passed by reference back to this variable.
oPRTHighBar The value for the swing high bar number is passed by reference back to this variable.
oPRTLow The value for the swing low is passed by reference back to this variable.
oPRTLowBar The value for the swing low bar number is passed by reference back to this variable.
oRetraceHigh The value for the retracement high is passed by reference back to this variable.
oRHBar The value for the retracement high bar number is passed by reference back to this variable.
oRetraceLow The value for the retracement low is passed by reference back to this variable.
oRLBar The value for the retracement low bar number is passed by reference back to this variable.

 

Returns

AlchemyPRTTrlSt is a multiple-output function that returns a +1 if the PivotRetracementTrend is up and a -1 if the PivotRetracementTrend is down.  The value for the swing trend is passed by reference back to the variable oTrend.  The value for the swing high is passed by reference back to the variable oPRTHigh.  The value for the swing high bar number is passed by reference back to the variable oPRTHighBar.  The value for the swing low is passed by reference back to the variable oPRTLow.  The value for the swing low bar number is passed by reference back to the variable oPRTLowBar.  The value for the retracement high is passed by reference back to the variable oRetraceHigh.  The value for the retracement high bar number is passed by reference back to the variable oRHBar.  The value for the retracement low is passed by reference back to the variable oRetraceLow.  The value for the retracement low bar number is passed by reference back to the variable oRLBar.

Home    |    Trading Alchemy Manual    |    Alchemy Functions Index