FOR SALE

:
VB.NET APPLICATION TO POPULATE SQL TABLES USING CUSTOM FINANCIAL FUNCTIONS FOR THE PURPOSE OF DERIVING HISTORICAL TECHNICAL INDICATOR DATA.
This custom .NET Application was created in order to build derived tables to hold historical technical indicator data. As such, it is not sold with any baseline or derived data. It is meant to be used in conjunction with your own baseline data in order to derive the historical indicator data. You will need the Ticker, Date, OHLC, and Volume. While we have our own fully populated database, we realize that there may be a desire on the part of others to use their own baseline data, build and populate their own tables, and create their own reports. In the event that you wish to make an offer OR to avail yourselves of our already populated SQL database, please contact us at mail@olaptrader.com. Our Database tables contain 22 million rows and include 20 years of data for over 14,000 Stocks, ETF’s, and Indexes. We leveraged a product from a company called FMLabs which specializes in writing advanced functions for banks, insurance companies, brokerage houses, fund managers, traders, and individual investors. In order to use this application you must have already purchased the FMLabs toolkit (approximately $200.00). You will need to install the toolkit onto a computer with Visual Studio installed. The table names described below are purely our own naming conventions. You may use any names you like.

STOCKS TABLE
This table contains the baseline data which the application uses to derive the data for the other tables. In the case of the Olaptrader database, there is data for 14,000 Stocks, Indexes, and ETFs spanning two decades – 1988-2008. Columns & Data Type
[Ticker] [nvarchar](7) NOT NULL, [Date] [smalldatetime] NOT NULL, [Open] [decimal](9, 2) NULL,

[High] [decimal](9, 2) NULL, [Low] [decimal](9, 2) NULL, [Close] [decimal](9, 2) NULL, [Volume] [bigint] NULL,

INDICATORS TABLE
The following is a list of the Technical Indicators which the application computes and inserts into a destination table.

Columns
Ticker Date Absolute_Breadth_Index_ABI Accumulate_or_Running_Total Accumulation_Swing_Index Accumulation_Distribution_Line Advance_Decline_Line_Breadth Advance_Decline_Line Advance_Decline_Ratio Advancing_Declining_Issues Arms_Index_TRIN Aroon_Oscillator Aroon_Down Aroon_Up Average_Directional_Movement_Index_ADX Average_Directional_Movement_Rating_ADXR Average_Price Average_True_Range_ATR Bollinger_Band_Width Bollinger_Bands_Hi Bollinger_Bands_Low Bollinger_Bands_Mid Bolton_Tremblay_Indicator Breadth_Thrust Bretz_TRIN_5 Chaikin_Money_Flow Chaikin_Oscillator Chaikin_Volatility Chande_Momentum_Oscillator_CMO Chicago_Floor_Trading_Pivotal_Point_First_Resistence_Level Chicago_Floor_Trading_Pivotal_Point_First_Support_Level Chicago_Floor_Trading_Pivotal_Point_Second_Resistence_Level Chicago_Floor_Trading_Pivotal_Point_Second_Support_Level Commodity_Channel_Index_CCI

Function Name
Ticker Date fmABI fmAccumulate fmAccumSwingIndex fmAccumDist fmADLineBreadth fmADLine fmADRatio fmADIssues fmTRIN fmAroonOscillator fmAroon fmAroon fmADX fmADXR fmAvgPrices fmATR fmBollingerWidth fmBollinger fmBollinger fmBollinger fmBoltonTremblay fmBreadthThrust fmBretzTRIN5 fmChaikinMoneyFlow fmChaikinOscillator fmChaikinVolatility fmCMO fmCFTPP fmCFTPP fmCFTPP fmCFTPP fmCCI

OLAPTRADER | Candlesticks Table

2

