# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
from tvDatafeed import TvDatafeed, Interval
import datetime
import logging

logging.basicConfig(level=logging.DEBUG)

tv = TvDatafeed(auto_login=False)


# + pycharm={"name": "#%%\n"}
data = tv.get_hist('NIFY', 'NSE', Interval.in_15_minute)

# + pycharm={"name": "#%%\n"}
print(data)

# + pycharm={"name": "#%%\n"}
from tvDatafeed import TvDatafeed, Interval, symbols

username = 'natwijaya19'
password = '<PASSWORD>'

tv = TvDatafeed(username, password, chromedriver_path=None)

# index
nifty_index_data = tv.get_hist(symbol='NIFTY',exchange='NSE',interval=Interval.in_1_hour,n_bars=1000)

# futures continuous contract
nifty_futures_data = tv.get_hist(symbol='NIFTY',exchange='NSE',interval=Interval.in_1_hour,n_bars=1000,fut_contract=1)

# crudeoil
crudeoil_data = tv.get_hist(symbol='CRUDEOIL',exchange='MCX',interval=Interval.in_1_hour,n_bars=5000,fut_contract=1)

# + pycharm={"name": "#%%\n"}


StarcoderdataJupyterScriptsDedupFiltered