November 2005


Trading Tip:
Design Conditional Templates
by: David Gerdes

TimeFrame Conditional DYOs

In this article I introduce a couple new features of Ensign Windows which make it possible to create conditional DYOs which can modify their behavior based on the timeframe of a given chart.

These new fields are DYO entries for Category Chart Value and Selections Time Frame Type and Time Frame Value.  These fields tell you if, for example, a chart is a Volume, Tick or Minute chart, and what is the metric value of that time frame such as 5 for a 5 minute chart or -1064 for a 1064 Tick.

More information about this feature is available at http://www.dacharts.org/archives/Ensign_Wed_class_transcripts/Beta-NOalt-colorbars-stochxover-fixcharts_10-12-05.htm  under the heading Chart TF Flags.

Often it is not necessary to test both Type and Value. Depending on your workspace, you can likely assume a TF Value of 3 implies a minute based chart, while -1064 is a Tick chart.

The DYO below changes its behavior depending on which timeframe chart it is applied to. When running on a 3 minute chart, this DYO takes the 30 period weighted Moving Average and assigns it to GV 121. When running on a Tick based chart it will plot that 3min 30WMA using the Plot Study Transfer function.

Figure 1
Line A - Get the Time Frame Value from the chart, store in GV 1
Line B - Get the Time Frame Type from the chart, store in GV 2
Line C - If this is a 3 min chart, execute Line D
Line D - Get 30 WMA value and assign to GV 121 - Study Broadcast
Line E - If this is a Tick based chart, execute Line F
Line F - Draw the study value in GV 121 transferred from 3min chart

Audible Alerts Switchboard

Now we will take it up a notch and show a more complicated example, namely generating unique audible alerts for a given condition announcing which timeframe chart generated the alert.

The application in this example will be to play a unique audio alert given a trade setup, long or short, and which chart it applies to.  To do this, I need to create a unique audible alert for each of these combinations.  Then for each audible alert, I need to create a Study Alert which tests for the correct conditions to be true and plays that specific alert.  There will be several Study Alerts created, but only on a Master switchboard template.

You may immediately note, that if I wanted to play a unique alert for each chart, I would need a unique template for each chart which references the appropriate files.  This is normally true.  But in this example I instead will build a single generic template which can be applied to all charts, and then I will build a master switchboard template which will be the central switch for consolidating alerts and playing the appropriate alert file.

I will use the ‘Time Frame Value’ field to give extra information for noting which chart generated the alert.

The next figure shows a simple DYO which attempts to detect when a Bline SlingShot might be setting up.  Lines G and H have been added to set a special Global Variable (GV) for that alert, and the value is assigned to the GV in the Time Frame for the chart which generated it.  Notice that this DYO is not in any way chart specific and can be applied to all charts from a single template.  In this example, GV 238 is defined that, if it is non-zero a SlingShot Short condition exists, and the value in the GV is the Time frame that uniquely identifies which chart generated the alert.  Note for completeness, a separate similar DYO and GV 239 is used to identify SlingShot Long conditions in the same way.

Figure 2
Lines A-E are the example alert test, the result going in GV 8
Line G  IF the alert (GV 8) is true, then run Line H
Line H  Alert Triggered so Get the TF Value and store it in GV 238

GV 238 is my SELL state indicator.  If it is non-zero, then the value in the GV indicates which chart generated the alert.
Note there would be another similar DYO for the BUY alert, which would set GV 239.

Now we jump over to the Alert Switchboard template.  This template needs to be applied to a single chart so that it can run.  I have chosen to apply it to a stand alone 133 Tick chart because that is the smallest timeframe that my workspace is watching for these alerts. Which timeframe it is applied to affects the resolution of the alerts because I use the 'Sound Once Per Bar' feature to reduce the number of times I have to hear a given alert.  This template contains several Study Alerts, one for each timeframe and alert type which generates a unique alert.

Figure 3

Figure 4
Column A tests GV 238 for value -133 (133 Tick chart Sell Alert)
Column B simply checks whether the Audio Alert Enable flag (GV 230) is True
If both conditions are true, then the audio alert for 133 Tick Sell alert is played.

Each of these Study Alerts (see Figure 4) will test for one condition on one chart, and play the specific audible alert for that pair.  In this template I have also added the capability to easily enable or disable all audible alerts using GV 230. At the end of the switchboard you can see that I have a single DYO which clears both the alert GVs to Zero so that the alert will not be falsely triggered on the next pass through.