Commodity_Selection_Index_CSI Cumulative_Volume_Index_CVI DEMA Demand_Index Detrended_Price_Oscillator_DPO De_trended_Price Directional_Movement_Index_M_DI Directional_Movement_Index_P_DI Directional_Movement_Index_DX Down_Average Dynamic_Momentum_Index_DMI Ease_Of_Movement EMA_100 EMA_12 EMA_200 EMA_26 EMA_50 EMA_9 Envelope_Percent_Hi Envelope_Percent_Low Envelope_Hi Envelope_Low Forecast_Oscillator_FO Forecast_Oscillator_Signal Ichimoku_Kinko_Hyo_Chikou_Span Ichimoku_Kinko_Hyo_Kijun_Sen Ichimoku_Kinko_Hyo_Senkou_Span_A Ichimoku_Kinko_Hyo_Senkou_Span_B Ichimoku_Kinko_Hyo_Tenkan_Sen Inertia Intraday_Momentum_Index_IMI Least_Squares_Moving_Average Least_Squares_Moving_Average_10_days Least_Squares_Moving_Average_100_days Least_Squares_Moving_Average_20_days Least_Squares_Moving_Average_200_days Least_Squares_Moving_Average_50_days Line_Oscillator Market_Facilitation_Index_MFI Mass_Index McClellan_Oscillator McClellan_Summation Median_Price MESA_Sinewave MESA_Sinewave_Lead Momentum Money_Flow_Index Moving_Average_Convergence_Divergence_MACD Moving_Average_Convergence_Divergence_MACD_Signal

fmCSIndex fmCVI fmDEMA fmDemandIdx fmDPO fmDeTrend fmDI fmDI fmDX fmDownAverage fmDMI fmArmsEMV fmEMA fmEMA fmEMA fmEMA fmEMA fmEMA fmEnvelopePct fmEnvelopePct fmEnvelope fmEnvelope fmForecastOscillator fmForecastOscillator fmIchimokuKinkoHyo fmIchimokuKinkoHyo fmIchimokuKinkoHyo fmIchimokuKinkoHyo fmIchimokuKinkoHyo fmInertia fmIMI fmLstSqrMA fmLstSqrMA fmLstSqrMA fmLstSqrMA fmLstSqrMA fmLstSqrMA fmLineOsc fmMFI fmMassIndex fmMcClellanOscillator fmMcClellanSummation fmMedianPrices fmMESAsinewave fmMESAsinewave fmMomentum fmMoneyFlowIndex fmMACD fmMACD

OLAPTRADER | Candlesticks Table

3

Moving_Average_Envelope_Hi Moving_Average_Envelope_Low Moving_Averages_of_the_High_and_Low_Hi Moving_Averages_of_the_High_and_Low_Low Moving_Correlation_Coefficient Moving_Covariance Moving_Dispersion Moving_Regression_Line Moving_Regression_Line_Slope Moving_Standard_Deviation Moving_Standard_Error Moving_Summation Negative_Volume_Index_NVI Net_Momentum_Oscillator_NMO On_Balance_Volume_OBV On_Balance_Volume_Expanded_System_Balance_Volume_Array On_Balance_Volume_Expanded_System_Breakout_Indicators On_Balance_Volume_Expanded_System_Field_Trend_Indicators On_Balance_Volume_Moving Open_10_TRIN Oscillator_Percent Oscillator Overbought_Oversold Parabolic_SAR Parabolic_SAR_Position Percentage_Volume_Oscillator_PVO Performance_Indicator Positive_Volume_Index_PVI Price_and_Volume_Trend_PVT Price_Channels_Hi Price_Channels_Low Price_Oscillator_Percent Price_Oscillator Price_Volume_Rank Projection_Bands_Hi Projection_Bands_Low Projection_Bandwidth Projection_Oscillator Qstick Random_Walk_Index_RWI_Hi Random_Walk_Index_RWI_Low Range_Indicator Rate_of_Change Ratio Relative_Momentum_Index_RMI Relative_Strength_Index_RSI Relative_Volatility_Index_RVI_Original_Calculation Relative_Volatility_Index_RVI r_squared Simple Moving Average SMA_10

fmMAEnvelope fmMAEnvelope fmMAHighLow fmMAHighLow fmCorCoefMv fmCovarianceMv fmDispersionMv fmRegressionLineMv fmRegressionLineMv fmStdDevMv fmStdErrMv fmMovingSum fmNVI fmNMO fmOBV fmOBVolExp fmOBVolExp fmOBVolExp fmOBVolMv fmOpen10TRIN fmOscillatorPct fmOscillator fmOverBoughtSold fmSAR fmSAR fmPVO fmPerformancePct fmPVI fmPVT fmPriceChannels fmPriceChannels fmPriceOscillatorPct fmPriceOscillator fmPVrank fmProjectionBands fmProjectionBands fmProjectionBandwidth fmProjectionOscillator fmQstick fmRWI fmRWI fmRangeIndicator fmRateOfChange fmRatio fmRMI fmRSI fmRVIoriginal fmRVI fmRSquared fmSimpleMA fmSimpleMA

