Friends, any quick solution to this will be of much helpful.
I have three sets of data as OHLC (Open High Low Close ) data .Here the X axis is shared across all the three differrent datasets.
Y axis split to plot the candle stick in the given area of these three data sets seperately but in one layout.
Tried this code
import pandas as pd
import numpy as np
from datetime import date
#import plotly
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
init_notebook_mode(connected=True)
#import plotly.plotly as py
SCRIPTCODE ="TEST"
df['open'] = [33.0, 33.3, 33.5, 33.0, 34.1]
df['high'] = [33.1, 33.3, 33.6, 33.2, 34.8]
df['low'] = [32.7, 32.7, 32.8, 32.6, 32.8]
df['close'] = [33.0, 32.9, 33.3, 33.1, 33.1]
df['dates'] = [datetime(year=2013, month=10, day=10),
datetime(year=2013, month=11, day=10),
datetime(year=2013, month=12, day=10),
datetime(year=2014, month=1, day=10),
datetime(year=2014, month=2, day=10)]
tracecan = go.Candlestick(x=df.index,
open=df['Open'],
high=df['High'],
low=df['Low'],
close=df['Close'])
candle_opt_ce_data = go.Candlestick(x=stock_opt_ce.index,
open=stock_opt_ce['Open'],
high=stock_opt_ce['High'],
low=stock_opt_ce['Low'],
close=stock_opt_ce['Close'])
candle_opt_pe_data = go.Candlestick(x=stock_opt_pe.index,
open=stock_opt_pe['Open'],
high=stock_opt_pe['High'],
low=stock_opt_pe['Low'],
close=stock_opt_pe['Close'])
layout = go.Layout(
title = "CandleStick:{} CE_StrikePrice:{} PE_StikePrice:{} EXPIRY :{}-{}-{}".format(SCRIPTCODE,strike_pricece,strike_pricepe,EXPDATE,EXPMONTHH,EXPYEAR),
xaxis = dict(
range = ['STARTYEAR-STARTMONTH-STARTDATE','ENDYEAR-ENDMONTH-ENDDATE']
),
yaxis=dict(
domain=[0, 0.33]
),
legend=dict(
traceorder='reversed'
),
yaxis2=dict(
domain=[0.33, 0.66]
),
yaxis3=dict(
domain=[0.66, 1]
)
)
data = [tracecan,candle_opt_ce_data,candle_opt_pe_data]
#py.iplot(data, filename='candlestick_datetime')
fig = go.Figure(data=data,layout=layout)
iplot(fig, filename = './CandleStickData-{}.html'.format(SCRIPTCODE))
plot(fig,show_link = True, filename = './CandleStickData-{}.html'.format(SCRIPTCODE))
Here what happens is all the data merged into one and plotted but i want the data to be plotted in each area allocated as per the layout defined above. How to achieve this? Also i dont want the bottom slider how to remove that one ?
1st image working one with line plot
2nd one is issue image,I want the candlestick in each devided layout as above and (no slider required here as shown in the issue image)
Refer the CandleStickData-ITC.png (Issue one)
Refer the “CorrelationOfEquityAndOptionData-ITC.png” for the kind of chart but in Candlestick i am looking for(Made using Scatter Line chart).
One more solution(As shown in the working snapshot data point of all to be displayed when i hover the mouse)
Any solution to this please .