ESPL: Security Name on Chart

Q:  I would like to see the security name at the top left of the chart.  I know it shows in the title, but that is too small.  Can this be done and automated to show in a bigger format?

A:  This ESPL script will add the security name to the chart which has focus.  Click the ESPL button #9 to add a note object containing the security name.   Here is the ESPL script which automates the process.

  if ESPL = 9 then begin
    FindWindow( eChart);
    sSymbol := GetVariable( eSymbol );
    Find( eIQFeed, sSymbol );
    sName := GetData( eName );
    AddNote( sName, 4, -10, -10, 0 );

The FindWindow will locate the chart which has focus.
GetVariable will read the chart’s symbol.
Find will locate the quote record for the symbol.
GetData will read the security name such as is provided by IQFeed.
AddNote will create an object to be owned by the chart.

The 1st parameter is the text string to show.
The 2nd parameter is the tab number used for  properties. Go set up tab 4 to have Pinned unchecked, and select the color and font size for the note.
The 3rd parameter is the horizontal location.  A negative number represents the pixel position on the chart from the left edge. This starts the note at pixel 10.
The 4th parameter is the vertical location.  A negative number represents the vertical pixel position on the chart from the top edge. The example puts the note down 10 pixels.
The 5th parameter is the window location, and 0 selects the chart.

ESPL: Sum Volume for a Swing

Q:  How can I determine the volume for a swing, or the volume between two bars on the chart?

A:  I will illustrate 3 ways in my answer.  The first way is to use the Pesavento Patterns study and change the Marker to the VOL selection, which will sum the volume for a swing.  This tool is automatic in picking the swing points.

The 2nd suggestion is to put on a Draw Line with the same VOL marker and the total volume in the bars spanned by the draw line will be printed at the end of the line.  See an example of the draw line’s volume in the next image.

The 3rd suggestion is to use the ESPL programming language, and sum the volume in a loop between two index locations on the chart.  The example will use two index points from the Pesavento Patterns study.  Any two index points could be used.

Line 12 finds the chart.  Line 13 finds the Pesavento Patterns study.  Lines 14 and 15 find the two indexes for the prior swing.   Line 16 writes the total volume to the output window.

The total volume is summed by the Function SumVolume which loops through the bars between the two indexes passed as parameters and adds each bar’s volume to the total.

Square the Chart Value

Q:  I’m experimenting with “Square Charts”. It would be helpful to add some geometric drawing tools to determine best fit and know the points/bar value for use with “Square Chart”.

A:  The tool to use is the Gann Fan with the Slope showing at the vertex.  Use that value as the Pts/Bar on the Square Chart.  This slope shows the rate of change of the 1×1 line.

In this example, the Gann Fan placed manually shows a slope of 0.22 pts/bar down.  A good value for squaring the chart would be the nearest multiple of price interval, which would be 0.25 pts/bar.

ESPL: Event Redirection

Q:  How can ESPL be notified when the Ensign program is closing so that information can be saved before the program closes?

A:  Redirect the OnCloseQuery event for the main Ensign form to an ESPL procedure which performs the clean-up tasks such as saving information.  The main Ensign form is referenced with the component named   frmMain.   This example will print a message in the Output window when Ensign closes.

procedure ShutDown;
  if ESPL = 3 then
    frmMain.OnCloseQuery := 'ShutDown';
Cick ESPL button 3 to establish the redirection of the OnCloseQuery event.  Then when Ensign exits, the OnCloseQuery event fires and executes the ESPL ShutDown procedure which displays ‘Exiting’ in the Output window.  Ensign continues its exit process and closes down.

Chart Objects Not Preserved in Layout

Q:  I opened a 5-minute chart, added some lines, changed time frames to a 30-minute chart,  added lines to the 30-min chart and then saved as a layout.   On opening the layout the 30-min chart shows the lines, but when changing time frames to the 5-min chart, the lines are missing.  What happened?

A:  The issue is whether lines were saved BEFORE or AFTER the chart was saved as a layout.   When you added lines to the 5-minute chart, you were working with solo charts, and they save their objects in the Study folder using the chart symbol and time frame as the file name.   For the sake of discussion we will call this file  AA.

When you saved the layout, the program set a LAYOUT flag which changes the object filenames to add a ‘_’ prefix character.  That way layout files do not compete with or overwrite the files used by solo charts.  For the sake of discussion we will call this file BB.

When you open the layout, it loads the layout file and that shows the 30-min chart and how it was last dressed.  When you change to the 5-min file, it looks for its BB file and not its AA file.  The BB file does not exist and that is why the lines you added are missing.  The 5-min chart lines were saved in the AA file, because they were saved before a layout was started.

The way to avoid this issue is to save or open a layout so the Layout flag is set, and then add your studies and lines.  The objects will be saved in the BB files which have the ‘_’ prefix.  Also save the layout after making changes to any charts.   

The objects saved in solo chart mode might still be recoverable for use in a layout in this manner.

Look at the Study folder which holds the objects.  There you will find two types of files, the  AA  names referred to in this discussion are the non-layout files for solo charts.  The BB names referred to in the discussion have a prefix of ‘_’  ahead of the symbol and time frame.  The red arrows point to two examples.  

Names without ‘_’ prefix were saved before you entered layout mode.   You could possibly recover your solo chart objects for use in a layout by appending the ‘_’ to the name by using Windows Explorer and selecting Rename on the pop-up menu.

