All Projects → StreamAlpha → tvdatafeed

StreamAlpha / tvdatafeed

Licence: MIT license
A simple TradingView historical Data Downloader

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tvdatafeed

AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+20.11%)
Mutual labels:  crypto, trading, algo-trading, stocks
Stocksharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins, and options).
Stars: ✭ 4,601 (+2334.39%)
Mutual labels:  crypto, trading, stocks
hummingbot
Hummingbot is open source software that helps you build trading bots that run on any exchange or blockchain
Stars: ✭ 3,602 (+1805.82%)
Mutual labels:  crypto, trading, algo-trading
cira
Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.
Stars: ✭ 21 (-88.89%)
Mutual labels:  trading, algo-trading, stocks
Bybit-Auto-Trading-Bot-Ordes-placed-via-TradingView-Webhook
Python based Trading Bot that uses TradingView.com webhook JSON alerts to place orders(buy/sell/close/manage positions/TP/SL/TS etc.) on Bybit.com. Hire me directly here https://www.freelancer.com/u/Beannsofts for any assistance
Stars: ✭ 235 (+24.34%)
Mutual labels:  trading, tradingview
tradingview-webhooks
Backend service converting tradingview alerts into action.
Stars: ✭ 44 (-76.72%)
Mutual labels:  trading, tradingview
ninjabot
A fast trading bot platform for cryptocurrency in Go (Binance)
Stars: ✭ 1,021 (+440.21%)
Mutual labels:  crypto, trading
mokka
Free and extendable trading bot application for crypto currencies.
Stars: ✭ 20 (-89.42%)
Mutual labels:  crypto, trading
algotrading-example
algorithmic trading backtest and optimization examples using order book imbalances. (bitcoin, cryptocurrency, bitmex, binance futures, market making)
Stars: ✭ 169 (-10.58%)
Mutual labels:  trading, algo-trading
finam-export
Python client library to download historical data from finam.ru
Stars: ✭ 84 (-55.56%)
Mutual labels:  trading, stocks
TAcharts
Apply popular TA tools and charts to candlestick data with NumPy.
Stars: ✭ 131 (-30.69%)
Mutual labels:  crypto, trading
TradingView-Machine-Learning-GUI
Let Python optimize the best stop loss and take profits for your TradingView strategy.
Stars: ✭ 396 (+109.52%)
Mutual labels:  trading, tradingview
TerminalStocks
Pure terminal stock ticker for Windows.
Stars: ✭ 88 (-53.44%)
Mutual labels:  trading, stocks
Benzaiboten-spot-trading-bot
A trading bot easy to use to be linked to your favorite exchange to automatize the trading on cryptocurrencies
Stars: ✭ 20 (-89.42%)
Mutual labels:  crypto, trading
tstock
📈A command line tool to view stock charts in the terminal.
Stars: ✭ 498 (+163.49%)
Mutual labels:  trading, stocks
b2s-trader
Application to automate trading process
Stars: ✭ 22 (-88.36%)
Mutual labels:  crypto, trading
degiro-trading-tracker
Simplified tracking of your investments
Stars: ✭ 16 (-91.53%)
Mutual labels:  trading, stocks
howtrader
Howtrader is a crypto currency quant framework, you can easily develop, backtest and run your own strategy in real market. It also supports tradingview or other 3rd party signals, just simply send a post request and it will help trade automatically. Now it only support binance spot, futures and inverse futures exchange. It will support okex, ftx…
Stars: ✭ 294 (+55.56%)
Mutual labels:  trading, tradingview
HTML-Crypto-Currency-Chart-Snippets
💹 Simple HTML Snippets to create Tickers / Charts of Cryptocurrencies with the TradingView API 💹
Stars: ✭ 89 (-52.91%)
Mutual labels:  crypto, trading
Finance-Robinhood
Trade stocks and ETFs with free brokerage Robinhood and Perl
Stars: ✭ 42 (-77.78%)
Mutual labels:  stocks, historical-data

TvDatafeed

A simple TradingView historical Data Downloader. Tvdatafeed allows downloading upto 5000 bars on any of the supported timeframe.

