Upload
olaptrader
View
102
Download
0
Embed Size (px)
DESCRIPTION
FOR SALE:VB.NET APPLICATION TO POPULATE SQL TABLES USING CUSTOM FINANCIAL FUNCTIONS FOR THE PURPOSE OF DERIVING HISTORICAL TECHNICAL INDICATOR DATA.This application can be purchased with or without the baseline data. If it is purchased with baseline data, there will obviously be a SQL database included with the purchase. This database will have one - already populated table. If one is desirous of purchasing the entire, pre-populated olaptrader database itself, this application may or may not be desired. The point of creating the application WAS to populate the tables. Companies (or traders with programming skills), can use their own baseline data and use the application to calculate the derivative tables. Perhaps they get their data from a dedicated feed (ESignal, Yahoo Finance, Bloomberg) and would prefer to use this data. For prices, or to simply to MAKE AN OFFER, contact Rob at [email protected]
Citation preview
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 [email protected]. 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 Function Name
Ticker Ticker
Date Date
Absolute_Breadth_Index_ABI fmABI
Accumulate_or_Running_Total fmAccumulate
Accumulation_Swing_Index fmAccumSwingIndex
Accumulation_Distribution_Line fmAccumDist
Advance_Decline_Line_Breadth fmADLineBreadth
Advance_Decline_Line fmADLine
Advance_Decline_Ratio fmADRatio
Advancing_Declining_Issues fmADIssues
Arms_Index_TRIN fmTRIN
Aroon_Oscillator fmAroonOscillator
Aroon_Down fmAroon
Aroon_Up fmAroon
Average_Directional_Movement_Index_ADX fmADX
Average_Directional_Movement_Rating_ADXR fmADXR
Average_Price fmAvgPrices
Average_True_Range_ATR fmATR
Bollinger_Band_Width fmBollingerWidth
Bollinger_Bands_Hi fmBollinger
Bollinger_Bands_Low fmBollinger
Bollinger_Bands_Mid fmBollinger
Bolton_Tremblay_Indicator fmBoltonTremblay
Breadth_Thrust fmBreadthThrust
Bretz_TRIN_5 fmBretzTRIN5
Chaikin_Money_Flow fmChaikinMoneyFlow
Chaikin_Oscillator fmChaikinOscillator
Chaikin_Volatility fmChaikinVolatility
Chande_Momentum_Oscillator_CMO fmCMO
Chicago_Floor_Trading_Pivotal_Point_First_Resistence_Level fmCFTPP
Chicago_Floor_Trading_Pivotal_Point_First_Support_Level fmCFTPP
Chicago_Floor_Trading_Pivotal_Point_Second_Resistence_Level fmCFTPP
Chicago_Floor_Trading_Pivotal_Point_Second_Support_Level fmCFTPP
Commodity_Channel_Index_CCI fmCCI
Commodity_Selection_Index_CSI fmCSIndex
Cumulative_Volume_Index_CVI fmCVI
DEMA fmDEMA
Demand_Index fmDemandIdx
Detrended_Price_Oscillator_DPO fmDPO
De_trended_Price fmDeTrend
OLAPTRADER | Candlesticks Table 2
Directional_Movement_Index_M_DI fmDI
Directional_Movement_Index_P_DI fmDI
Directional_Movement_Index_DX fmDX
Down_Average fmDownAverage
Dynamic_Momentum_Index_DMI fmDMI
Ease_Of_Movement fmArmsEMV
EMA_100 fmEMA
EMA_12 fmEMA
EMA_200 fmEMA
EMA_26 fmEMA
EMA_50 fmEMA
EMA_9 fmEMA
Envelope_Percent_Hi fmEnvelopePct
Envelope_Percent_Low fmEnvelopePct
Envelope_Hi fmEnvelope
Envelope_Low fmEnvelope
Forecast_Oscillator_FO fmForecastOscillator
Forecast_Oscillator_Signal fmForecastOscillator
Ichimoku_Kinko_Hyo_Chikou_Span fmIchimokuKinkoHyo
Ichimoku_Kinko_Hyo_Kijun_Sen fmIchimokuKinkoHyo
Ichimoku_Kinko_Hyo_Senkou_Span_A fmIchimokuKinkoHyo
Ichimoku_Kinko_Hyo_Senkou_Span_B fmIchimokuKinkoHyo
Ichimoku_Kinko_Hyo_Tenkan_Sen fmIchimokuKinkoHyo
Inertia fmInertia
Intraday_Momentum_Index_IMI fmIMI
Least_Squares_Moving_Average fmLstSqrMA
Least_Squares_Moving_Average_10_days fmLstSqrMA
Least_Squares_Moving_Average_100_days fmLstSqrMA
Least_Squares_Moving_Average_20_days fmLstSqrMA
Least_Squares_Moving_Average_200_days fmLstSqrMA
Least_Squares_Moving_Average_50_days fmLstSqrMA
Line_Oscillator fmLineOsc
Market_Facilitation_Index_MFI fmMFI
Mass_Index fmMassIndex
McClellan_Oscillator fmMcClellanOscillator
McClellan_Summation fmMcClellanSummation
Median_Price fmMedianPrices
MESA_Sinewave fmMESAsinewave
MESA_Sinewave_Lead fmMESAsinewave
Momentum fmMomentum
Money_Flow_Index fmMoneyFlowIndex
Moving_Average_Convergence_Divergence_MACD fmMACD
Moving_Average_Convergence_Divergence_MACD_Signal fmMACD
Moving_Average_Envelope_Hi fmMAEnvelope
Moving_Average_Envelope_Low fmMAEnvelope
Moving_Averages_of_the_High_and_Low_Hi fmMAHighLow
Moving_Averages_of_the_High_and_Low_Low fmMAHighLow
Moving_Correlation_Coefficient fmCorCoefMv
Moving_Covariance fmCovarianceMv
OLAPTRADER | Candlesticks Table 3
Moving_Dispersion fmDispersionMv
Moving_Regression_Line fmRegressionLineMv
Moving_Regression_Line_Slope fmRegressionLineMv
Moving_Standard_Deviation fmStdDevMv
Moving_Standard_Error fmStdErrMv
Moving_Summation fmMovingSum
Negative_Volume_Index_NVI fmNVI
Net_Momentum_Oscillator_NMO fmNMO
On_Balance_Volume_OBV fmOBV
On_Balance_Volume_Expanded_System_Balance_Volume_Array fmOBVolExp
On_Balance_Volume_Expanded_System_Breakout_Indicators fmOBVolExp
On_Balance_Volume_Expanded_System_Field_Trend_Indicators fmOBVolExp
On_Balance_Volume_Moving fmOBVolMv
Open_10_TRIN fmOpen10TRIN
Oscillator_Percent fmOscillatorPct
Oscillator fmOscillator
Overbought_Oversold fmOverBoughtSold
Parabolic_SAR fmSAR
Parabolic_SAR_Position fmSAR
Percentage_Volume_Oscillator_PVO fmPVO
Performance_Indicator fmPerformancePct
Positive_Volume_Index_PVI fmPVI
Price_and_Volume_Trend_PVT fmPVT
Price_Channels_Hi fmPriceChannels
Price_Channels_Low fmPriceChannels
Price_Oscillator_Percent fmPriceOscillatorPct
Price_Oscillator fmPriceOscillator
Price_Volume_Rank fmPVrank
Projection_Bands_Hi fmProjectionBands
Projection_Bands_Low fmProjectionBands
Projection_Bandwidth fmProjectionBandwidth
Projection_Oscillator fmProjectionOscillator
Qstick fmQstick
Random_Walk_Index_RWI_Hi fmRWI
Random_Walk_Index_RWI_Low fmRWI
Range_Indicator fmRangeIndicator
Rate_of_Change fmRateOfChange
Ratio fmRatio
Relative_Momentum_Index_RMI fmRMI
Relative_Strength_Index_RSI fmRSI
Relative_Volatility_Index_RVI_Original_Calculation fmRVIoriginal
Relative_Volatility_Index_RVI fmRVI
r_squared fmRSquared
Simple Moving Average fmSimpleMA
SMA_10 fmSimpleMA
SMA_100 fmSimpleMA
SMA_20 fmSimpleMA
SMA_200 fmSimpleMA
SMA_50 fmSimpleMA
Standard_Error_Bands_Hi fmStdErrBands
Standard_Error_Bands_Low fmStdErrBands
OLAPTRADER | Candlesticks Table 4
Standard_Error_Bands_Mid fmStdErrBands
STIX fmSTIX
Stochastic_Momentum_Index_SMI fmSMI
Stochastic_Momentum_Index_SMI_Signal fmSMI
Stochastic_Oscillator_D fmStochasticOscillator
Stochastic_Oscillator_K fmStochasticOscillator
Stochastic_RSI fmStochRSI
Swing_Index fmSwingIndex
T3 fmT3
TEMA fmTEMA
Trend_Score fmTrendScore
Triangular_Moving_Average fmTriangularMA
Triangular_Moving_Average_10_days fmTriangularMA
Triangular_Moving_Average_100_days fmTriangularMA
Triangular_Moving_Average_20_days fmTriangularMA
Triangular_Moving_Average_200_days fmTriangularMA
Triangular_Moving_Average_50_days fmTriangularMA
TRIX fmTRIX
True_Range_TR fmTR
True_Strength_Index_TSI fmTSI
Typical_Price fmTypicalPrices
Ultimate_Oscillator fmUltimateOsc
Up_Average fmUpAverage
Upside_Downside_Ratio fmUpDownRatio
Variable_Moving_Average fmVariableMA
Variable_Moving_Average_10_days fmVariableMA
Variable_Moving_Average_100_days fmVariableMA
Variable_Moving_Average_20_days fmVariableMA
Variable_Moving_Average_200_days fmVariableMA
Variable_Moving_Average_50_days fmVariableMA
Vertical_Horizontal_Filter_VHF fmVHF
VIDYA fmVIDYA
Volume_Adjusted_Moving_Average fmVolAdjustedMA
Weighted_Close fmWeightedCloses
Weighted_Moving_Average fmWeightedMA
Weighted_Moving_Average_10_days fmWeightedMA
Weighted_Moving_Average_100_days fmWeightedMA
Weighted_Moving_Average_20_days fmWeightedMA
Weighted_Moving_Average_200_days fmWeightedMA
Weighted_Moving_Average_50_days fmWeightedMA
Welles_Wilder_Moving_Average fmWellesMA
Welles_Wilder_Moving_Average_10_days fmWellesMA
Welles_Wilder_Moving_Average_100_days fmWellesMA
Welles_Wilder_Moving_Average_20_days fmWellesMA
Welles_Wilder_Moving_Average_200_days fmWellesMA
Welles_Wilder_Moving_Average_50_days fmWellesMA
Welles_Wilder_Summation fmWellesSum
Welles_Wilder_Volatility_System_ATR_Time_Constant fmWellesVolatility
Welles_Wilder_Volatility_System_Short_Long_Indicators fmWellesVolatility
Welles_Wilder_Volatility_System_Significant_Closes fmWellesVolatility
Welles_Wilder_Volatility_System_Stop_Reverse_Point fmWellesVolatility
OLAPTRADER | Candlesticks Table 5
Williams_Accumulation_Distribution fmWilliamsAD
Williams_Pct_R fmWilliamsR
Zero_Lag_Exponential_Moving_Average fmZeroLagExpMA
Zero_Lag_Exponential_Moving_Average_10_days fmZeroLagExpMA
Zero_Lag_Exponential_Moving_Average_100_days fmZeroLagExpMA
Zero_Lag_Exponential_Moving_Average_20_days fmZeroLagExpMA
Zero_Lag_Exponential_Moving_Average_200_days fmZeroLagExpMA
Zero_Lag_Exponential_Moving_Average_50_days fmZeroLagExpMA
Zig_Zag fmZigZag
CANDLESTICKS TABLE
The following is a list of the Candlestick Patterns which the application computes and inserts into a destination table.
Columns Function Name
Ticker N/A
Date N/A
Abandoned Baby Bottom fmAbandonedBabyBottom
Abandoned Baby Top fmAbandonedBabyTop
Advance Block fmAdvanceBlock
Bearish Belt Hold Line fmBeltHoldLineBear
Bearish Counter Attack fmCounterAttackBear
Bearish Engulfing Line fmEngulfingLineBear
Bearish Separating Line fmSeparatingLineBear
Black Harami Cross fmHaramiCrossBlack
Black Harami fmHaramiBlack
Body Gap Down fmBodyGapDn
Body Gap Up fmBodyGapUp
Bullish Belt Hold Line fmBeltHoldLineBull
Breakaway Bear new function
Breakaway Bull new function
Bullish Counter Attack Bull Line fmCounterAttackBull
Bullish Engulfing Line fmEngulfingLineBull
Bullish Separating Line fmSeparatingLineBull
Candlestick Color fmCandleColor
Dark Cloud Cover fmDarkCloudCover
Deliberation Bear new function
Deliberation Bull new function
DragonflyDoji Bear new function
DragonflyDoji Bull new function
Evening Doji Star fmEveningDojiStar
Evening Star fmEveningStar
Falling Three Method fmFalling3Method
Gravestone Doji fmGravestoneDoji
Hammer fmHammer
Hanging Man fmHangingman
OLAPTRADER | Candlesticks Table 6
High Wave fmHighWave
InNeck line fmInNeckLine
Inverted Hammer fmInvertedHammer
LadderBottom new function
Long Legged Doji fmLongLeggedDoji
MatHold Pattern fmMatHoldPattern
MeetingLines Bear new function
MeetingLines Bull new function
Morning Doji Star fmMorningDojiStar
Morning Star fmMorningStar
OnNeck new function
Outside Bar Formation fmOutsideBar
Piercing Line fmPiercingLine
Rising Three Method fmRising3Method
Shooting Star fmShootingStar
Side by Side White Gapping down fmSideBySideWhiteGapDn
Side by Side White Gapping up fmSideBySideWhiteGapUp
Stalled Pattern fmStalledPattern
Tasuki Downside Gap fmTasukiDownsideGap
Tasuki Upside Gap fmTasukiUpsideGap
Three Gaps Down fmThreeGapsDown
Three Gaps Up fmThreeGapsUp
Three White Soldiers fmThreeWhiteSoldiers
ThreeLineStrike Bear new function
ThreeLineStrike Bull new function
ThreeOutsideDown new function
ThreeOutsideUp new function
ThreeStarsInTheSouth new function
Thrusting Line fmThrustingLine
TriStar Bear new function
TriStar Bull new function
TweezersBottom new function
TweezersTop new function
Upside Gap Two Crows fmUpsideGap2Crows
Western Gap Down fmWesternGapDn
Western Gap Up fmWesternGapUp
White Harami fmHaramiWhite
White Harami Cross 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 Function Name
Ticker N/A
Date N/A
[Fibonacci_Project_1.270] fmFibonacciProject
[Fibonacci_Project_1.414] fmFibonacciProject
[Fibonacci_Project_1.618] fmFibonacciProject
[Fibonacci_Project_2.000] fmFibonacciProject
[Fibonacci_Project_2.240] fmFibonacciProject
[Fibonacci_Retrace_0.382] fmFibonacciRetrace
[Fibonacci_Retrace_0.500] fmFibonacciRetrace
[Fibonacci_Retrace_0.618] fmFibonacciRetrace
[Fibonacci_Retrace_0.707] fmFibonacciRetrace
[Fibonacci_Retrace_0.786] fmFibonacciRetrace
[Close_Plus_0_days] custom
[Close_+_7 days] custom
[Close_+_14 days] custom
[Close_+_28 days] custom
[Close_+_56 days] custom
[Close_+_91 days] custom
[Close_+_182 days] custom
[Close_+_364 days] custom
[Close_+_1456 days] 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.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
OLAPTRADER | Candlesticks Table 8
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.
Columns Ticker
Date
Bullish
Bearish
IsNewBox
BoxTopBreached
BoxBottomBreached
Sample output from the DarvasBoxes table in the Olaptrader database.
OLAPTRADER | Candlesticks Table 9
.NET 2008 SOLUTION
Code Snippets:
INDICATORS
Public Sub PopulateIndicators()
Dim StartTime As Date Dim EndTime As Date Dim ElapsedTime As Long
Dim sql As String
Dim oDR As DataRow Dim oDT As DataTable Dim oDA As OleDbDataAdapter Dim oCB As 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
OLAPTRADER | Candlesticks Table 10
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()
Dim StartTime As Date Dim EndTime As Date Dim ElapsedTime As Long
Dim sql As String
Dim oDR As DataRow Dim oDT As DataTable Dim oDA As OleDbDataAdapter Dim oCB As 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
OLAPTRADER | Candlesticks Table 11
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