OLAPTRADER | Candlesticks Table

4

SMA_100 SMA_20 SMA_200 SMA_50 Standard_Error_Bands_Hi Standard_Error_Bands_Low Standard_Error_Bands_Mid STIX Stochastic_Momentum_Index_SMI Stochastic_Momentum_Index_SMI_Signal Stochastic_Oscillator_D Stochastic_Oscillator_K Stochastic_RSI Swing_Index T3 TEMA Trend_Score Triangular_Moving_Average Triangular_Moving_Average_10_days Triangular_Moving_Average_100_days Triangular_Moving_Average_20_days Triangular_Moving_Average_200_days Triangular_Moving_Average_50_days TRIX True_Range_TR True_Strength_Index_TSI Typical_Price Ultimate_Oscillator Up_Average Upside_Downside_Ratio Variable_Moving_Average Variable_Moving_Average_10_days Variable_Moving_Average_100_days Variable_Moving_Average_20_days Variable_Moving_Average_200_days Variable_Moving_Average_50_days Vertical_Horizontal_Filter_VHF VIDYA Volume_Adjusted_Moving_Average Weighted_Close Weighted_Moving_Average Weighted_Moving_Average_10_days Weighted_Moving_Average_100_days Weighted_Moving_Average_20_days Weighted_Moving_Average_200_days Weighted_Moving_Average_50_days Welles_Wilder_Moving_Average Welles_Wilder_Moving_Average_10_days Welles_Wilder_Moving_Average_100_days Welles_Wilder_Moving_Average_20_days Welles_Wilder_Moving_Average_200_days

fmSimpleMA fmSimpleMA fmSimpleMA fmSimpleMA fmStdErrBands fmStdErrBands fmStdErrBands fmSTIX fmSMI fmSMI fmStochasticOscillator fmStochasticOscillator fmStochRSI fmSwingIndex fmT3 fmTEMA fmTrendScore fmTriangularMA fmTriangularMA fmTriangularMA fmTriangularMA fmTriangularMA fmTriangularMA fmTRIX fmTR fmTSI fmTypicalPrices fmUltimateOsc fmUpAverage fmUpDownRatio fmVariableMA fmVariableMA fmVariableMA fmVariableMA fmVariableMA fmVariableMA fmVHF fmVIDYA fmVolAdjustedMA fmWeightedCloses fmWeightedMA fmWeightedMA fmWeightedMA fmWeightedMA fmWeightedMA fmWeightedMA fmWellesMA fmWellesMA fmWellesMA fmWellesMA fmWellesMA

OLAPTRADER | Candlesticks Table

5

Welles_Wilder_Moving_Average_50_days Welles_Wilder_Summation Welles_Wilder_Volatility_System_ATR_Time_Constant Welles_Wilder_Volatility_System_Short_Long_Indicators Welles_Wilder_Volatility_System_Significant_Closes Welles_Wilder_Volatility_System_Stop_Reverse_Point Williams_Accumulation_Distribution Williams_Pct_R Zero_Lag_Exponential_Moving_Average Zero_Lag_Exponential_Moving_Average_10_days Zero_Lag_Exponential_Moving_Average_100_days Zero_Lag_Exponential_Moving_Average_20_days Zero_Lag_Exponential_Moving_Average_200_days Zero_Lag_Exponential_Moving_Average_50_days Zig_Zag

fmWellesMA fmWellesSum fmWellesVolatility fmWellesVolatility fmWellesVolatility fmWellesVolatility fmWilliamsAD fmWilliamsR fmZeroLagExpMA fmZeroLagExpMA fmZeroLagExpMA fmZeroLagExpMA fmZeroLagExpMA fmZeroLagExpMA fmZigZag

CANDLESTICKS TABLE
The following is a list of the Candlestick Patterns which the application computes and inserts into a destination table. Columns
Ticker Date Abandoned Baby Bottom Abandoned Baby Top Advance Block Bearish Belt Hold Line Bearish Counter Attack Bearish Engulfing Line Bearish Separating Line Black Harami Cross Black Harami Body Gap Down Body Gap Up Bullish Belt Hold Line Breakaway Bear Breakaway Bull Bullish Counter Attack Bull Line Bullish Engulfing Line Bullish Separating Line Candlestick Color Dark Cloud Cover Deliberation Bear Deliberation Bull DragonflyDoji Bear DragonflyDoji Bull

Function Name
N/A N/A fmAbandonedBabyBottom fmAbandonedBabyTop fmAdvanceBlock fmBeltHoldLineBear fmCounterAttackBear fmEngulfingLineBear fmSeparatingLineBear fmHaramiCrossBlack fmHaramiBlack fmBodyGapDn fmBodyGapUp fmBeltHoldLineBull new function new function fmCounterAttackBull fmEngulfingLineBull fmSeparatingLineBull fmCandleColor fmDarkCloudCover new function new function new function new function

OLAPTRADER | Candlesticks Table

6

Evening Doji Star Evening Star Falling Three Method Gravestone Doji Hammer Hanging Man High Wave InNeck line Inverted Hammer LadderBottom Long Legged Doji MatHold Pattern MeetingLines Bear MeetingLines Bull Morning Doji Star Morning Star OnNeck Outside Bar Formation Piercing Line Rising Three Method Shooting Star Side by Side White Gapping down Side by Side White Gapping up Stalled Pattern Tasuki Downside Gap Tasuki Upside Gap Three Gaps Down Three Gaps Up Three White Soldiers ThreeLineStrike Bear ThreeLineStrike Bull ThreeOutsideDown ThreeOutsideUp ThreeStarsInTheSouth Thrusting Line TriStar Bear TriStar Bull TweezersBottom TweezersTop Upside Gap Two Crows Western Gap Down Western Gap Up White Harami White Harami Cross

fmEveningDojiStar fmEveningStar fmFalling3Method fmGravestoneDoji fmHammer fmHangingman fmHighWave fmInNeckLine fmInvertedHammer new function fmLongLeggedDoji fmMatHoldPattern new function new function fmMorningDojiStar fmMorningStar new function fmOutsideBar fmPiercingLine fmRising3Method fmShootingStar fmSideBySideWhiteGapDn fmSideBySideWhiteGapUp fmStalledPattern fmTasukiDownsideGap fmTasukiUpsideGap fmThreeGapsDown fmThreeGapsUp fmThreeWhiteSoldiers new function new function new function new function new function fmThrustingLine new function new function new function new function fmUpsideGap2Crows fmWesternGapDn fmWesternGapUp fmHaramiWhite fmHaramiCrossWhite

OLAPTRADER | Candlesticks Table

7

CALCULATIONS TABLE
The following is a list of Fibonacci Retracements and Projections and the custom columns which the application computes and inserts into a destination table. Columns
Ticker Date [Fibonacci_Project_1.270] [Fibonacci_Project_1.414] [Fibonacci_Project_1.618] [Fibonacci_Project_2.000] [Fibonacci_Project_2.240] [Fibonacci_Retrace_0.382] [Fibonacci_Retrace_0.500] [Fibonacci_Retrace_0.618] [Fibonacci_Retrace_0.707] [Fibonacci_Retrace_0.786] [Close_Plus_0_days] [Close_+_7 days] [Close_+_14 days] [Close_+_28 days] [Close_+_56 days] [Close_+_91 days] [Close_+_182 days] [Close_+_364 days] [Close_+_1456 days]

Function Name
N/A N/A fmFibonacciProject fmFibonacciProject fmFibonacciProject fmFibonacciProject fmFibonacciProject fmFibonacciRetrace fmFibonacciRetrace fmFibonacciRetrace fmFibonacciRetrace fmFibonacciRetrace custom custom custom custom custom custom custom custom custom

The following describes how you would use this data after using the application to populate your own destination table. For each unique combination of Ticker and Date (Primary key), there are predicted future support and resistance prices for the stock at each corresponding projection and retracement ratio. Your DBA would write a query to compare the actual future Close prices (at intervals of 7, 14, 28, or custom days etc…) with the predicted support or resistance price for each of the ratios. This would be done for each ticker. He would save this difference as a percentage. Finally, he simply takes the average (all tickers) to see which of the Fibonacci projection and retracement ratios was cumulatively and historically, the most accurate. A trader would then use this ratio when trading with Fibonacci’s. OLAPTRADER | Candlesticks Table 8

