SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Calculating Moving Averages with T-SQL


Calculating Moving Averages with T-SQL

Author
Message
Gabriel P
Gabriel P
Right there with Babe
Right there with Babe (738 reputation)Right there with Babe (738 reputation)Right there with Babe (738 reputation)Right there with Babe (738 reputation)Right there with Babe (738 reputation)Right there with Babe (738 reputation)Right there with Babe (738 reputation)Right there with Babe (738 reputation)

Group: General Forum Members
Points: 738 Visits: 947
Comments posted to this topic are about the item Calculating Moving Averages with T-SQL
Satnam Singh
Satnam Singh
Say Hey Kid
Say Hey Kid (674 reputation)Say Hey Kid (674 reputation)Say Hey Kid (674 reputation)Say Hey Kid (674 reputation)Say Hey Kid (674 reputation)Say Hey Kid (674 reputation)Say Hey Kid (674 reputation)Say Hey Kid (674 reputation)

Group: General Forum Members
Points: 674 Visits: 1084
Nice article and Very well explained...

Cheers,
Satnam
minnyperry
minnyperry
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 1
All topics are very good here.. when I read this full details so I am very impress to this.........
Acai Optimum
weider x factor
Ritesh Medhe
Ritesh Medhe
SSChasing Mays
SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)

Group: General Forum Members
Points: 607 Visits: 234
Lovely piece of work..
ChrisM@Work
ChrisM@Work
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28634 Visits: 19842
Gabriel P (3/3/2010)
Comments posted to this topic are about the item <A HREF="/articles/Moving+Average/69389/">Calculating Moving Averages with T-SQL</A>


Excellent article, Gabriel. I reckon it's time to start messing with those pesky CTE's again.

<< and therefore isn't a good indicator of what the immediate future might hold. >>
Have a word with Gail about DBCC TIMEWARP, without too much effort you should get the last ten days and the next ten days.

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
sushil9313333532
sushil9313333532
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 12
hi ..........i m aldon .how 2 improve my sql tech.
TimvdH
TimvdH
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 117
Great work, thank you! Would love to read more about technical analysis and sql. Or even better: portfolio theory and sql. BTW: does someone know if using MDX / Analysis Server makes sense here (query performance wise)? I guess it could make sense if all you need is the most recent moving average, but I know too little about AS to really have an idea. I was thinking about trying to use AS to calculate securities price correlations. Maybe someone knows if it makes sense to try this at all. After all you need to import the daily securities data into the data mart every day (I hope it is possible to add only the most recent day after an initial import). If someone has any hands on experience about (ten thousands of) time series in AS, I would be most interested...

Regards
Tim
shogg
shogg
SSC Journeyman
SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)

Group: General Forum Members
Points: 81 Visits: 112
This is very useful and well detailed. Much appreciated!!!

HoggZilla
Edward Boyle-478467
Edward Boyle-478467
SSC-Enthusiastic
SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)

Group: General Forum Members
Points: 172 Visits: 1163
Excellent article.

I have a huge volume of historical data [3 years of data at 15 minute intervals] and will try out the method this weekend

Thanks
Dean Cochrane
Dean Cochrane
SSC Veteran
SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)

Group: General Forum Members
Points: 226 Visits: 641
This is one of the best articles I have read in a long time. Excellent work.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search