Home | Trading Alchemy Manual | Alchemy Functions IndexAlchemyPRTTrlSt (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 |
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. |
ReturnsAlchemyPRTTrlSt 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 |