Calculating Moving Averages with T-SQL

  • Gabriel P

    SSCarpal Tunnel

    Points: 4289

    Comments posted to this topic are about the item Calculating Moving Averages with T-SQL

  • Satnam Singh

    Hall of Fame

    Points: 3542

    Nice article and Very well explained...

    Cheers,

    Satnam

  • minnyperry

    SSC Rookie

    Points: 41

    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

    SSCommitted

    Points: 1941

    Lovely piece of work..

  • ChrisM@Work

    SSC Guru

    Points: 186087

    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.

    [font="Arial"]“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw[/font]


    For fast, accurate and documented assistance in answering your questions, please read this article[/url].
    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]
    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
    [url

  • sushil9313333532

    SSC Rookie

    Points: 39

    hi ..........i m aldon .how 2 improve my sql tech.

  • TimvdH

    Valued Member

    Points: 59

    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

    Mr or Mrs. 500

    Points: 541

    This is very useful and well detailed. Much appreciated!!!

    HoggZilla

  • Edward Boyle-478467

    Ten Centuries

    Points: 1133

    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

    SSC Eights!

    Points: 962

    This is one of the best articles I have read in a long time. Excellent work.

  • rkkelly

    SSC Enthusiast

    Points: 130

    Nice to have an alternative to self joins for the sliding window average. Thanks for the post.

  • kamban

    Grasshopper

    Points: 22

    Yes, but how we can make connection to some live data source so we can do live trading analyse?

    F

  • JJ B

    SSCarpal Tunnel

    Points: 4571

    So well written and explained. Thanks for taking the time to share this with us.

  • Tom Garth

    SSCertifiable

    Points: 6173

    Good code. Good read. Lot's of fun.

    Thanks for the time and effort that you put into writing the article.

    Tom Garth
    Vertical Solutions[/url]

    "There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers
  • Calvin Lawson

    SSChampion

    Points: 11030

    In the immortal words of Paris Hilton, "That's hot". I love the technique and the article is very well written.

    Signature is NULL

Viewing 15 posts - 1 through 15 (of 81 total)

You must be logged in to reply to this topic. Login to reply