Home    |    Trading Alchemy Manual    |    Alchemy Functions Index

AlchemyPivRetrace (Function)

AlchemyPivRetrace is a multiple-output function that provides the real time swing high, swing low and its corresponding Fibonacci retracements based on the swing calculations of the Alchemy PivotRetrace indicator.

AlchemyPivRetrace ( BegTime, BegDate, DayStart, R1, R2, R3, R4, MinRetr, InSwg, PivStren, MinPen, oSwing, oSwingHi, oSwingLo, oCurrRetr, oRetr1, oRetr2, oRetr3, oRetr4 );

Parameters

 

BegTime

Specifies the time of the first bar of the swing calculation.  The time format is in military time (e.g. 1:00pm=1300).  A setting of 0 will start calculating the swing with the first bar on the chart.

BegDate

Specifies the date of the first bar of the swing calculation.  The date format is as follows:  Year-Month-Day (e.g. 040903 = September 3rd, 2004).  A setting of 0 will start calculating the swing with the first bar on the chart.

DayStart

A setting of 1 will begin calculating the swings at the beginning of each day, therefore disregarding any previous price action.  A setting of 0 will continuously calculating the swing starting with the first bar on the chart.

R1 Specifies the 1st retracement percentage, whereas 100% is expressed as 100.
R2 Specifies the 2nd retracement percentage, whereas 100% is expressed as 100.
R3 Specifies the 3rd retracement percentage, whereas 100% is expressed as 100.
R4 Specifies the 4th retracement percentage, whereas 100% is expressed as 100.
MinRetr Specifies the minimum retracement point/dollar value of a retracement for a new swing to qualify.
InSwg Specifies the minimum point/dollar range of each swing.
PivStren Specifies the minimum required number of retracement bars for a new swing to qualify.
MinPen Specifies the minimum point/dollar value by which the most recent retracement pivot needs to be penetrated in order for a trend change to occur.
oSwing A numeric reference that receives the current swing range.
oSwingHi A numeric reference that receives the price of the current swing high.
oSwingLo A numeric reference that receives the price of the current swing low.
oCurrRetr A numeric reference that receives the current retracement percentage.
oRetr1 A numeric reference that receives the price of the 1st Fibonacci retracement.
oRetr2 A numeric reference that receives the price of the 2nd Fibonacci retracement.
oRetr3 A numeric reference that receives the price of the 3rd Fibonacci retracement.
oRetr4 A numeric reference that receives the price of the 4th Fibonacci retracement.

 

Returns

AlchemyPivRetrace returns a 1 if the current swing is up and it returns a -1 if the current swing is down.  The value for the current swing range is passed by reference back to the variable oSwing.  The value for the price of the current swing high is passed by reference back to the variable oSwingHi.  The value for the price of the current swing low is passed by reference back to the variable oSwingLo.  The value for the current retracement percentage is passed by reference back to the variable oCurrRetr.  The value for the price of the 1st fibonacci retracement is passed by reference back to the variable oRetr1.  The value for the price of the 2nd fibonacci retracement is passed by reference back to the variable oRetr2.  The value for the price of the 3rd fibonacci retracement is passed by reference back to the variable oRetr3.  The value for the price of the 4th fibonacci retracement is passed by reference back to the variable oRetr4.

Usage

Leonardo Fibonacci was a mathematician born in 12th century Italy. He is credited with discovering a mathematical principal in which a series of numbers, two of which are added together, will add up to the next number of the series. For example: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc.

This is a series of numbers in which every number has a relationship with the number following it, the number preceding it, as well as every other number in the series. By dividing any larger number by the following larger number you will get approximately 61.8%. So each number is approximately 61.8% of the number following it.

There are many other mathematical relationships possible, but the primary percentages that concern us in technical trading are 23.6%, 38.2%, 50% and 61.8%. These Fibonacci numbers have been rounded for simplicity sake to 25%, 38%, 50%, and 62% for purposes of determining Fibonacci retracements.

In studies of past markets it has been determined that after price makes a significant move and begins to retrace or correct, it tends to move to the levels of 25%, 38%, 50% or 62% of the previous significant move. When price moves to one of the levels and stops, you have a high probability the correction is over and the primary move will resume. Note that the direction of the primary move can be in either direction, up or down. The direction of the primary move is not a factor. In a primary down move, the direction of the correction would be up. In a primary up move, the direction of the correction would be down. The key to using and applying Fibonacci retracement levels is identifying the primary move and calculating the proper retracement levels.

The AlchemyPivRetrace function automatically calculates the primary trends and its corresponding retracement levels in real-time.

 

Home    |    Trading Alchemy Manual    |    Alchemy Functions Index