Regardless of whether it is a bull or bear market, the numbers which you get back for the ratios are equally valid. This is because you are comparing one against the other. It is the predictive accuracy of the ratios to one another which are important * The retracement function gives the support points for upward trends, and the projection function gives resistance points for downward trends

DARVAS BOXES TABLE
The Darvas Boxes table contains past occurrences of Darvas Boxes. The application determines the prior occurrences of a Darvas Box and, whether or not it formed due to a Bullish or Bearish price movement. It then populates the destination table. In addition, the application determines when an upward or downward breach of an existing box occurs. This is a buy or sell signal. The purpose of this calculation is to use it in conjunction with complimentary bullish or bearish indicators in an effort to find combinations which have historically yielded predictable results. Colum ns
Ticker Date Bullish Bearish IsNewBox BoxTopBreached BoxBottomBreac hed

Sample output from the DarvasBoxes table in the Olaptrader database.

OLAPTRADER | Candlesticks Table

9

.NET 2008 SOLUTION

OLAPTRADER | Candlesticks Table

10

Code Snippets: INDICATORS
Public Sub PopulateIndicators() Dim StartTime As Date Dim EndTime As Date Dim ElapsedTime As Long Dim sql As String Dim Dim Dim Dim oDR oDT oDA oCB As As As As DataRow DataTable OleDbDataAdapter OleDbCommandBuilder

Dim drTickers As DataRow Dim dtTickers As DataTable Dim daTickers As OleDbDataAdapter Dim fmArrayADX As fmArray Dim fmArrayADXR As fmArray Dim fmArrayArmsEM As fmArray Dim fmArrayAroonUp As fmArray Dim fmArrayAroonDown As fmArray Dim fmArrayAroonOscillator As fmArray mProcessingToolStripStatusLabel.Text = "Populating the INDICATORS table ..." Application.DoEvents() oLW.WriteMsg("PopulateIndicators - Started inserting records into the INDICATORS table.") Thread.Sleep(5000) 'Exit Sub StartTime = Now 'sql = " truncate table Indicators " 'Call ExecuteSQL(Con, sql) sql = " select * from Indicators where 1=2 " oDA = New OleDbDataAdapter(sql, Con) oCB = New OleDbCommandBuilder(oDA) oDA.SelectCommand.CommandTimeout = 600 oDA.UpdateCommand = oCB.GetUpdateCommand oDA.UpdateCommand.CommandTimeout = 600 oDA.InsertCommand = oCB.GetInsertCommand oDA.InsertCommand.CommandTimeout = 600 oDA.DeleteCommand = oCB.GetDeleteCommand oDA.DeleteCommand.CommandTimeout = 600 oDT = New DataTable

CANDLESTICKS
Public Sub PopulateCandlesticks()

OLAPTRADER | Candlesticks Table

11

Dim StartTime As Date Dim EndTime As Date Dim ElapsedTime As Long Dim sql As String Dim Dim Dim Dim oDR oDT oDA oCB As As As As DataRow DataTable OleDbDataAdapter OleDbCommandBuilder

Dim drTickers As DataRow Dim dtTickers As DataTable Dim daTickers As OleDbDataAdapter Dim fmArrayCrossOverFill As fmArray Dim fmArrayFormationFill As fmArray Dim fmArrayTurnFill As fmArray mProcessingToolStripStatusLabel.Text = "Populating the CANDLESTICKS table ..." Application.DoEvents() oLW.WriteMsg("PopulateCandlesticks - Started inserting records into the Candlesticks table.") Thread.Sleep(5000) 'Exit Sub StartTime = Now sql = " select count(*) from Candlesticks " CurDBRecordCount = 0 DBRecordCount = GetFirstValueBySQL(Con, sql) If DBRecordCount > 0 Then sql = " select Ticker, count(*) as TickerCount from Candlesticks group by Ticker order by Ticker " oDA = New OleDbDataAdapter(sql, Con) oDT = New DataTable oDA.Fill(oDT) oDA.Dispose() CurTicker = "" For Each oDR In oDT.Rows If CurDBRecordCount + oDR("TickerCount") <= DBRecordCount Then CurTicker = oDR("Ticker") CurDBRecordCount += oDR("TickerCount") Else Exit For End If Next oDR End If

OLAPTRADER | Candlesticks Table

12