Malcolm Moore : Technical Analysis of Securities

Innovative Synergies

Engineering Dimensionally Alternative Business Analysis 

Visual Basic - Practical Computer Applications

Visual Basic 6, VB.NET, VB.2005, VB.2008, VB.2010 and Beyond

VB6 Morphing

Visual Basic grew out of a number of earlier breeds of Basic and as it grew from being a development application that was literally devoid of its' parent computer, it morphed into becoming an arm's length part of the personal computer's operating system.  By about 2004 Visual Basic 6 (VB6)  had almost run its course, but because VB6 had grown out of VB5 and before VB4 , Quick Basic etc., it had picked up a number of traits that made it rather uncomfortable with the Windows platform.  In reality, VB6 was hooked onto the operating system by many poor programming techniques that led to significant instability problems and the best thing to do would be to kill VB6 - but there was so many program applications already written in VB6. 

The problem in trying to kill off VB6 meant that Visual Basic had to be replaced, and I believe that it was replaced with C++ under the hood with a new Visual Basic skin over the C++ working language.  There are many traits that are giveaways link the "Inherits" statement which is common in the C languages.  The beauty about this C replacement strategy is that Windows is (I believe) written in C++ and therefore Visual Basic .Net / 2005 / 2008 / 2010 being now written in C++  therefore directly inherits a wealth of operating system features for application tools that are already available with a linking framework ties to the Microsoft Windows operation system, which is now significantly mature. 

Working with StockChartX

StockChartX is a very nice Visual Object that comes from a USA based company called Modulsfe and this object is brilliant in setting up and displaying charts for the stock Market.  The problem with StockChartX is that it is a rather complex object, and the supplied data is really wanting at the best.  So, it takes some weeks to get your head around if you really want it to work for you instead of you working for it!  

To work around that problem I have written a series of articles that will step you through the basics.  This first article is how to register the StockChartX object into Windows. The next is how to load the object into a VB6 project and a bit about Price and Volume panels.  Next is how to load historical data and how to structure Data Series, and how to work with Julian Time and Real time (it does EOD and Trade if you want it)!  The fourth PDF is the basics on how to set up your own custom Indicator (not easy - leave that until much later).  The firth PDF is how to add a standard indicator like an MACD.  The sixth PDF is almost everything about how to Present the Charts.  The seventh PDF is the rest that you will need about displaying the Volume Chart and Candlestick tips.  There is more but these were all done in VB6.  

With VB.NET, 2008, 2010 etc, the concepts for working with StockChartX are identical, but the objectivity is rather engrained.  

Some Visual Basic 6 Snippets

Even though Visual Basic 6 has reached its' use-by date, there are several programming processes that are valuable beyond VB6.  For a starter it seems that everybody takes the structure of programming as a "given" when in fact it is much like an essay where there is a starting point, and a structure for laying out the various paragraphs in sequential relation to one another.  

Making Classes or Types

One of the less straightforward processes is to create a "Class" or "Type" as it was called in VB6 of related variables that could then be used in a programme.  The advantage of creating a Type is that as the program is written the editor recognises the Type and provides the options without typos, considerably speeding up program development.  Building on from a "Type" is an Array built into a Type. This "Class" is particularly useful as it makes the development of Arrays very straightforward and it again cuts down on typos.  

Interacting the Keyboard

When working with the Keyboard, it can be very frustrating to get the interface to work first up.  This little paper shows the keyboard codes and a simple subroutine that can be used to make the keyboard highly interactive.

Subroutine Basics

When developing applications one of the essentials is to group everything into a number of small subroutines, and/or functions.  This strategy significantly reduces typos and programmes that go wild and/or lose their way.  This little paper describes the basics about Subroutines and Functions and shows a few simple examples with accompanying text.  

Flexible Grids

One of the favourite displays is a Flexible Grid that fills out much like an Excel Spreadsheet or an Access Table, but this flexible Grid can be programmed in to set its' own number of columns, and sort A-Z, Z-A with one click, sort dates really easily.  The regular structure makes fault free programming both quick and reliable. 

When it comes to dates on a Flex Grid it is much easier to save the date in two forms; System "Short" for display, and Swedish as a number for analysis.  This snippet of programming shows how to set up the MSHFlexGrid, how to load the dates, how to relate the dates, and how to sort on the dates.  

Interfacing Access Databases

When using Access databases and Visual Basic 6, it is often necessary to use the database and then step away so that another user can get to use the database.  This set of snippets show how an Access database can be called, (even if it not at the administrator level) and a few ways to use Structured Query Language (SQL) to select the required data.

With SQL loading data into a Flexible Grid is not all that hard once the parameters are set.  This set of snippets shows how to select a recordset of data and then load that recordset into a Flex Grid. 

In another sequence here is some snippets that show how to interface with an Access database table and load a tight selection into a Combo Box.  

Another choice snippet here is how to use a combination of SQL to join a few fields into one string  from a recordset, and load that into a Flexible Grid.

  conectate names into one cellfew little   

 s   This is the next step; taking hypothetical theory and showing what happens in practice!  End of Day (EOD) Data is readily available and pretty useless in its isolated form;  but when it is technically analysed in perspective with older data, and then the mind set of Technical Analysis comes to life!  

Porting from VB6 to VB.NET, VB2008, VB 2010 and Beyond

When transporting a VB6 programme code into VB2010, there are a number of problems that need to be worked around.  The document here sets up a process that works with very little tears.   Just be aware that even this does not always work, but I really hope that it helps you!



Here is a visual representation of a security using EOD data.  The blue spiles in the bottom section of the display are representative of turnover volume, and the upper section is the prices shown as 'candlesticks' - red when the price falls, and green if the price rises over the day.  

Remember:  Technical Analysis is not predictive - it is reactive.  Insider information is predictive!  

The secret of good Technical Analysis is to adjust the parameters of the indicators you are using so that they are in synchronism with the security being analysed. Most securities have a longer term trend with cyclic pattern of repetitive lows and highs - spaced by anything from less than days to several months - depending on the chip type and market forces.  

It is far easier to align technical analysis indicators with long-term trends and have reasonably good accuracy than try to align indicators with short-term fluctuations.  




Copyright Malcolm Moore, 2002, 2009 Comments and Corrections are welcome