All Projects → rustdesk → opentick

rustdesk / opentick

Licence: Apache-2.0 License
A fast tick database for financial timeseries data, built on FoundationDB with simplified SQL layer

Programming Languages

C++
36643 projects - #6 most used programming language
go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to opentick

NasdaqCloudDataService-SDK-Java
Nasdaq Data Link provides a modern and efficient method of delivery for real-time exchange data and other financial information. This repository provides a Java SDK for developing applications using Nasdaq Data Link's real-time data.
Stars: ✭ 70 (-57.83%)
Mutual labels:  market-data
intrinio-realtime-python-sdk
Intrinio Python SDK for Real-Time Stock Prices
Stars: ✭ 79 (-52.41%)
Mutual labels:  market-data
IEXSharp
IEX Cloud API for C# and other .net languages. Supports SSE streaming
Stars: ✭ 87 (-47.59%)
Mutual labels:  market-data
ib
Interactive Brokers TWS/IB Gateway API client library for Node.js (TS)
Stars: ✭ 94 (-43.37%)
Mutual labels:  market-data
PT.MarketDataService
Market Data collector for Interactive Brokers
Stars: ✭ 16 (-90.36%)
Mutual labels:  market-data
pyrfa
Open sourced Python API for Refinitiv (Thomson Reuters) Enterprise Platform.
Stars: ✭ 49 (-70.48%)
Mutual labels:  market-data
rb3
A bunch of downloaders and parsers for data delivered from B3
Stars: ✭ 52 (-68.67%)
Mutual labels:  market-data
ccapi
A header-only C++ library for interacting with crypto exchanges. Binding for Python is provided. A spot market making application is also provided as an end-to-end solution for liquidity providers.
Stars: ✭ 227 (+36.75%)
Mutual labels:  market-data
crypto-watchdog
Crypto Watchdog is an open-source developer friendly project, periodically queries crypto market and notifies potential pumps & recently added tokens/coins via web-hooks.
Stars: ✭ 22 (-86.75%)
Mutual labels:  market-data
dados-financeiros
Repositório de Fontes de Dados Financeiros do Brasil
Stars: ✭ 119 (-28.31%)
Mutual labels:  market-data
candlestick retriever
Retrieve all historical candlestick data from crypto exchange Binance and upload it to Kaggle.
Stars: ✭ 122 (-26.51%)
Mutual labels:  market-data
TradeBot
Crypto trading bot using Binance API (Java)
Stars: ✭ 292 (+75.9%)
Mutual labels:  market-data
ib dl
Historical market data downloader using Interactive Brokers TWS
Stars: ✭ 43 (-74.1%)
Mutual labels:  market-data
mftool
Python library for getting real-time Mutual Funds data in India
Stars: ✭ 76 (-54.22%)
Mutual labels:  market-data
DACP
A digital asset personal portfolio for investors in the cryptosphere
Stars: ✭ 22 (-86.75%)
Mutual labels:  market-data
dukascopy-tools
✨ Download historical price tick data for Crypto, Stocks, ETFs, CFDs, Forex via CLI and Node.js ✨
Stars: ✭ 128 (-22.89%)
Mutual labels:  market-data
pinance
Python module(s) to get stock data, options data and news.
Stars: ✭ 70 (-57.83%)
Mutual labels:  market-data
coinbash
💰 A bash script (CLI) for displaying crypto currencies market data in a terminal 🖥
Stars: ✭ 110 (-33.73%)
Mutual labels:  market-data
bitcoin-stock-to-flow
Stock-to-Flow ratio and price for Bitcoin
Stars: ✭ 19 (-88.55%)
Mutual labels:  market-data
TraderBot
No description or website provided.
Stars: ✭ 39 (-76.51%)
Mutual labels:  market-data

OpenTick

OpenTrade Logo

OpenTick is a fast tick database for financial timeseries data, built on FoundationDB with simplified SQL layer.

Features:

  • Built-in price adjustment support

  • Nanosecond support

  • Python, C++ and Go SDK

  • Both sync and async query

  • Implicit SQL statement prepare

  • Permission Control, check Python API for related functions, turned off by default

  • Cache

Installation on Ubuntu

