Coder Social home page Coder Social logo

mongodb-in-financial-market's Introduction

mongodb-in-financial-market

mongodb solution for financial market data

what and how

This project comes with a solution to store and query financial data(stocks,contracts and other similar financial instruments) through Mongodb. It consists of two parts of work:first,migrate the market data(.csv files) to a Mongodb database and second fetch the data through network.

When the data migrations are done,you'll get three levels of bar data in the database,aka per minute,per hour and per day,also the original ticks data will be kept in a ticks collection.But we compress that data(one instrument per day) before it is put to the database.It saves disk storage and more importantly, will reduce the transportation time through the wire,especially when you have a really large dataset after years of years accumulation.

The query module provides with python,Matlab and R interfaces for users to choose their favourite tools.

usage

query

two kinds of query,bar type and tick type,they share a very similar grammar even between different programming languages. For example,python:

start = datetime.datetime(2015,1,3,14)
end = datetime.datetime(2016,4,30,11)
q = Query(com)
# query bar
bar = q.GetBar('TF1506','min',start,end)
#query ticks
tick = q.GetTicks('TF1506',['TradingDay','LastPrice','HighestPrice','LowestPrice'],start,end,1)

you will find examples in their separate folders.

migrate

In the migrate folder,you will see a migrate.py,fill the dir with your own data directory,and beaware it's not done yet.

You'll have to make your own copy of parser to dealing with your files,but it's not much work to worry about.see cffex.py or sh.py to get a better understanding.

And finally,you'll prepare the conf file and write it in your flavour accordingly,m.conf and sh.conf are easy examples.

After that,just open a terminal and change to the migrate directory,print 'python migrate.py',you see all is so nice and easy.

mongodb-in-financial-market's People

Contributors

tianyaqu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.