If you found the content useful and want to support my work, you can buy me a coffee! "Buy Me A Coffee"

Installation

This module is installed via pip:

pip install tvdatafeed

or installing from github repo

pip install --upgrade --no-cache-dir git+https://github.com/StreamAlpha/tvdatafeed.git

For usage instructions, watch these videos-

v1.2 tutorial with installation and backtrader usage

Watch the video

Full tutorial

Watch the video


Usage

Import the packages and initialize with your tradingview username and password. If running for first time it will prompt chromedriver download, type 'y' and press enter.

from tvDatafeed import TvDatafeed, Interval

username = 'YourTradingViewUsername'
password = 'YourTradingViewPassword'



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

If auto login fails, you can try logging in manually by specifying auto_login=False

tv = TvDatafeed(auto_login=False)

It will open TradingView website, you need to login manually. Once logged in return back to terminal and press 'enter', browser will automatically close. Whichever login method is used, login is required only once. For detailed login precedure watch the videos shown above.

You may use without logging in, but in some cases tradingview may limit the symbols and some symbols might not be available. To use it without logging in

tv = TvDatafeed()

when using without login, following warning will be shown you are using nologin method, data you access may be limited


Getting Data

To download the data use tv.get_hist method.

It accepts following arguments and returns pandas dataframe

(symbol: str, exchange: str = 'NSE', interval: Interval = Interval.in_daily, n_bars: int = 10, fut_contract: int | None = None, extended_session: bool = False) -> DataFrame)

for example-

# 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)

# downloading data for extended market hours
extended_price_data = tv.get_hist(symbol="EICHERMOT",exchange="NSE",interval=Interval.in_1_hour,n_bars=500, extended_session=False)

Calculating Indicators

Indicators data is not downloaded from tradingview. For that you can use TA-Lib. Check out this video for installation and usage instructions-

Watch the video


Supported Time Intervals

Following timeframes intervals are supported-

Interval.in_1_minute

Interval.in_3_minute

Interval.in_5_minute

Interval.in_15_minute

Interval.in_30_minute

Interval.in_45_minute

Interval.in_1_hour

Interval.in_2_hour

Interval.in_3_hour

Interval.in_4_hour

Interval.in_daily

Interval.in_weekly

Interval.in_monthly


Cloud Usage

You might face some problem while using TvDatafeed in cloud because of selenium. For that make sure to create the app dir before initializing TvDatafeed

import os
from tvDatafeed import TvDatafeed,Interval
app_dir = os.mkdir(os.path.join(os.path.expanduser("~"), ".tv_datafeed/"))
if not os.path.exists(app_dir):
    os.mkdir(app_dir)

tv = TvDatafeed()

# your code goes here

This will only work without username and password. You will be able to download most of the data without logging in


Troubleshooting

If you face any difficulty, you can reset this tvdatafeed using clear_cache method. You will need to login again after reset.

tv.clear_cache()

if still issue persists checj out #26 (comment), works on all platforms.


Read this before creating an issue

Before creating an issue in this library, please follow the following steps.

  1. Search the problem you are facing is already asked by someone else. There might be some issues already there, either solved/unsolved related to your problem. Go to issues page, use is:issue as filter and search your problem. image
  2. If you feel your problem is not asked by anyone or no issues are related to your problem, then create a new issue.
  3. Describe your problem in detail while creating the issue. If you don't have time to detail/describe the problem you are facing, assume that I also won't be having time to respond to your problem.
  4. Post a sample code of the problem you are facing. If I copy paste the code directly from issue, I should be able to reproduce the problem you are facing.
  5. Before posting the sample code, test your sample code yourself once. Only sample code should be tested, no other addition should be there while you are testing.
  6. Have some print() function calls to display the values of some variables related to your problem.
  7. Post the results of print() functions also in the issue.
  8. Use the insert code feature of github to inset code and print outputs, so that the code is displyed neat. !
  9. If you have multiple lines of code, use tripple grave accent ( ``` ) to insert multiple lines of code. Example: image
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].