NexusFi: Find Your Edge


Home Menu

 





Market analysis with SQL


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one shodson with 4 posts (11 thanks)
    2. looks_two anny with 3 posts (0 thanks)
    3. looks_3 Big Mike with 1 posts (2 thanks)
    4. looks_4 MXASJ with 1 posts (2 thanks)
    1. trending_up 6,220 views
    2. thumb_up 15 thanks given
    3. group 3 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,971 since Jun 2009
Thanks Given: 534
Thanks Received: 3,711

I know I should probably learn MATLIB or SPSS or some other statistical tool, but I've never learned those tools and it turns out I'm really good with SQL Server, so I'm looking at building a data mine of market data and metrics that I am interested in researching.

Currently, I am just doing this on the freely available SQL Express. If/when I need more BI capabilities and SSIS I will migrate to a full developer version of SQL Server.

So, what I've done so far is export a few years of historical data out of NT7 continuous contract data, imported them into SQL, and am now working on creating daily measurements (bars) of the market via stored procedures into fact tables.

For example, here's my script that processes the daily OHLCV data and stores various SMAs that might be of interest.



I have a lot more to do, and can provide updates of my progress, but I was just wondering if anybody else likes analyzing the markets with SQL.


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
SEC Advisory Committee Backs Tokenized Securities Exempt …
Traders Hideout
TradingView Opens Volume Footprint Data to Pine Script - …
TradingView
Third Circuit Backs Kalshi in Landmark Ruling -- Predict …
Prediction Markets & Event Contracts
$24.5 Billion Record Month: Prediction Markets Shatter A …
Prediction Markets & Event Contracts
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 801


Interesting.

If you subscribe to the idea that a trading platform is really just a front end to a database with some market data and brokerage connectors rolled in, it gives you a new perspective.

I posted some C# console apps I'm using to help my own SQL development and understanding of using distributed SQL instances on a network here: . It is in the Elite section but I'd be happy to post the code here if you think it will help this tread develop.

Have you looked at LINQ? Once you have the data you need in SQL you can use external apps to manipulate it and report. LINQ/C#, R to SQL, Matlab to SQL, etc are all at your disposal in way not easily done with the NT database itself.

If you like free stuff R might be worth a look before Matlab.


Reply With Quote
Thanked by:
  #4 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,971 since Jun 2009
Thanks Given: 534
Thanks Received: 3,711


MXASJ View Post
Interesting.

If you subscribe to the idea that a trading platform is really just a front end to a database with some market data and brokerage connectors rolled in, it gives you a new perspective.

I posted some C# console apps I'm using to help my own SQL development and understanding of using distributed SQL instances on a network here: . It is in the Elite section but I'd be happy to post the code here if you think it will help this tread develop.

Have you looked at LINQ? Once you have the data you need in SQL you can use external apps to manipulate it and report. LINQ/C#, R to SQL, Matlab to SQL, etc are all at your disposal in way not easily done with the NT database itself.

If you like free stuff R might be worth a look before Matlab.

I've played with LINQ but, like most other object-data mapping attempts created by Microsoft, I hit a wall that prompted me to throw it away. For object-relational mapping (ORM) I have created my own code generator that I've used for years, based on similar approaches used by Ruby on Rails and other frameworks inspired by enterprise design patterns ( Fowler). Microsoft's "entity framework" looks perhaps maybe they're getting closer, but if you don't have your own ORM framework for .NET I'd recommend Subsonic.


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
 anny 
Chandigarh India
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks
Posts: 20 since Jun 2013
Thanks Given: 26
Thanks Received: 7


shodson View Post
I know I should probably learn MATLIB or SPSS or some other statistical tool, but I've never learned those tools and it turns out I'm really good with SQL Server, so I'm looking at building a data mine of market data and metrics that I am interested in researching.

Currently, I am just doing this on the freely available SQL Express. If/when I need more BI capabilities and SSIS I will migrate to a full developer version of SQL Server.

So, what I've done so far is export a few years of historical data out of NT7 continuous contract data, imported them into SQL, and am now working on creating daily measurements (bars) of the market via stored procedures into fact tables.

For example, here's my script that processes the daily OHLCV data and stores various SMAs that might be of interest.



I have a lot more to do, and can provide updates of my progress, but I was just wondering if anybody else likes analyzing the markets with SQL.

@shodson thanks a lot for this thread. I know it is a very old thread, but could you please post an update. Did you make any progress in doing analysis with SQL ? Or you found it to be very limiting and therefor dumped it midway ?

I am also interested in doing some analysis within SQL Server for the EOD database that I have. I think that a lot of work could be done within such databases, which would be difficult to do in the normal platforms like ninja etc. Since you did this years ago, therefor I am very interested in knowing about your overall practical experience in this regards.

Thanks and regards


Reply With Quote
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557

Be sure to also check:



And



I use MySQL extensively in my own platform (second thread).

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #7 (permalink)
 anny 
Chandigarh India
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks
Posts: 20 since Jun 2013
Thanks Given: 26
Thanks Received: 7


Big Mike View Post
Be sure to also check:



And



I use MySQL extensively in my own platform (second thread).

Mike

Thanks Mike, I will check them out.


Reply With Quote
  #8 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,971 since Jun 2009
Thanks Given: 534
Thanks Received: 3,711


anny View Post
@shodson thanks a lot for this thread. I know it is a very old thread, but could you please post an update. Did you make any progress in doing analysis with SQL ? Or you found it to be very limiting and therefor dumped it midway ?

I am also interested in doing some analysis within SQL Server for the EOD database that I have. I think that a lot of work could be done within such databases, which would be difficult to do in the normal platforms like ninja etc. Since you did this years ago, therefor I am very interested in knowing about your overall practical experience in this regards.

Thanks and regards

Yes I made progress and it's a core part of my trading today. Instead of finding it limiting, I find it very expansive and additive to my trading toolbelt instead of just relying on vendor-provided software. If you have the skills, time, and passion for statistics and quantitative methodologies I highly recommend something along these lines.


Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
 anny 
Chandigarh India
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks
Posts: 20 since Jun 2013
Thanks Given: 26
Thanks Received: 7


shodson View Post
Yes I made progress and it's a core part of my trading today. Instead of finding it limiting, I find it very expansive and additive to my trading toolbelt instead of just relying on vendor-provided software. If you have the skills, time, and passion for statistics and quantitative methodologies I highly recommend something along these lines.

Thanks for the update shodson.

That means that SQL Server has got good potential in this direction. I will definitely spend more time on this.

Regards


Reply With Quote




Last Updated on March 27, 2015


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts