Design Your Own™

Ensign Windows has a powerful feature for designing your own studies.   Use this feature to implement the logic for a study, or create special visual effects.   There are hundreds of operations available divided into 16 categories.   Use the drop down boxes on the form to select an operation to implement a study's mathematics or logic.  Several examples are illustrated on this page.   Please read the information about Global Variables.
B-Swing

The B-Swing uses two Keltner channels to create the visual of the gray bands.   The Auto Trends study places Blue balls on its swing highs and swing lows.   The Pesavento Patterns study places Red balls on its swing highs and swing lows.  The chart uses regular candlesticks drawn in Red and Green and Heikin-Ashi candlesticks drawn in Yellow and Cyan.

The swings to watch are marked with fat Red arrows.   These arrows show when 5 study conditions are present, as discussed below.

The Design Your Own (DYO) study form tests for the 5 study conditions and draws the fat Red arrows.  This DYO places the down arrow above the swing highs.

Line A tests for the Heikin-Ashi candle being an Up Candle, and stores its Boolean result in Global Variable [10].

Line B tests for the regular candle being a Down Candle, and store its Boolean result in GV [11].

Line C tests for a swing high bar as determined by the Auto Trends study.  The test result is stored in GV [12].

Line D tests for a swing high bar as determined by the Pesavento Patterns study, and stores its result in GV [13].

Line E is the 5th test that the bar's high must be above the inner Keltner's upper band.   The result is stored in [14].

Line F plots the fat Down arrow when the 5 Boolean results in GV [10]..[14] are simultaneously True.

This DYO is a mirror image of the logic of the DYO explained above.   It looks for similar study conditions at the swing lows, and when the 5 conditions exist simultaneously, the fat Up arrow is plotted below the swing low.

This example is available as the B-Swing template which can be downloaded from the Ensign web site using the Internet Services form.


Dynamic Support and Resistance

This example finds the high/low range of the first 60 minutes of the trading, and uses that range to calculate Support and Resistance levels for the remainder of the trading session.

Edit the Number field on Lines A, B, and C to change the number of minutes for the opening period.   This example is available as the SupportResistance template which can be downloaded from Ensign's web site using the Internet Services form.


Dynamic Fibonacci Levels

This example finds adjusts the Fibonacci levels dynamically as the daily high/low range changes.

Line A and B find the current daily high/low range and store these values in GV [21] and [22].  Lines C through G calculate Fibonacci levels per the ratio in the Value field.   Edit the numbers in the Values field to plot lines at other ratios.

This example is available as the DynamicFibs template which can be downloaded from Ensign's web site using the Internet Services form.


Trend Trigger Factor

Recently a trader asked if Ensign Windows could plot the 'Trend Trigger Factor' by M.H. Pee.   The trader provided the eSignal EFS code so the mathematics of the TTF could be understood.   The EFS example contained approximately 70 lines of code.  Essentially, the core of the indicator script is a loop which finds the Buy Power High, Buy Power Low, Sell Power High and Sell Power Low.

Imagine that there are two equal sized groups of bars adjacent to each other.   The Buy Power High is the highest high in the set on the right, and the Buy Power Low is the lowest low in the set on the left.   The Sell Power Low is the lowest low in the set on the right, and the Sell Power High is the highest high in the set on the left.  These four values can be calculated using Ensign's powerful Design Your Own study.

Line A finds the Highest High is the set of the last 8 bars.   The Number field is the set size.  This Buy Power High value is saved in Global Variable [10] for use in a later calculation.

Line B finds the Lowest Low in a set of bars, but the set is offset leftward by 8 bars.  This is the Buy Power Low and it is saved in Global Variable [11].  

Line C calculates the spread between these two values.   GV [10] is read and GV [11] is subtracted.   The result is saved back in GV [10].  This spread is the Buy Power.

The process is repeated to find the Sell Power High (Line D) in the left side set.  Note again the Bar Offset is -8 so the set used for the calculation is shifted leftward by 8 bars.   The Sell Power High is saved in Global Variable [11].

Line E calculates the Sell Power Low from the right side set of 8 bars, and saves the result in GV [12].   

Line F calculates the spread between the Sell Power High and Sell Power Low.   GV [11] is read, and GV [12] is subtracted.  The result is saved back in GV [11].  This spread is the Sell Power.  

The formula for the Trend Trigger Factor is:   TTF = 200 * (BuyPower - SellPower) / (BuyPower + SellPower)

Line G calculates the numerator portion of this formula.  Buy Power is read from GV [10] and the Sell Power in GV [11] is subtracted.  The spread is multiplied by the value in the Number field, which is 200.  The result is stored in GV [9].

Line H calculates the denominator.   Buy Power is read from GV [10], and Sell Power from GV [11] is added.  The sum is saved back in GV [10].

Line I performs the final division of the numerator and denominator.   The numerator from GV [9] is divided by the denominator saved in [10].   Line I is the TTF value, which is plotted as a curve in Sub Window 2 using a thick Blue line style.

The example chart shows the TTF line plotted in Blue in the same sub-window as the Commodity Channel Index plotted in Red.  More work needs to be done to understand how to best use the TTF to analyze the markets.  Possibly there is merit in using the CCI and TTF studies together to generate Buy and Sell signals when they cross.  

This article has demonstrated how the powerful Design Your Own study in Ensign Windows can be used to implement fairly complex mathematical calculations.  This example is available as the TrendTriggerFactor template which can be downloaded from the Ensign web site using the Internet Services form.


Market Speedometer

More and more traders are using constant tick charts, constant volume charts, or Momentum Bars (constant range charts).  These chart types have bars that span a variable amount of time.   This tool can be used to show when market action is slow or fast by measuring the amount of time it takes to build a bar.

The speedometer is shown using Red bars, and the volume is shown in Blue.   The height of each Red bar is an indication of the number of seconds spanned by the bar.  The taller the Red bar, the shorter the time span or the faster the market's velocity.  The period labeled -- Fast -- is where the market velocity is the greatest.  The constant tick bars are building quickly as indicated by the very tall Red bars.

The Red speedometer bars were created with the following Design Your Own study.   Line A is retrieving the Delta Time which is the time duration of the bar in seconds.    This time value is multiplied by the Number field and subtracted from 100.  The data is self scaled to fit the sub-window and plotted using the Histogram style of marker.


Average Volume

The following DYO is marking when the volume is exceeding 1.5 times the 50 day average volume.  

Line A plots the volume bar in the Volume sub-window.   Plotting of volume by the chart has been turned off on the chart's property form.  Press CTRL-P to show the chart property form and uncheck the Show Volume checkbox.

Line B will calculate a 50 period Average of the volume.

Line C multiples the Average by 1.50 and plots this level as a Red curve in the Volume sub-window.

Line D tests to see if the Volume from Line A is greater than 1.5 * the Average Volume from Line C.

If the test on Line D fails, there is nothing more to do and execution aborts.

Line F tests to see if the Close is above the Open.

Line G will execute Line H if the Line F test is True.   Line H plots a Green volume bar when Close > Open.

Line I will execute Line J if the Line F test is False.   Line J plots a Red volume bar when Close <= Open.

This example is available as the AverageVol Template which can be downloaded from the Ensign web site using the Internet Services form.


Copyright © 2008 by Ensign Software, Inc.