Note that an alternate way to implement this switchboard would be to include the same logic on the main template which is applied to each chart. This would create more total objects on your workspace which may impact memory or possibly CPU. Since this switchboard could potentially get very large if we had several types of alert conditions, I chose for this project to try the central switchboard approach instead to see how well it worked.

Since we cannot guarantee the order with which charts will be processed, for each pass through our master switchboard (Figure 3), potentially 2 or more charts may have triggered the same alert. If this is the case, only the last chart to modify the GV will get an audio alert played by the switchboard.

Generating Audio Files

For generating unique alerts, the AT&T Natural voices text to speech generator is an excellent tool.  Thanks to members of the Bline chat room for sharing this link.  I'm just passing it on because I have used it and like it.  It is available at http://www.naturalvoices.att.com/demos/   For a slingshot alert I would put in the text: ‘Sling Shot Long 10 64’ and it will generated a .WAV file with a computer generated voice saying those words.

Managing GVs

We want to set a GV to a value when an alert is triggered, and only when an alert is triggered, and then reset that GV to Zero after the alert has been processed.  We need to be careful to not accidentally overwrite the GV with Zero just because the alert did not trigger on a given chart. Because multiple charts are writing to a single GV, we ONLY want to write to the GV when the alert is triggered.  By default, Study Alerts and DYOs always set GVs, whether in the TRUE or FALSE case.  To avoid this, we have to use the Do Next IF Category of DYO to ONLY set the GV in the Positive case.  This can also be done with Study Alerts with the If A then do B Condition.

Further Extension

