Gold and Silver Index $XAU

Larry Pesavento:  ‘Since December 2010 when the Gold and Silver index $XAU made a 3 drive to a top pattern, an interesting set of patterns has unfolded.   One of the most popular and accurate of all the patterns is the AB=CD pattern, also know as the Thunderbolt.  Three times this pattern has indicted a lower top in the downtrend of 2011.  It is now at the 4th lower top as we enter the last week of January 2012.   Remember that pattern recognition is not an exact methodology, but is a probability based approach that must be used with sound money management techniques and risk control measures.’

William’s Variable Accumulation Distribution

The Williams Variable Accumulation Distribution (WVAD), developed by Larry Williams, is a volume-weighted price momentum indicator.  It measures the buying and selling pressure by calculating the relationship between the number of points the market has moved from the open to close relative to the period’s entire range.  Short positions are taken for a negative moving average value, and Long positions for positive average values.


WVAD = (( Close – Open ) / ( High – Low )) * Volume

The formula can be implemented with a DYO, as shown.   This is available as a package to download from the Ensign web site using the Package feature in Ensign 10.

A – Period for Moving Average (Line D)
B – Implements the formula.    WVAD = (( Close – Open ) / ( High – Low )) * Volume
C – Plot the formula values.  This statement is used because it will plot values that equal zero, whereas plotting directly from line B would not.
D – Simple Moving Average of the WVAD.  Plotted in Red.
F – Mark where the average crosses above zero.  This is the Long signal.
G – Mark where the average crosses below zero.  This is the Short signal.

ESPL: Andrews Pitchfork Parameters

Q:  I’d like to retrieve, using GetStudy() I presume, parameters related to an Andrew’s Pitchfork which is already drawn on a Chart.  I have no problem getting the handle of the Fork, but I can’t figure out what parameter numbers to use.  I see there is supposed to be a block of parameters for Line Colors, from 300 to 310.  Is that where I’d get the line colors?

In what format would that color be returned?  I did get a large integer returned from parameter 300.  Another item I want to retrieve is the Fork Variation.  That is a string in a combo box with the choices, Standard, Schiff and Modified Schiff, as I recall.  Also, if possible I’d like to get the tab selected for the drawing of the object, if that is available. 
A:  Yes, 300 through 310 are the selection parameters to use to get the line colors.   Here is my test script for your review.
The example writes the values returned by GetStudy for 300 to 315.  300 returned the cyan color, and so did 301 in the example.  The color Red is easy to spot as that has a color value of 255, and is returned by 303 and 305, etc.   The colors are integers and contain the RGB bytes, with Red being the low order byte.  Hence, the value 255 is just the color Red at its maximum brightness.
The fork variations selection value is 209.  GetStudy(handle,209);    First selection of Andrews would return 0.  Schiff would return 1.
The TAB selected will be returned using selection 956.   GetStudy(handle,956);    956 will work for all studies and tools to return the tab and the values will be 0 through 14.
Q: Thanks.  I am totally satisfied with what you’ve provided.  Is there an easy way to get the name of the Tab rather than just the number?
A:  Yes, use 957 as the selection value to work with the tab’s text name.  Example: 

   handle := FindStudy(eAndrews);
   writeln( GetStudy(handle, 956) ) ;            // write the current tab number
   writeln( GetStudy(handle, 957) );             // write out the tab’s text name
   SetStudy( handle, 957, ‘NewName’ );      // change the current tab’s text name

Ensign Map and Pesavento Patterns

Q:  I’m a recent subscriber to your software through Larry Pesavento.  I use Ensign Map and was wanting to know how I can tweak a chart with other indicators. I’ve looked at the Pensavento Pattern but I don’t really do much with Fibonacci since I’m not going in and out on an ETF throughout the day.  Is there another one or two technical indicators I should be using to predict where the market is going for the next day or two?

A:  Thank you for using Ensign. The Ensign Map, Pesavento Patterns and other tools are great tools and perhaps unique to Ensign.  Larry has been very helpful in getting tools like these in our software and then promoting them in the seminars he gives.  He uses these tools.

Use the Map with 2 minute charts, and refresh the chart’s data set to have at least 12,000 bars. Check the Maximum Bar setting and Resize Bar setting on the chart property form so the capacity is set to at least 15,000 bars. More is better. Maximum is 65530.

I encourage you to study the Fibonacci material and use the Pesavento Patterns as they are key to how Larry analyses the markets.  He is using the Map tool for time, the Fibonacci Levels for a price objective, and Pesavento Patterns for wave patterns. He is taking trades at the intersection of time and price and using risk money management principles to keep emotion out of the trade.

There is no tool that will predict. However the Map does give a suggestion based on statistics of the time when turns might happen, and Fibonacci Levels is a good tool for where turns will happen.  And I will add to the list the value of a simple trend line drawn under rising trends and above falling trends. Sometimes the simplest things like a trend line work better than all the complex math others use. 

Here is my list of greart articles to read. And read the articles linked to these articles.

Gann 2-Bar Swings