Paul Coghlan, of Coghlan Capital, recorded a 5-minute video which describes the process and has given permission for his video to be included in this blog article.  Thank you Paul.

Click this link to watch Paul’s video:   Recover Objects 

Bradley Stock Market Model 2012

Larry Pesavento: ‘Donald Bradley published a book in 1946 titled Stock Market Prediction!  The science behind this book was the premise that planetary pairs such as Venus and Uranus have a positive or negative bias in the market. By assigning points to these biases he was able to produce a graph that gave a prediction for what the stock market would do for the coming year. Originally the booklet sold for four dollars and was almost impossible to find until 1987 when I published my first book Astro Cycles, the Traders Viewpoint. Shortly thereafter many people began to publish the Bradley model.  Some made changes in how the planets should be calculated as to their being positive or negative weighting and by how much. I have always used the method described by Bradley.  

I discovered the book through my mentor Dr. Ruth Miller in 1986. With the help of Jim Twentyman and Dr. Miller we ran the Bradley model on every year of the stock market from 1876 to the present. 1876 was 10 years after the Civil War in the first year that accurate stock market data was published in newspapers primarily in New York and Chicago. The Bradley model is based on combinations of planetary cycles. Bradley composed a matrix with all of the planets on the X-axis and all of the planets on the Y-axis. When these planetary pairs combined in a positive mode it was given a positive energy number. The opposite was true for negative planetary number. For example, Venus makes a conjunction, i.e. 0°, every 255 days with the planet Uranus. When it is in opposition, i.e. 180°, it is half way through the cycle. Bradley used commonly known positive or negative effects from traditional astrology to build a chart of what the stock market should do for the coming year. This model can be drawn hundreds of years in advance. It is useful as a training tool for two particular technical aspects. First, the Bradley dates themselves show when terms are due for trend changes. The Bradley model is also good for short-term indications of trend. This is probably an oversimplification of how it works but the key thing to remember is it is based on nothing but numbers. There are no zodiac signs or interpretations involved, just numbers.

As you can see from the first chart I inverted the Bradley model to give an indication of what is happening now as we start the new year. The second chart shows the forecast

Today’s chart gives an idea of what the stock market is supposed to do for 2012.  Realize that this is just a prediction based in planetary positions and not a certainty.  I’ve also included the year 2009 to show you how accurate the market was in predicting the down move in the stock market and the exact day of the bottom March 5, 2009.

Bradley’s model is best used as a guideline for trend analysis. For example, the stock market is supposed to be in an uptrend for several months starting in January based on the Bradley model. As long as it is continuing along this path the model has a great deal of value. However, if the market continues downward, the model has less influence as a trading vehicle. The overall trend for 2012 looks to be to the downside, especially after the spring rally if a spring rally occurs. Money management and risk control take precedent over any prediction made by anyone, including and especially the author.’

Bradley Stock Market Model 2009

Bradley Stock Market Model 2012

Hot Keys for Draw Tools & Studies

Q:  I used to be a ~~~ user and while Ensign is far superior in nearly every way the one thing I miss is the ability to use hot keys.  I know you have some hotkey functionality for studies but for my particular needs I would want them for drawing tools.  I wonder if this functionality could be add to your to do list? 

A:  Your request has been implemented in the latest version of E10.  Go to Setup | Charts to assign the hot keys you want for Draw Tools and Studies.

The example shows upper case L is now assigned to initiate a Draw Line tool.   You would press L and then move the mouse and click on the tool’s construction points.
And here are the default key assignments for Studies, but now they can be changed by the user.

Chart to Show on All Layers

Q:  Is there a way in E10 to maintain a chart in Layer 1 and display the same chart with all the same drawing lines & fibs in another layer, say layer 3?  What I want to do is maintain the chart once and display exactly the same chart in a different layer.

A:  Yes.   Go to Setup | System and select a layer to Pin.   Select as the pinned layer something like layer 9.   Now select layer 9 and add content such as the chart you want to show when viewing other layers.   Any content you put on the pinned layer will continue to show on all layers.

VIX Index of Volatility

Larry Pesavento: ‘The VIX index tries to find markets that are overbought and oversold by using the amount of volatility that speculators are willing to assume. When volatility is high there is a great deal of fear in the market. When volatility is low, investors are complacent and not worried about sudden changes in stock movement. This index is probably one of the more difficult trading vehicles as it will sometimes not react to what prices are actually doing. This is not to say it will not work.  What it is saying is that it might not work exactly at the same correlation the trader is looking for in his analysis. The VIX index follows the patterns incredibly well and is tradable, but only for seasoned veterans or those that study the market dynamics for the index itself. As you can see from the enclosed chart it does show very nice symmetrical patterns that can be measured and predicted within limits. At this particular time the VIX index is coming back into the first level of the breakout that occurred in late August and early October. This should find support as it is also an important lightning bolt AB=CD pattern and a 0.786 retracement of the whole move up.

As always it is good to use sound money management and risk assessment when trading anything.  This is especially true with the VIX index because it moves so rapidly that it offers great potential for profits and equally painful losses.’

5-Minute Bar Sets Hourly High or Low

Q:  How do you design an alert when a 5 minute bar is either the high for the last hour or the low for the last hour?

A:  Here is an example where the high and low of the last twelve 5-minute bars is found and then tested to see if the current bar is setting that value.   12 bars were used on the 5-minute chart because that amounts to the last hour.