Chart Scanner on Bollinger Bands

Q:  I want the scanner to tell me which symbols on the quote list has price above/below the first band in a 20 day BB study (above +1 Std , below -1 Std).

A:  This example will walk you through the steps.

1)  Create a quote page of symbols to scan.   In this example the vendor’s symbol list is used, but a custom list could have been used.  Here is the vendor list and quote page.

2) Open a daily chart for each symbol to verify the chart is complete. Refreshed the chart if needed. Charts can then be closed.

3) On one chart, put on a Bollinger band and configure it for a 20 Average and 1 multiplier. Now add a DYO configured this way to test for Close exceeding either upper or lower bands.

Variable [8] has the upper band value, [9] has the lower band value, and [3] is the flag that is True when close exceeds either band.  These 2 studies are then saved as a template named BollingerTest.

4) Open Setup | Chart Scanner, and configure the form like this.

Name this setup Bollinger and use the Save button to remember these settings after filling in the form. That way it can be retrieved.

The box to use the Vendor quote page for eSignal is checked. Load each chart with the BollingerTest template. Chart time frame is Daily.

The Criteria for adding to the report is when Variable [3] is True.  [3] was set by the DYO.

The report will have 4 columns with labels Symbol, Close, Upper, Lower. The format is caption = value.  [$S] is the token for showing the chart symbol. [$C] is the token for the Close price.  [8] and [9] are variables populated by the DYO for the upper and lower Bollinger bands.

5)  Now, click the Run Scanner button and get a report of results like this.

Of the symbols on the quote list, 7 triggered the criteria. AAPL Close is 587.45 which exceeded the Upper Bollinger band.   Here is the AAPL chart as confirmation.

The price has moved a few cents from when the scan was run and the chart image captured for this example.

Study Values in Sections

Q:  How can I have a DYO display study values at the bottom of the chart?  Basically what I want to do is instead of having the show values window appear on the left side of the chart I would like the values to be displayed in the DYO field sections of their respective DYO’s to save screen real estate.

A:   This DYO will show current study values in sections at the bottom of the chart. These are current values that will update tick by tick. They are not study values aligned for where the mouse is.

A – Read a study value and show the label with a blue background and white font. The label has |1| to indicate the location is the 1st section.

B – Read another study value and show with a brown background. The label has |2| to locate the text in the 2nd section.   [B.2] is the value from Row B formatted to show 2 decimals.

A DYO like this can show values in 7 different sections that exist at the bottom of a chart. Use the section tags |1| through |7|.

Where Files are Saved

Q:  There needs to be a better explanation about how to save charts, save layouts, and using the backup folder.

A:  Although the answer and examples will use Ensign 10 folders and paths, the information is applicable to Ensign Windows.

Charts:  When a chart is opened from the charts form or from a quote page, the process reads the chart’s property file (if one exits), loads the chart’s data file and brings the bars on the chart current by extracting from database files, and then dresses the chart with study and draw tool objects.   If a chart is being opened for the first time, it will not have a property file, and so the default C:/Ensign10/Inifile/Chart.ini file is read.  Chart property files are located in the C:/Ensign10/Property folder using the chart symbol in the filename.

Studies and Draw Tools that belong to the chart are located in the C:/Ensign10/Study folder and use the chart symbol in the filename.

Layouts:  When a layout is opened, the layout script contains information about which forms to open, where to position them, and how to dress the charts with studies and tools.  The layout file possesses the chart properties, and the chart objects.  Thus, a chart opened by a layout does not read from the C:/Ensign10/Property folder nor from the C:/Ensign10/Study folder.   Layout files are located in the C:/Ensign10/Layout folder with a sub-folder for each of the eight layout form tabs.

The layout file is saved when you use the Save or Save As buttons on the layout form.  You should resave layouts using different names when you are evolving your layout content so that you have an earlier version of the layout if you experience a difficulty.

The pop-up menu for Save Layout (hot key CTRL+W) executes the same code as the Save button on the Layout form.

Templates:  Templates are a collection of studies and draw tool objects that are stored as a file so the collection can be applied to a chart.  Template files are located in the C:/Ensign10/Templates folder with a sub-folder for each of the eight template form tabs. 

Template files are saved when you use the Save or Save As buttons on the template form.  You should resave templates using different names when you are evolving your template content so that you have an earlier version of the template if you experience a difficulty and want to return to an earlier version.

