Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting the Intraday data and the historical data together for Talib Library #39

Open
parthshah19 opened this issue Mar 2, 2022 · 3 comments

Comments

@parthshah19
Copy link

parthshah19 commented Mar 2, 2022

fetching the data for this

from datetime import datetime
nifty_bank_nse_index = sas.get_instrument_by_symbol('NSE', 'Nifty Bank')
print(sas.get_intraday_candles(nifty_bank_nse_index.exchange, nifty_bank_nse_index.symbol, datetime(2020, 10, 19), datetime.now(), interval=10))

is giving error of number of arguments here ! i guesss there is an issue !
getting the historical as well as intraday in this code :
get_intraday_candles() takes from 3 to 4 positional arguments but 6 were given
get_intraday_candles() got multiple values for argument 'interval'

@algo2t algo2t closed this as completed Apr 1, 2022
@algo2t algo2t reopened this Apr 1, 2022
@algo2t
Copy link
Owner

algo2t commented Apr 1, 2022

Documentation needs an update, please use below code to get the historical candles.

nifty_bank_nse_index = sas.get_instrument_by_symbol('NSE', 'Nifty Bank')
# print(nifty_bank_nse_index)
print(sas.history(nifty_bank_nse_index, datetime(2022, 2, 2, 9, 15, 0), datetime.now(), interval=30, is_index=True))

output

                        open      high       low     close  volume
datetime
2022-02-02 09:15:00  38841.55  39105.00  38760.85  39016.75       0
2022-02-02 09:45:00  39019.35  39164.10  38983.40  39136.00       0
2022-02-02 10:15:00  39134.25  39176.60  38991.45  39044.30       0
2022-02-02 10:45:00  39044.05  39166.95  39040.00  39123.25       0
2022-02-02 11:15:00  39123.80  39163.65  39093.35  39161.70       0
...                       ...       ...       ...       ...     ...
2022-04-01 13:15:00  36939.40  37028.40  36937.50  37013.25       0
2022-04-01 13:45:00  37012.90  37090.15  36990.95  37074.00       0
2022-04-01 14:15:00  37075.80  37145.10  37067.60  37098.75       0
2022-04-01 14:45:00  37100.15  37139.15  37042.65  37124.80       0
2022-04-01 15:15:00  37126.70  37201.75  37110.55  37158.90       0

[533 rows x 5 columns]

Will keep this issue open till documentation is fixed

@parthshah19
Copy link
Author

Does this include the Historical data with the Intraday data in it ?

@himanshuevents
Copy link

Try it yourself. Be clear on one thing. Historical Data and Intraday data is one and same thing. WebSocket data is different.
In here, if market is live and you fetch data using history command say at 10 am then it is called as intraday data if the candles are from 9:15 to 10 am. Everything else like yesterday and last 1 month or 1 year is historical data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants