Advertisement

03.21.2008 at 01:19AM PDT, ID: 23259256
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

Which SQL code to make a quotes 5 mns time frame table from a 1 mn time frame table ?

Asked by Couturier in SQL Query Syntax, Databases Miscellaneous

Tags: ,

Hello,

This is my SQL database engine :
http://www.h2database.com/html/frame.html


Which SQL code to make a quotes 5 mns  time frame table from a 1 mn
time frame table ?
I have already did and populate a 1 mn  time frame table.

CREATE TABLE QUOTES1MN
(
   DATE TIMESTAMP,
   OPEN DOUBLE,
   HIGH DOUBLE,
   LOW DOUBLE,
   CLOSE DOUBLE,
   VOLUME BIGINT
)
;

All the things I need to do to make my quotes 5 mns  time frame table.

First ligne 5 mns, is about 5 lignes 1 mn.
Do it like that :
DATE : is DATE from minute 4.
OPEN : is OPEN from minute 0
HIGH : is the highest HIGH from minutes 0 to 4.
LOW : is the lowest LOW from minutes 0 to 4.
CLOSE : is CLOSE from minute 4
VOLUME : is sum VOLUME from minutes  0 to 4.

Second ligne 5 mns, is about next 5 lignes 1 mn.
Do it like that :
DATE : is DATE from minute 9.
OPEN : is OPEN from minute 5
HIGH : is the highest HIGH from minutes 5 to 9.
LOW : is the lowest LOW from minutes 5 to 9.
CLOSE : is CLOSE from minute 9
VOLUME : is sum VOLUME from minutes  0 to 4.

Third ligne 5 mns, is about next 5 lignes 1 mn.
Do it like that :
DATE : is DATE from minute 14.
OPEN : is OPEN from minute 10
HIGH : is the highest HIGH from minutes 10 to 14.
LOW : is the lowest LOW from minutes 10 to 14.
CLOSE : is CLOSE from minute 9
VOLUME : is sum VOLUME from minutes  10 to 14.

etc.

Datas from table QUOTES1MN.

DATE,OPEN,HIGH,LOW,CLOSE,VOLUME
2007-01-02 12:00:00.0,"1,9715","1,9715","1,97125","1,97125",-1
2007-01-02 12:01:00.0,"1,97125","1,9714","1,9709","1,97095",-1
2007-01-02 12:02:00.0,"1,97095","1,9713","1,9709","1,9713",-1
2007-01-02 12:03:00.0,"1,9713","1,9713","1,9711","1,97115",-1
2007-01-02 12:04:00.0,"1,97115","1,97115","1,9709","1,971",-1
2007-01-02 12:05:00.0,"1,971","1,97105","1,9697","1,97005",-1
2007-01-02 12:06:00.0,"1,97005","1,97005","1,9697","1,9699",-1
2007-01-02 12:07:00.0,"1,9699","1,97005","1,9697","1,9697",-1
2007-01-02 12:08:00.0,"1,9697","1,9698","1,96935","1,9697",-1
2007-01-02 12:09:00.0,"1,9697","1,96985","1,96945","1,9697",-1
2007-01-02 12:10:00.0,"1,9697","1,96975","1,9697","1,96975",-1
2007-01-02 12:11:00.0,"1,96975","1,96975","1,96935","1,96945",-1
2007-01-02 12:12:00.0,"1,96945","1,9695","1,96945","1,9695",-1
2007-01-02 12:13:00.0,"1,9695","1,96955","1,96945","1,96955",-1
2007-01-02 12:14:00.0,"1,96955","1,9697","1,96955","1,9696",-1
2007-01-02 12:15:00.0,"1,9696","1,96975","1,96955","1,96975",-1
2007-01-02 12:16:00.0,"1,96975","1,9702","1,96975","1,97015",-1
2007-01-02 12:17:00.0,"1,97015","1,97065","1,97015","1,97065",-1
2007-01-02 12:18:00.0,"1,97065","1,97075","1,9706","1,9707",-1
2007-01-02 12:19:00.0,"1,9707","1,9709","1,9706","1,9709",-1
2007-01-02 12:20:00.0,"1,9709","1,9711","1,9709","1,971",-1
2007-01-02 12:21:00.0,"1,971","1,971","1,97085","1,9709",-1 Start Free Trial
 
Keywords: Which SQL code to make a quotes 5 …
 
Loading Advertisement...
 
[+][-]03.23.2008 at 07:10AM PDT, ID: 21189675

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Databases Miscellaneous
Sign Up Now!
Solution Provided By: Lowfatspread
Participating Experts: 1
Solution Grade: B
 
 
[+][-]03.26.2008 at 02:22PM PDT, ID: 21216344

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080924-EE-VQP-39 / EE_QW_2_20070628