You need to use Go >=1.11 which has module support.

sudo apt install -y python
wget https://www.foundationdb.org/downloads/6.2.22/ubuntu/installers/foundationdb-server_6.2.22-1_amd64.deb
wget https://www.foundationdb.org/downloads/6.2.22/ubuntu/installers/foundationdb-clients_6.2.22-1_amd64.deb
sudo dpkg -i foundationdb-clients_6.2.22-1_amd64.deb foundationdb-server_6.2.22-1_amd64.deb
git clone https://github.com/opentradesolutions/opentick
make build
sudo apt install nodejs
sudo npm install -g pm2
pm2 start ./opentick

Note: FoundationDB runs in memory storage mode and only one process by default. You can change it to disk storage as belows:

user@host$ fdbcli
fdb> configure ssd

Fore more configuration on FoundationDB, please check FoundationDB Configuration

Usage

Python

pip install opentick

C++

Go

Performance

100k ohlcv bar inserted in 1 second.

user@host:~/opentick/bindings/go$ go run test.go
2018/11/27 21:27:23 4.500470184s 5.500314708s 0 100000 all insert futures get done
2018/11/27 21:27:25 861.306778ms 1.139363333s 0 10 all batch insert futures get done
2018/11/27 21:27:26 805.542584ms 100000 retrieved with ranges
2018/11/27 21:27:27 1.782497936s 100000 retrieved with async
2018/11/27 21:27:29 1.424262818s 100000 retrieved with one sync
user@host:~/opentick/bindings/python$ ./test.py
2018-11-27 21:29:10.168138 0:00:00.200577 0:00:06.724991 0 100000 all insert futures get done
2018-11-27 21:29:12.192570 0:00:00.176540 0:00:00.959563 0 10 all batch insert futures get done
2018-11-27 21:29:13.460025 0:00:01.267462 100000 retrieved with ranges
2018-11-27 21:29:15.077686 0:00:01.617666 100000 retrieved with async
2018-11-27 21:29:16.777043 0:00:01.699361 100000 retrieved with one sync
user@host:~/opentick/bindings/cpp$ make test
21:33:19.231156889: 4.22207s 4.84954s 0 100000 all insert futures get done
21:33:20.172744180: 0.447708s 0.934337s 0 10 all batch insert futures get done
21:33:21.677161076: 1.49497s 100000 retrieved with async

Sample Code (C++)

  • Create database and table
auto conn = Connection::Create("127.0.0.1", 1116);
conn->Start();
conn->Execute("create database if not exists test");
conn->Use("test");
conn->Execute(R"(
      create table if not exists test(sec int, interval int, tm timestamp,
      open double, high double, low double, close double, v double, vwap
      double, primary key(sec, interval, tm))
)");
  • Execute
// opentick prepares the sql statement automatically, no need to prepare explicitly
auto fut = conn->ExecuteAsync(
          "select * from test where sec=1 and interval=?", Args{1}));
auto res = fut->Get(); // blocked wait until execution done
// Get last 2 rows ordering by primary key
auto res = conn->Execute(
        "select tm from test where sec=1 and interval=? limit -2", Args{1});
  • Insert
static const std::string kInsert =
    "insert into test(sec, interval, tm, open, high, low, close, vol, vwap) "
    "values(?, ?, ?, ?, ?, ?, ?, ?, ?)";
std::vector<Future> futs;
for (auto i = 0; i < 1000; ++i) {
  futs.push_back(conn->ExecuteAsync(kInsert, Args{1, 1, system_clock::now(), 2.2, 2.4, 2.1, 2.3, 1000000, 2.25}));
}
// wait for all insertion done
for (auto fut : futs) fut->Get();
  • Batch Insert
Argss argss;
for (auto i = 0; i < 1000; ++i) {
  argss.push_back(Args{1, i, system_clock::now(), 2.2, 2.4, 2.1, 2.3, 1000000, 2.25});
}
conn->BatchInsert(kInsert, argss);
  • Price Adjustments
auto res = conn->Execute(
        "select tm, adj(open), adj(high), adj(low), adj(close), adj(vol) from test where sec=1 and interval=? limit -2", Args{1});

For more details, please checkout adj_test.go

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].