cross posted http://www.ozgrid.com/forum/showthread.php?t=152482
no hits as of 04/21/2011
(excel 14/2010)
(VBA beginner experience level)
I don't know where to begin with this project.
Use PERCENTRANK or QUARTILE, ARRAY?
The data is not always exact so a 'fuzzy match' has to be used I would guess.
The need is to COMPARE RECENT AND PRIOR PERIOD OPEN-HIGH-LOW-COSE price data (pattern recognition)
I am not trying to build charts from stock price data.
I am trying to compare the price data to 'reveal' what could resemble chart patterns.
Once a pattern is recognized the output/result can be copied into the ws calling the code.
So…the idea is to compare the daily stock price data by comparing the 3 most recent periods:
...the most recent day (TODAY)
...the previous day (YESTERDAY)
...the 2nd most previous day (DAY BEFORE YESTERDAY)
So yes, the idea is to find patterns in the data itself. For now I am only seeking one pattern (below).
You can also see the pattern by charting the "BAC" symbol below with the High-Low-Close stock chart(produces a BAR chart)
The numbers in the image refer to the OPEN and CLOSE.
This is image link http://i257.photobucket.com/albums/hh207/in4to5/3days.jpg
You can also see it and the worksheet in these screenshots:
http://i257.photobucket.com/albums/hh207/in4to5/screen1.jpg
http://i257.photobucket.com/albums/hh207/in4to5/screen2.jpg
(if too small to see then right click and save image to desktop, open with Windows Picture Fax viewer and zoom)
You could say I am trying to establish a framework that can be changed depending on the pattern being sought.
Below is data from several days of DAILY data for a few stock symbols.
I have changed some of the data (symbol "BAC") so that it will reflect what I am seeking to calculate and display.
SYMBOL DATE VOLUME OPEN HIGH LOW CLOSE
AA 20101102 17751924 13.12 13.22 13.06 13.21
AA 20101103 21506200 13.19 13.25 12.96 13.14
AA 20101104 28025400 13.36 13.62 13.35 13.6
AA 20101105 32119300 13.67 14.08 13.52 14
BAC 20101102 176164608 11.46 11.55 11.31 11.52
BAC 20101103 175825696 11.56 11.65 11.28 11.36
BAC 20101104 310632192 11.12 11.18 10.89 10.95
BAC 20101105 405209504 10.96 11.2 10.9 11.12
BA 20101102 6378190 70.42 70.55 68.39 69.36
BA 20101103 4670800 69.66 69.73 68.04 68.94
BA 20101104 5758100 70 71.58 69.78 70.85
BA 20101105 3612600 70.85 71.65 70.5 71.27
Not much but it's a start!
Thanks for looking at this!
no hits as of 04/21/2011
(excel 14/2010)
(VBA beginner experience level)
I don't know where to begin with this project.
Use PERCENTRANK or QUARTILE, ARRAY?
The data is not always exact so a 'fuzzy match' has to be used I would guess.
The need is to COMPARE RECENT AND PRIOR PERIOD OPEN-HIGH-LOW-COSE price data (pattern recognition)
I am not trying to build charts from stock price data.
I am trying to compare the price data to 'reveal' what could resemble chart patterns.
Once a pattern is recognized the output/result can be copied into the ws calling the code.
So…the idea is to compare the daily stock price data by comparing the 3 most recent periods:
...the most recent day (TODAY)
...the previous day (YESTERDAY)
...the 2nd most previous day (DAY BEFORE YESTERDAY)
So yes, the idea is to find patterns in the data itself. For now I am only seeking one pattern (below).
You can also see the pattern by charting the "BAC" symbol below with the High-Low-Close stock chart(produces a BAR chart)
The numbers in the image refer to the OPEN and CLOSE.
This is image link http://i257.photobucket.com/albums/hh207/in4to5/3days.jpg
You can also see it and the worksheet in these screenshots:
http://i257.photobucket.com/albums/hh207/in4to5/screen1.jpg
http://i257.photobucket.com/albums/hh207/in4to5/screen2.jpg
(if too small to see then right click and save image to desktop, open with Windows Picture Fax viewer and zoom)
You could say I am trying to establish a framework that can be changed depending on the pattern being sought.
Below is data from several days of DAILY data for a few stock symbols.
I have changed some of the data (symbol "BAC") so that it will reflect what I am seeking to calculate and display.
SYMBOL DATE VOLUME OPEN HIGH LOW CLOSE
AA 20101102 17751924 13.12 13.22 13.06 13.21
AA 20101103 21506200 13.19 13.25 12.96 13.14
AA 20101104 28025400 13.36 13.62 13.35 13.6
AA 20101105 32119300 13.67 14.08 13.52 14
BAC 20101102 176164608 11.46 11.55 11.31 11.52
BAC 20101103 175825696 11.56 11.65 11.28 11.36
BAC 20101104 310632192 11.12 11.18 10.89 10.95
BAC 20101105 405209504 10.96 11.2 10.9 11.12
BA 20101102 6378190 70.42 70.55 68.39 69.36
BA 20101103 4670800 69.66 69.73 68.04 68.94
BA 20101104 5758100 70 71.58 69.78 70.85
BA 20101105 3612600 70.85 71.65 70.5 71.27
Not much but it's a start!
Code:
Sub periodscan()
Application.ScreenUpdating = False
Dim SymbolData As Range
Dim vSymbol() 'stock ticker
Dim DateP2(), OpenP2(), HighP2(), LowP2(), CloseP2(), VolumeP2()
' "P2" signifies older Previous Period (if DAY data then would be DAY BEFORE YESTERDAY)
Dim DateP1(), OpenP1(), HighP1(), LowP1(), CloseP1(), VolumeP1()
' "P1" signifies recent Previous Period (if DAY data then would be YESTERDAY)
Dim DateL(), OpenL(), HighL(), LowL(), CloseL(), VolumeL()
' "L" signifies Latest Period (if DAY data then would be TODAY)
Set SymbolData = Worksheets("Data").Range("A1", Range("G" & Rows.Count).End(xlUp))
End Sub