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

Candlestick Chart Pattern for Technical Analysis #127

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions nsepy_candlesticks_ohlc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#Importing Libraries
from nsepy import get_history
from datetime import date, timedelta
from nsepy import get_index_pe_history

from pandas import DataFrame
import pandas as pd
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")

#TICKER NAME
ticker = "MCDOWELL-N"

#TIME PERIOD, 15 days in this case
end_day = date.today()
start_day = end_day - timedelta(15)

#Fetch ticker data from nsepy
df = get_history(symbol=ticker, start=start_day, end=end_day)

#Data preparation for OHLC Candlesticks
data=df[['Open', 'High', 'Low', 'Close', 'Volume']]
#print(data)
data.index.name = 'Date'



#mplfinance
import mplfinance as mpf
from mplfinance.original_flavor import candlestick_ohlc
data.index = pd.to_datetime(data.index)
mpf.plot(data, type='candle', volume=True)