October 8, 2014 at 9:53 am
Hi,
I have the open, close, high & low prices in a table. These are 0 minutes data, Would want to generate 5min, 15 min, 30 min, 60 min, 120min, 240 min, daily etc data. the table structure is
CREATE TABLE [dbo].[0mindata]
(
[PDateTime] [datetime] NOT NULL,
[Opening] [decimal](5, 2) NOT NULL,
[Closing] [decimal](5, 2) NOT NULL,
[High] [decimal](5, 2) NOT NULL,
[Low] [decimal](5, 2) NOT NULL,
)
Input data
date | Open| Close| high| low
10/1/14 9:15 AM| 20.04| 20.04| 20.04| 20.04
10/1/14 9:16 AM| 20.12| 20.12| 20.12| 20.12
10/1/14 9:17 AM| 20.08| 20.08| 20.08| 20.08
10/1/14 9:18 AM| 20.09| 20.09| 20.09| 20.09
10/1/14 9:19 AM| 20.14| 20.14| 20.14| 20.14
10/1/14 9:19 AM| 20.12| 20.12| 20.12| 20.12
10/1/14 9:20 AM| 20.13| 20.13| 20.13| 20.13
10/1/14 9:21 AM| 20.22| 20.22| 20.22| 20.22
10/1/14 9:22 AM| 20.21| 20.21| 20.21| 20.21
10/1/14 9:23 AM| 20.11| 20.11| 20.11| 20.11
10/1/14 9:24 AM| 20.17| 20.17| 20.17| 20.17
10/1/14 9:25 AM| 20.14|20.14| 20.14| 20.14
Output
date | Open| Close| high| low
10/1/14 9:20 AM| 20.04| 20.13| 20.14| 20.04
10/1/14 9:25 AM| 20.22| 20.14| 20.22| 20.11
This is the result for a 5 min chart data. Open price of 9.15 AM as open, close price of 9.20 AM as Close, max of 9.15-9.20 AM as high & min of 9.15 -9.20 AM as low & like wise. the timeframe can vary like 1 min, 5 min, 10min, etc..
October 8, 2014 at 10:10 am
balasundar.sp (10/8/2014)
Hi,I have the open, close, high & low prices in a table. These are 0 minutes data, Would want to generate 5min, 15 min, 30 min, 60 min, 120min, 240 min, daily etc data. the table structure is
CREATE TABLE [dbo].[0mindata]
(
[PDateTime] [datetime] NOT NULL,
[Opening] [decimal](5, 2) NOT NULL,
[Closing] [decimal](5, 2) NOT NULL,
[High] [decimal](5, 2) NOT NULL,
[Low] [decimal](5, 2) NOT NULL,
)
Quick question, can you provide some sample data and preferably the expected results based on the data sample?
😎
October 10, 2014 at 1:41 am
These are stock tickers, i am actually trying to generate candlestick chart using these data. The user would choose whether he wants to see a 5min chart or whatever time chart he wants to see.
October 10, 2014 at 1:56 am
Duplicate posting, respond to this thread instead.
😎
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply