Code Monkey home page Code Monkey logo

questdbreactstockcharts's Introduction

Questdb + React stock charts

Project for AGH ASK classes. The goal was to present Questdb as a time series data provider along with proper visualisations built with D3.

Pros and cons Questdb

Plus

  • Really fast with a lot of data including filtering by timestamp
  • Cool import feature (you can import data using csv)
  • Console and API
  • Docker
  • Built-in visualisations

Minus

  • Hard to configure authentication and caches
  • Not yet all SQL features in place

Time-series data for stock charts goes well with QuestDb. Its really easy to populate database and do some queries. Joins are blazingly fast and cooperative as well as filtering. On the frontend side I am using react stock charts library that is built on top of d3. Besides that I use cors-anywhere to provide API as a CORS proxy

Queries samples

select spx.time, spx.close as SPX_close, btc.close as BTC_close
from 'SP_SPX, D.csv' as spx
left join 'BTCUSD, D.csv' as btc on spx.time = btc.time
group by 'BTCUSD, D.csv'.time
select * from 'BTCUSD, D.csv' where to_timestamp(time) > to_timestamp('2020-01-01')

Prerequisites

  • Docker
  • Node with Yarn (npm install --global yarn)

Get started

  • Run questdb.run.sh
  • Open browser and navigate to localhost:9000 then in import section browse 2 csv files with BTC and SPX data and send them image
  • Tables are automatically created so go to Console and try queries out

Part 2

  • Navigate to react root, install packages using command yarn
  • Run yarn cors-anywhere
  • Run yarn start

Good to know

React uses tailwind css. There are 2 types of charts: Line and OHLC. Line is for BTC/SPX correlation, on the other hand OHLC is just for BTC. BTC chart also have 50 simple moving average

Enjoy

questdbreactstockcharts's People

Contributors

tomebee 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.