Choong: ‘The simplicity of Gann x-bar Swings as a trend line indicator works much better with products that trend such as the spot forex or futures currency in spotting 1~3 day/bar corrections. When the market is not trending (ie. going sideways) we see the swing line/counts dancing to the tune with 1 upswing, 1 downswing, 1,2 upswings, 1 downswing… back and forth. This is totally different from the percentage zigzag line because x-bar swings track price movement direction and market trends so closely.

(Click on any chart image to show enlarged).

Gann 2-bar Swings work extremely well with EUR.   Here is the EUR H2 5-min chart.

Once again, a big thank you for implementing Gann x-bar swings in Ensign Windows and Ensign 10.’

Euro at a Critical Level

Larry Pesavento: ‘The Euro is at a critical level as we come into trading on January 23. As you can see by the hourly chart of the EUR/USD has reached the 0.618 retracement of the longer price swings in the 0.786 retracement of the smaller price swing. Both of these levels come in at the price of 129.80.

Should the Euro exceed the 130 level it would assume that the trend has changed and the Euro is getting ready to rally for longer-term time, which would not be unexpected as the market has been incredibly oversold over the past weeks and months. By using the drawing tools and isolating the price swings, the Fibonacci numbers can be calculated with the Fibonacci retracement tool or use the Pesavento Patterns tool to give exact numbers for where the Euro might react. As always you must use good money management and stop placement to adequately make your risk control the strongest part of your trading model.

The daily chart for the Euro shows several equals moves that are highlighted in pink rectangles. What this is telling you is that the market is at a critical level and is repeating previous price action. This is valuable information as it tells you when the trend is changing, i.e. breaking out of the previous price range.’

Fibonacci Levels on Log Scale

Q:  When I tick ‘log’ in chart properties, I get different scale numbers for the Fibonacci levels than I do when using ‘price’ scale.  That I expected.   However, when I change the height of the log chart, the Fibonacci numbers change slightly.  Why?

A:  The Fibonacci tool on a log scale is based on graphical distance, such as 50% of the wave’s vertical height.  When on the log scale, we have to reverse engineer a price for the pixel that is in the middle of the wave.  There is not a pixel for every possible price. We have to use a formula to calculate prices based on the scale range and the number of pixels in the range.  When the chart’s height changes, the number of pixels in the range changes which changes the result that is returned.

Take this example, which is simple.  Say the price interval is 10, and there are 3 pixels on the screen for this interval, one at the top, one at the bottom, and one in the middle. 10 divides by 2 intervals nicely to give a midpoint price calculation of 5.  Now increase the height to use 4 pixels.  One at the top, one at the bottom, and 2 in the middle. Now 10 is divided by 3 intervals. The pixels return prices of 3.3333 and 6.667. But there is no pixel to read that happens to fall on 5.

For a regular price scale, the calculation is based solely on price and returns the exact value of $5 in this example.  But for log scale, the program finds the pixel nearest the 50% distance and reverse engineers the pixel’s price which in this case would be 3.333 or 6.667.

Now this example is an extreme case of nearly no resolution with just 3 or 4 pixels. In actual use a chart has dozens of pixels vertically and the log scale will have a pixel very near the intended price.  But there is likely no pixel that is exactly and conveniently on the division point.

In summary, on regular price scale the calculated levels are the exact price. On the log scale, the pixel for where the line is placed computes a price for the pixel position.

ESPL: Creating ESPL DLLs

The Delphi used in this article is Embarcadero Delphi 2010.  Any compiler and language can be used to make a DLL as long as the output is in flat “C”-type format (eg. No Objects, Classes or Strings, being passed as parameters or returned).

Step 1:  Make the DLL in Delphi

Click File | New | Other | Dynamic Link Library

This is the code for a DLL named ESPL_DLL.

library ESPL_DLL;

{$R *.res}

function ESPL_Sum(AValue1: real; AValue2: real): real; stdcall;
  result := AValue1 + AValue2;

function ESPL_Max(AValue1: real; AValue2: real): real; stdcall;
  if (AValue1 >= AValue2) then
    result := AValue1
    result := AValue2;



Step 2:  Make the ESPL Form

Here is the form in Ensign 10’s ESPL IDE, with 2 buttons and a memo component.

Step 3:  Add the source code

{$FORM TfrmMain, Main.sfm}

uses  Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;


function ESPL_Sum(AValue1: real; AValue2: real): real; stdcall; external ‘ESPL_DLL.dll’;

function ESPL_Max(AValue1: real; AValue2: real): real; stdcall; external ‘ESPL_DLL.dll’;

procedure btnSumClick(Sender: TObject);
var rValue: real;
rValue := ESPL_Sum(3.5, 7.2);

procedure btnMaxClick(Sender: TObject);
var rValue: real;
  rValue := ESPL_Max(8.7, 10.1);

procedure frmMainShow(Sender: TObject);


Step 4:  Run the program script

  1. Click the ESPL Run button
  2. Click the Sum button
  3. Click the Max button