Awesome
NimFinLib
Financial Library for Nim
(Work in Progress)
Description:
Now using historic data via free apikey from Alpha Vantage.
Basic data fetching and data display is working.
The indicator API does return data for some markets like USA , UK
but not yet for others like Germany , Hongkong etc.
The plan is to add portfolio management and analysis.
Basic charts can currently be displayed via gnuplot.
Update Apr. 2018 :
Data drawn from the API still seems to have occasional holes
especially for non US market stocks or is not available all
the time . Often two or more hits are needed for the API
to return data . Sometimes the API returns error messages
of being hit too fast , despite one hit per second being
the advertised capability and sufficient time spacing on the
client side.
Indicator data returns json data fine , but currently only for certain US stocks.
Batch fetching of stock data only works for US market components and may return
a default timestamp of 1969 during off trading hours.
Update Oct. 2018
Data quality and speed has slightly improved , unfortunately the free apikey now has a
standard call-frequency limit of 4-5 requests per minute , which is much too low
for any reasonable work.
Of course there is the premium option which allows more requests / minute.
Kitco metal prices are not effected by this call limit .
The library has been updated to work with nim 0.19.x
If sudden crashes occure see : cat /dev/shm/avdata.csv
most likely reason is inserted nagging lines by the api to ask for registration
and once registered ask to visit their premium site.
Update Feb. 2019
Made the library compile with latest nim devel
Call frequency limit stated above has unfortunately not improved so far.
The current nagging line is:
"Thank you for using Alpha Vantage! Our standard API call frequency is 5
calls per minute and 500 calls per day."
Another option may be IEX https://iextrading.com/developer
a very limited free plan appears to be available
Update Jan. 2021
Library works with Nim 1.5.1
Library | Status | Version | License | OS | Compiler |
---|---|---|---|---|---|
nimFinLib | Development | 0.3.0.x | MIT opensource | Linux | Nim >= 1.4.2 |
Data gathering and calculations support
Alpha Vantage Api support
Dataframe for display and easy working with dataseries
Multiple accounts and portfolios management
Returns calculations and more
Williams R% calculation
Indicator displays
Kitco Metal Prices
US market spot prices
Digital currencies 5 min intraday prices .
API Docs
Planned to be in
http://qqtop.github.io/nimFinLib.html
# http://qqtop.github.io/libFinHk.html
Tests and Examples
nimexrates
nfT53
nfT55
nfT60
nimmetal
Requirements
nimcx nimble install nimcx
nimdataframe nimble install https://github.com/qqtop/nimdataframe.git
Installation
nimble install nimFinLib
Note : it is always a good idea to install the latest libraries
Example screen from quickStock.nim
Example screen from nfT58.nim
Example screen from quickSpot.nim showing some quotes for Vanguard components.
Example screen from an attempt to plot williams R indicator output
plotting is done via gnuplot.nim ex https://github.com/dvolk/gnuplot.nim
Example screen from nfT53.nim
Example screen from nfT55.nim displaying SMA,WMA,EMA Indicator data
Below screenshots of nimFinLib usage prior to demise of Yahoo Finance API on Nov 1 2017.
Example screen from nfT50.nim
Example screen from minifin.nim
NOTE :
Improvements may be made at any time.
Forking ,testing, suggestions ,ideas are welcome.
This is development code , use at your own risk.
Tested on openSuse TumbleWeed, Debian Testing
qqTop - 2021