algo2t / alphatrade

Python APIs for SAS Online Alpha Trade Web platform for creating algo trading using python
https://algo2t.github.io/alphatrade
MIT License
45 stars 25 forks source link

Historical candles and intraday candles do not work #31

Open SMVSKN opened 2 years ago

SMVSKN commented 2 years ago

This issue has been reported earlier (https://github.com/algo2t/alphatrade/issues/4), where I have put the same comments as below. However, the issue was in the closed state, so I was not sure if it would be flagged to the owners. Sorry for the duplicate one here.


I came across the resolution to this issue which states that SAS Alpha Web platform does not support historical/intraday data. However, this does not seem to be true.

I think I have figured out what should be used for different indices and FNOs for the 'exchange' and 'symbol' names.

Eg: For indices, we need to have the following in the 'PARAMS' in the functions that get the historical and intra-day data:

exchange: NSE_INDICES symbol: 'Bank Nifty' / 'Nifty 50' / 'Nifty IT' / 'Nifty Auto' etc => Note that there are spaces and it is case sensitive

For FUT, we need to have the following in the 'PARAMS': exchanbe: FNO symbol: 'BANKNIFTY21DECFUT' / 'BANKNIFTY21DEC37800CE' / 'BANKNIFTY21D0937300PE' etc => Note that there are no spaces in between

Can this package be updated to handle the above?

swatishravge commented 12 months ago

you can download nifty index data by using following code

import yfinance as yf import pandas as pd

dfdata = yf.download(tickers='^NSEI', period='2d', interval='1m') dfdata.to_csv('D:\data.csv')

navin1919 commented 6 months ago

were you guys able to get intraday (I am not looking for historical data) OHLC data?