Backups:  You are encouraged to have the Setup | System option checked to Backup Templates on Exit.  This backup feature will backup several important folders, including layouts.  Upon program exit, important files will be copied to the folder C:/Ensign10/AutoBackup which has sub-folders for each day of the week.  Thus, there could be a useful image of your files from Monday if they need to be restored on Wednesday.

Another backup and restore feature is found on the Setup | System | Maintenance form.  Perform task #14 to create an extensive backup to folder C:/Ensign10Backup.  And performing task #15 would restore this backup from the same folder.  This manual backup image is more extensive and is independent of the backup made on program exit.

The backups are accomplished by copying files.  Thus any file could be restored by using Windows Explorer to copy the file from the backup location to its appropriate folder under the C:/Ensign10 folder.

Undelete:  The chart objects form has an Undelete button which when clicked will restore the last deleted chart object.   The undelete is accomplished by reloading a template of the chart objects that was saved in a C:/Ensign10/Backup folder prior to the deletion.   Though this was intended for use by Ensign 10 behind the scene, this folder might have a useful copy of how a chart was dressed with studies and draw tools if a template file is accidentally deleted or corrupted in the C:/Ensign10/Templates folder.

Personal Backups:  Trading is a serious endeavor, and should be treated as such.  You should make your own backups to devices which are separate from the computer’s hard disk.   I recommend a free program called EZBackitup and use it on a daily basis to back up important files and folders to an external hard disk or to jump drives.  It is easy to create a backup script by dragging files or folders from a navigation tree to the backup list.  Jump drives are inexpensive, so I backup to a different one each day of the week.

Gann 2-Bar Swings

CH Choong: ‘Despite Gann’s reputation for the many esoteric studies that he used to make his trading decisions, here is one study, the Gann’s mechanical trend indicator that is easy to understand and straightforward that works across all time frames. Recently, a couple of traders who are interested in Gann Swings asked me to share with them the basic of x-Bar Swings rules and I felt compelled to highlight some basic qualifications of Gann x-Bar Swings that is available in Ensign Windows and Ensign 10. While the rules govern the x-bar Swings may be slightly different, the results are virtually the same over the long term.

What is a Gann Swing Chart?

One of the simplest of Gann’s methodologies is the use of a swing chart pattern as a study of market swings that takes advantage of the tendency for prices to ebb and flow in the short-term. The construction of a swing chart results in what Gann called a trend line indicator that is based on price movement on a bar-by-bar that is constantly evolving. And I have this to say that it is a good and simple price based method for objectively defining market short-term price direction, whether the trend in force is likely to continue or is there a sign of a reversal are present and for any pullback analysis with noticeable price pattern (between 1 and 3-days/bars or periods) in an underlying strong trend. Using the high and low for the price bar or period, whichever exceeds the previous x-bar or x-period becomes the trend line indicator.

In a nutshell, market swings are the true reflection of price movement and that means we can all know that “Price tells the trend”. It’s the simplest way to keep our mind focused on market direction at the beginning of a new swing and exiting at or near the end of that swing to await the development of a new swing trading opportunity. And finally, swing charts help filter out market noise with significant swing pivot highs and swing pivot lows as peaks and valleys on the chart for easier identification of support and resistance, especially with price levels traders.

I have listed the qualifications of a 2-Bar Swings below and I hope it helps you re-discover this simple and effective method for defining market trend that is purely based on price behaviors without any optimization.

Qualifications of 2-Bar Swings.

From downswing to upswing: Two-consecutives bars or periods of higher highs will start the upswing.

From upswing to downswings: Two-consecutives bars or periods of lower lows will start the downswing.

Inside bar:  All inside bars, including equal high or equal low inside bars, are neutral and they are not counted. We are only interested in price making x-bar higher highs for upswing and price making x-bar lower lows for downswing.

Outside bar:  From downswing to upswing: Outside bar close must be above prior bar high to be valid as 1st upswing.

From upswing to downswing: Outside bar close must be below prior bar low to be valid as 1st downswing.

Special Case with breakout of nearest swing pivot high or swing pivot low:
This option takes large price movements into consideration if the high or low of a swing pivot is broken before the set number of x-bars has occurred.