It would be desirable to do the same type of thing for each Symbol which is watched.  The above examples assumed only a single symbol (e.g. ES #F) is being watched.  Logically you would like to extend this conditional strategy to support more than one symbol.  For example, with the 30WMA DYO, we don't want to draw the ES 30WMA on the YM chart.  To support more than one symbol we would need to assign a unique GV for the 30WMA for each symbol we monitor, and then have the DYO detect which symbol was on a chart and use the appropriate GV.

Currently Ensign Windows has no direct way testing for a particular symbol within a DYO.  So you would still likely need a separate template for each unique symbol on your workspace.  There are possible workarounds to this and Howard has suggested that you could for example compare the Tick Size value or the $ / Tick value for the set of instruments that you watch to identify a unique combination.


Computer Tips:
PC Maintenance and Improving Performance
by Randy Hatten

Once you bring your new computer home from or receive it in the mail there is no one around to offer basic PC maintenance tips for cleaning up and improving performance of your computer.  Maintenance and cleaning up of your PC should be part of a regular routine to ensure that you don't have any long-term problems with the computer.  Unfortunately most computer users don't understand the mechanics of a computer or may feel intimidated with the maintenance.  There are really simple steps anyone can take to ensure that your computer will continue working at the level it did when you first pulled it out of the box.

One of the first files to become acquainted with on your computer is the System Tools, located under the Start Menu, then Programs, and Accessories.  The System Tools houses basic maintenance tools like Disk Defragmenter, Disk Cleanup, Backup, Scheduled Tasks, and System Information and ScanDisk on some Microsoft Windows computers.  Strange that these files are located in Accessories because they really are the key to keeping your system running correctly and helping to improve performance as the computer ages.

On a regular basis you want to go to My Computer and then right click on the Local Disk (C Drive) and open up the Properties.  This allows you to see how much space you are using and how much you have left to use on your computer.  Under Tools in this area you can usually perform a scan of the disk.  If you cannot run a disk scan from here, your Microsoft should have a disk scan available under the System Tools.  It is important to run this disk scan to determine if there are any errors or problems running on your computer and the disk scan will repair those potential problems.  Some experts recommend doing a thorough disk scan the first time and then a basic disk scan up to once a week to keep your computer performing at top conditions.

After this it is important to regularly perform a disk cleanup, which is located either under Properties under the C Drive, or under System Tools.  Be aware that both the disk scan and the disk cleanup can take quite a bit of time and it is best to before these maintenance tools when you will not be using the computer.  Set a routine with yourself like performing the disk clean up and disk scan on Saturday night while you are watching movies with your family.  After a disk cleanup, it also helps to regularly perform a disk defragmentation.  A computer hard drive will begin to fragment over time, which means that programs that once worked in conjunction have become separated over time and may not be in the proper place to work well on your computer.  This can slow down processes or make using certain programs difficult.  Using the disk defragmenter can pull together those pieces again and return things to working order.

Basic maintenance routines that will ensure your computer runs at peak performance start with simply getting rid of files you do not use. If you have old word documents, software programs you have not used in a long time, or pictures and music you are not using, delete them from your computer.  Remember that once you delete them, they do not automatically disappear, but instead go to the recycle bin and it is just as important to empty the recycle bin as it is to delete old files.

Old internet files can also cause your computer to slow down.  Often with a Disk Cleanup there will be an opportunity for you to get rid of temporary internet files, but you can also get rid of them on your own by going to your Temporary Internet files in Microsoft Explorer. Click on Tools then Internet Options, General Tab, Temporary Internet Files, and Delete Files.  As well, take time to clean out any other temporary files you may have acquired, like downloads from the internet. Depending on the model of your computer, the temporary files could be in different locations, but most often when you go to Disk Cleanup and scan there will be an option to get rid of temporary files as well.

One of the other helpful and easy ways to maintain your computer's performance is to always run your protection programs, use a personal firewall when accessing the computer, and always install software updates available for Microsoft and protection programs. Keeping up on regular maintenance and setting a routine for updates on the computer will ensure that your computer performs the way it was intended to when you first brought it home.

The software that I use is listed below, some of it is free and some of it costs but there are others I’m sure that will do these same thing its just a personal preference as to which you choose but it is important that the ‘clean-up process’ be consistent.  Make sure to update your software definitions prior to running the scans each time as new definitions are added almost daily.  Running these scans and registry fix processes in Safe mode never hurts and can actually ‘fix’ errors in the registry while the OS is not in ‘active mode’.  Booting the computer in safe mode usually requires holding down the F8 Key during startup.  Choose to enter Safe mode with networking if desired to update applications while in safe mode (some computers may require a different key equivalent to boot in safe mode…check to see what is required for you to boot your computer in safe mode- also some keyboards are connected via a USB connections and this may not allow the Function Keys to be active during the initial booting process.  If you can not access safe mode using the F8 Key during the initial boot sequence using a USB Keyboard, a special PS2-USB Keyboard adaptor may be required --- see link- it may be purple in color--- this should be used to connect your keyboard to your computer in order access the ‘safe boot’ mode using the F8 key).


Free Virus Software links  (Control Click the images to go to download site)

After Download…. Always remember to update the software for the new definitions.
Also remember to set the schedule preferences so as to not have is running during trading hours!!!


Paid Registry Fix Software  ($29.00)

Simple and easy to run during safe mode

or

http://www.systweak.com/


Paid Spyware Software  ($29.95)

Spy Sweeper's Comprehensive Removal Technology

Remember to fix the schedule as to not interrupt the trading day. (I usually do not actively run these during the day and I don’t surf on the trading computers as well… but I do run the same clean-up process on all machines at least weekly.


Paid Cloning Software  ($49.00)

Acronis True Image 9.0

This is how I do a Master back-up of each machine.  This allows for fast clone of the computer so an extra HD is necessary.  I use an IDE 40-80Gig drive for each clone back up (…on each computer. So 2 HD / computer)  This is this about $50.00 extra these days at NewEgg.com or TigerDirect.com.

I also use this software to do incremental backups on a schedule during the week. … no brainer it does it by itself… makes for good sleep.


So with the software and hardware on board, this is my routine.

  1. Before I begin the Clean-up/Back-up process…with all applications off while running in normal windows mode, I’ll run the updater for all of the application above. (getting all of the new definitions etc).
  2. Run a basic disk scan (see above). Go to My Computer and then right click on the Local Disk (C Drive) and open up the Properties. Under perform a scan of the disk.
  3. Then perform a disk cleanup and a Disk Defragment.
  4. Restart computer in safe mode with networking (F8 key).
  5. While in safe mode- run the Virus and Registry software listed above on the C Drive.
  6. Re-run the defrag while in safe mode once the Registry Mechanic application has completed.
  7. Reboot into normal Windows environment (with now clean –tight system).
  8. Run the Acronis Software fro the clone process to clone the C drive to backup HD ( this requires 2 reboots) and now your ready for another week or 2 carefree trading.

Your hard drive (and Data) will fail; will you be ready when it does?


Studies:
Chart Art
by: Howard Arrington

Enjoy these examples posted to http://www.dacharts.com/ web site recently.  The first 2 examples are in the 10-18 folder posted by TOC.  The 3rd example is in the 10-25 folder posted by Ensign.  Go to http://www.dacharts.com/ site and browse the daily chart folders for additional examples.


Copyright © 2008 by Ensign Software, Inc.