All Projects → ffeast → finam-export

ffeast / finam-export

Licence: Apache-2.0 license
Python client library to download historical data from finam.ru

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to finam-export

Blankly
🚀 💸 Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, cryptos, and forex across exchanges w/ one package.
Stars: ✭ 1,456 (+1633.33%)
Mutual labels:  trading, stocks, investment
degiro-trading-tracker
Simplified tracking of your investments
Stars: ✭ 16 (-80.95%)
Mutual labels:  trading, stocks, investment
Backtesting.py
🔎 📈 🐍 💰 Backtest trading strategies in Python.
Stars: ✭ 1,124 (+1238.1%)
Mutual labels:  trading, stocks, investment
Sumzerotrading
A Java API for Developing Automated Trading Applications for the Equity, Futures, and Currency Markets
Stars: ✭ 128 (+52.38%)
Mutual labels:  trading, stocks, futures
Tradestation
EasyLanguage indicators and systems for TradeStation
Stars: ✭ 65 (-22.62%)
Mutual labels:  trading, stocks, futures
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (+57.14%)
Mutual labels:  trading, stocks
Robinhood On Rails
A web dashboard for the free trading platform Robinhood using Ruby on Rails and a private API
Stars: ✭ 134 (+59.52%)
Mutual labels:  trading, stocks
Vnpy
基于Python的开源量化交易平台开发框架
Stars: ✭ 17,054 (+20202.38%)
Mutual labels:  trading, investment
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+195.24%)
Mutual labels:  trading, stocks
NSE-Stock-Scanner
National Stock Exchange (NSE), India based Stock screener program. Supports Live Data, Swing / Momentum Trading, Intraday Trading, Connect to online brokers as Zerodha Kite, Risk Management, Emotion Control, Screening, Strategies, Backtesting, Automatic Stock Downloading after closing, live free day trading data and much more
Stars: ✭ 78 (-7.14%)
Mutual labels:  stocks, futures
pair-trading-view
Pair Trading View - .NET application for visual analysis of synthetic financial instruments based on statistical models.
Stars: ✭ 45 (-46.43%)
Mutual labels:  stocks, investment
gym-mtsim
A general-purpose, flexible, and easy-to-use simulator alongside an OpenAI Gym trading environment for MetaTrader 5 trading platform (Approved by OpenAI Gym)
Stars: ✭ 196 (+133.33%)
Mutual labels:  trading, stocks
Fast arrow
(no longer maintained) A simple yet robust (stock+options) API client for Robinhood
Stars: ✭ 127 (+51.19%)
Mutual labels:  trading, stocks
Trading Server
A multi-asset, multi-strategy, event-driven trade execution and management platform for running many algorithms/bots at many venues simultaneously with unified risk management and reporting. Uses MongoDB for storage and Telegram for user notifications/trade consent.
Stars: ✭ 191 (+127.38%)
Mutual labels:  trading, futures
Shinny Futures Android
一个开源的 android 平台期货行情交易终端
Stars: ✭ 120 (+42.86%)
Mutual labels:  trading, futures
Tradingview Trainer
A lightweight app for practicing your trading on Tradingview
Stars: ✭ 106 (+26.19%)
Mutual labels:  trading, stocks
cira
Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.
Stars: ✭ 21 (-75%)
Mutual labels:  trading, stocks
Mida
The open-source and cross-platform trading framework
Stars: ✭ 263 (+213.1%)
Mutual labels:  trading, stocks
tstock
📈A command line tool to view stock charts in the terminal.
Stars: ✭ 498 (+492.86%)
Mutual labels:  trading, stocks
Surpriver
Find big moving stocks before they move using machine learning and anomaly detection
Stars: ✭ 1,152 (+1271.43%)
Mutual labels:  trading, investment

finam-export

Build Status

Python client library to download data from finam.ru

Capabilities

  • Contracts lookup by market categories, id, code, name or their combinations using a rich set of mathching options
  • Downloads data of any timeframe available on finam.ru ranging from ticks to monthly resolution
  • Allows to download data for arbitrarily long intervals

Installation

  • pip install finam-export

Samples provided

  • samples/listing.py - simply lists some contracts from every supported market
  • samples/download.py - downloads some data and prints it out
  • samples/lookups.py - shows how you can leverage lookup capabilities

Utility scripts

  • scripts/finam-download.py - feature-rich standalone script to download finam's data
  • scripts/finam-lookup.py - to quickly check what's availble on finam

Show me something working!

Here's the output

*** Current Russian ruble exchange rates ***
INFO:finam.export:Fetching https://www.finam.ru/profile/moex-akcii/gazprom/export/
INFO:finam.export:Fetching https://www.finam.ru/cache/N72Hgd54/icharts/icharts.js
INFO:finam.export:Fetching http://export.finam.ru/table.csv?d=d&f=table&e=.csv&dtf=1&tmf=3&MSOR=0&mstime=on&mstimever=1&sep=3&sep2=1&at=1&p=8&em=182456&market=45&df=1&mf=0&yf=2007&dt=12&mt=8&yt=2020&cn=USD000000TOD&code=USD000000TOD&datf=5
        <DATE>    <TIME>  <OPEN>  <HIGH>  <LOW>  <CLOSE>      <VOL>
2163  20200911  00:00:00   75.19   75.19  74.72    74.95  765709000
*** Current Brent Oil price ***
INFO:finam.export:Fetching http://export.finam.ru/table.csv?d=d&f=table&e=.csv&dtf=1&tmf=3&MSOR=0&mstime=on&mstimever=1&sep=3&sep2=1&at=1&p=8&em=19473&market=24&df=1&mf=0&yf=2007&dt=12&mt=8&yt=2020&cn=BZ&code=BZ&datf=5
        <DATE>    <TIME>  <OPEN>  <HIGH>  <LOW>  <CLOSE>   <VOL>
4206  20200911  00:00:00   39.96   40.34  39.38    39.92  114897

and here's the code producing this output:

import logging

from finam import Exporter, Market, LookupComparator

"""
Full-on example displaying up-to-date values of some important indicators
"""

def main():
    exporter = Exporter()
    print('*** Current Russian ruble exchange rates ***')
    rub = exporter.lookup(name='USDRUB_TOD', market=Market.CURRENCIES)
    assert len(rub) == 1
    data = exporter.download(rub.index[0], market=Market.CURRENCIES)
    print(data.tail(1))

    print('*** Current Brent Oil price ***')
    oil = exporter.lookup(name='Brent', market=Market.COMMODITIES,
                          name_comparator=LookupComparator.EQUALS)
    assert len(oil) == 1
    data = exporter.download(oil.index[0], market=Market.COMMODITIES)
    print(data.tail(1))


if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO)
    main()

Playing samples

If you have cloned it from github:

pip install -r ./requirements.txt
PYTHONPATH=. ./samples/listing.py

Technical details

  • Targeted to Linux/Mac
  • Uses pandas inside, all data returned is pandas DataFrames
  • Tested with python3.7+
  • Good tests coverage
  • Detailed logging of what's going on

Development

  • clone the repo
  • pip install -r ./requirements.txt
  • run tests to ensure all is fine
  • nosetests
  • go ahead and enhance it!
  • don't forget to cover your changes with tests
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].