For example, with 2-bar Swings, an extreme price range occurs on the 1st upswing or 1st downswing. Normally this would not be considered until the 2nd bar/period had formed to make a complete swing pivot where as the breakout rule takes this extreme price movement into consideration straight away. If not, we will missed the significant swing pivot high or low.’

Examples of 2-Bar Swings and 3-Bar Swings

Market Trends from 2-Bar Swings

2-bar swings require 2 higher highs or 2 lower lows without an interrupting counter move.  They are an indication that the underlying trend may change or simply a correction swing (between 1-period and 3-period) and the trend will continue when price breaks the nearest peak or valley.  With more than 3 consecutive sets of swing periods, either up swings or down swings, a high probability trade change has evolved at least temporarily.

Trend Change Swings

Up Trend and Down Trend

Gann x-Bar Swings

Swing trading takes advantage of the tendency for prices to ebb and flow in the short-term, to move in directions against the trend, and to reestablish that trend again.  Wait for the counter trends to occur and then trade in the direction of the trend.

One of the simplest of Gann’s methodologies is the use of swing chart patterns as a study of market swings.  The construction of a swing chart results in what Gann called a trend line indicator.  Using the high and low for the period, whichever exceeds the previous period becomes the trend line indicator.  Market swings are the true reflection of price movement and that means we can all know that ‘Price tells the trend’.  It’s the simplest way to keep our mind focused on market direction at the beginning of a new swing and exiting at or near the end of that swing to await the development of a new swing trading opportunity.

The illustration shows a 2-bar swing concept.  A 2-bar swing chart measures swings only after the market has made two higher highs or two lower lows without an interrupting counter move.   A 3-bar swing chart requires three higher highs and three lower lows.

Swing Chart Rules

Gann swings are shown in Ensign using the Pesavento Patterns draw tool.   Go to the Pesavento Patterns property form and change the Study Mode to one of the 5 Gann selections.  Ensign can display 1-bar swings through 5-bar swings.

The Gann swings look like this 2-bar swing example.  The counts are shown using the colors selected for the Up Trend Marker and the Down Trend Marker.  The Pesavento Patterns, Support and Resistance levels, and Fibonacci levels can optionally be added to the swings.

Gann Swing Chart

Object Files in Time Frame Change

Q:  I have multiple currency charts in a stack. I use a time group to simultaneously switch them all from 20 min to 240 min, daily and weekly.   I add draw tools to each chart in each time frame and because I save the layout often the layout will potentially save all charts in either the 20, 240, daily or weekly timeframe.

I send the layout file to many students and members. They have confirmed that opening the layout file they see my stacks/charts etc BUT only the lines for the timeframe that was visible when the layout file was saved. So, if the layout file was saved showing the 20 min charts then the recipient does indeed see all 20 min lines, pitchforks, commentary etc BUT when they switch to the 240, daily or weekly timeframes they see blank charts.

 I suspect those lines are included in the files in the study folder but I don’t know how to ‘include’ those drawing objects. In short all I am trying to do is share my layout so that members/students can see drawing objects on each time frame.  Can you advise?

I am happy to include studies files or other files/folders in a package which I can share with them if need be. The requirement obviously being that my lines do not wipe out their existing lines in their own layouts.

A: The layout file controls which charts open, where to position them, and how to dress them. That is what you see for the 20 min charts if the layout was saved with the 20 min charts showing.  The work you do on other charts in the symbol or time frame change is not saved in the layout.  However, those objects are saved in other files found in the Study folder. These other files have an ‘_ ‘ character preceding the filename as in this example.

The _ES #F.5 and the _ES #F.30 would be 2 such files that were made by symbol or time frame change while in the layout. You would find similar files for your symbols in the other time frames you mention. Package these files with your layout for distribution to your students. Use the package feature as that method of installation by the students will put the files in the correct folders.

However, installation of your files will overwrite any files the users created for their own objects. I do not have a way for the chart to combine both your draw tools and their own draw tools.

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 

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.

Moving Average on Volume

Q:  In 1988 I had the first Knight Ridder Tradestation and I was able to do something that was pretty neat but I have never seen it since the demise of KR.  I could plot moving averages of volume and then display them on top of price. Using Fib numbers for the MA’s it gave very interesting wave structures and knowing this was a volume push was a powerful indicator.  Is there a way to do this in Ensign?

A:  Yes.   Change the Data Point for the Moving Average study to reference Volume.