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 datadate | Open | Close | high | low10/1/14 9:15 AM | 20.04 | 20.04 | 20.04 | 20.0410/1/14 9:16 AM | 20.12 | 20.12 | 20.12 | 20.1210/1/14 9:17 AM | 20.08 | 20.08 | 20.08 | 20.0810/1/14 9:18 AM | 20.09 | 20.09 | 20.09 | 20.0910/1/14 9:19 AM | 20.14 | 20.14 | 20.14 | 20.1410/1/14 9:19 AM | 20.12 | 20.12 | 20.12 | 20.1210/1/14 9:20 AM | 20.13 | 20.13 | 20.13 | 20.1310/1/14 9:21 AM | 20.22 | 20.22 | 20.22 | 20.2210/1/14 9:22 AM | 20.21 | 20.21 | 20.21 | 20.2110/1/14 9:23 AM | 20.11 | 20.11 | 20.11 | 20.1110/1/14 9:24 AM | 20.17 | 20.17 | 20.17 | 20.1710/1/14 9:25 AM | 20.14 |20.14 | 20.14 | 20.14Outputdate | Open | Close | high | low10/1/14 9:20 AM | 20.04 | 20.13 | 20.14 | 20.0410/1/14 9:25 AM | 20.22 | 20.14 | 20.22 | 20.11This 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..
↧