GithubHelp home page GithubHelp logo

quicket-bazuev / moex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dvigal/moex

0.0 0.0 0.0 27 KB

Unofficial ISS MOEX API on Python

License: GNU General Public License v3.0

Python 100.00%

moex's Introduction

PyMOEX

Unofficial ISS MOEX API on Python

Installation

Run the following to instal PyMOEX

git clone https://github.com/dvigal/moex.git
pip install .

Dependencies

PyMOEX API runs on Python 3. You'll also need pip.

PyMOEX depends on the following Python packages:

Pandas A powerful data analysis / manipulation library for Python.

Usage examples

from moex import MOEX
moex = MOEX()
data = moex.history_engines_stock_totals_securities(date_start='2018-01-01', date_end='2018-08-16', secid=['SBER'])
data[["SYSTIME", "SECID", "OPEN", "CLOSE", "LOW", "HIGH", "VOLUME"]]

output

sber = data
sber = sber.set_index(DatetimeIndex(sber['DATE']))
sber["VOLUME"] = sber["VOLUME"].apply(float) / 1000000
sber["CLOSE"] = sber["CLOSE"].apply(float)
sber["OPEN"] = sber["OPEN"].apply(float)
sber["LOW"] = sber["LOW"].apply(float)
sber_weekly = sber[["DATE", "CLOSE", "OPEN", "HIGH", "LOW", "VOLUME"]].groupby(Grouper(freq='W', level=0)).agg({"CLOSE" : "max", "OPEN" : "min", "HIGH" : "first", "LOW" : "first", "VOLUME" : "mean"})
sber_weekly["CLOSE"].apply(float).plot(figsize=(16,4), title="Weekly", grid=True, legend=True)
sber_weekly["OPEN"].apply(float).plot(figsize=(16,4), title="Weekly", grid=True, legend=True)
sber_weekly["HIGH"].apply(float).plot(figsize=(16,4), title="Weekly", grid=True, legend=True)
sber_weekly["LOW"].apply(float).plot(figsize=(16,4), title="Weekly", grid=True, legend=True)
sber_weekly["VOLUME"].apply(float).plot(figsize=(16,4), title="Weekly", grid=True, legend=True)

output

moex's People

Contributors

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