/amiCOM

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

AmiCOM

AmiCOM (development in progress ) is a python utility to automatically import

Data from Binance, Kucoin and Yahoo finance ( for NSE stocks ) into Amibroker.

Update: Now it supports getting realtime option data from NSE.

In order to get crypto currency pair data from binance api (just paste binance api key and secret in .env)

How does it work

AmiCOM downloads the required data from Binance, Kucoin and Yahoo finance ( for NSE stocks for the specified script, time frame and available resolution (more on this later) and pushes it onto a temp file, through Microsofts OLE (Object Linking and Embedding) automation it then imports them into the specified database.

Knowing the location of database is important and thus AmiCOM makes use of 7 pre programmed databases (and stored in DB.zip). The 7 pre-programmed dbs include NIFTY50,NIFTY100,NIFTY200,NEAREXP( NSE indices only),BINANCE,KUCOIN,CUSTOM1.

It is important to note that yahoo finance allows at most 2000 api calls per hour per ip. Thus you need to ensure that you dont cross that limit by managing the number of scripts being refreshed and the refresh rate. eg in the Nifty50 db there are about 60 stocks so 2000 queries per hr/60 scripts = 33.33 database refreshes every hour or about 1 complete query every 2 mins. So if you are using Nifty50 db you are suggested to refresh not more frequently than once every 2 mins, however you can easily choose higher refresh rate ( like once every 15 mins) without any trouble.

Data availability

Yahoo finance provides selective availability to intraday data

  • for one minute candle only past 7 days of data is available
  • for 5 min to 1hr candles only past 60 days of data is available
  • 1D data is available for mulitple years

AmiCOM automatically chooses the best candle format for the given back fill time frame.

If you choose to back fill 6 days of tick then they will be filled in 1min candles

If you choose to back fill up-to past 60 days then 5 min candles will be chosen

Anything beyond that only EOD data is fetched.

NSE options are downloaded realtime thus no backfill option is available.

There is no restriction as such on data gathered from binance kucoin. By default only 30 minute candles are downloaded can be changed via main.py.

How to use this?

  • Clone this repository into the root of your C drive (VERY IMPORTANT).

  • Unzip DB.zip and TickerList.zip within this folder

  • install required modules (look at main.py)

  • Copy amicom.format into the format folder inside Amibroker

  • run python main.py

  • Enjoy!

If you need to add a new symbol use amibroker to make a new one and then in AmiCOM click on Back fill current

All symbols need to be in the Yahoo Finance format for instance RELIANCE.NS (.NS for NSE .BO for BSE) and ^NSEI for NIFTY50 ^NSEBANK for BANKNIFTY

snap.png

Please note that this project is in active development and must not be used in any serious work, use this at your own discretion.
I am posting here to seek help from the developer community here to make it more user friendly to common users.

I have a lot of To-Dos planed like integrating broker APIs to pull data and to use invseting.com instead of yahoo finance. Realtime tick update is still a work in progress and isn't implemented yet.

Collaborators are welcomed to send PRs and post issues on Github. This is one of my first opensource projects so please bear with my coding style

AmiCOM is provided with GPL license thus if you use parts of this project in your project you are required to release its source code.