candlestick-chart

Auto-Scale Y-Axis in JfreeChart

廉价感情. 提交于 2020-01-03 08:43:22
问题 I am using JFreeChart to create candlestick charts in my Java app. However, my charts end up looking like this: http://imageshack.us/photo/my-images/69/capturebhx.png/ I would like to have the Y-axis automatically scaled so that the chart looks more like this: http://imageshack.us/photo/my-images/717/capture2wl.png/ I think org.jfree.chart.axis.NumberAxis.configure() will do this, but I'm not sure. I can't seem to find a way to tie my JFreeChart object, or ChartPanel object to this NumberAxis

Auto-Scale Y-Axis in JfreeChart

大城市里の小女人 提交于 2020-01-03 08:41:18
问题 I am using JFreeChart to create candlestick charts in my Java app. However, my charts end up looking like this: http://imageshack.us/photo/my-images/69/capturebhx.png/ I would like to have the Y-axis automatically scaled so that the chart looks more like this: http://imageshack.us/photo/my-images/717/capture2wl.png/ I think org.jfree.chart.axis.NumberAxis.configure() will do this, but I'm not sure. I can't seem to find a way to tie my JFreeChart object, or ChartPanel object to this NumberAxis

python Matplotlib candlestick plot works only on daily data, not for intraday

五迷三道 提交于 2020-01-03 02:14:06
问题 I'm trying to plot candlestick data using matplotlib. Starting from 1 minute data I group them using pd.Timegrouper in various time frame , from 5minute to daily, but plot only works on daily data. Below you can find a sample of the 1 minute data i'm using: data_indexed_5M = data_indexed.groupby([pd.TimeGrouper(freq=pd.offsets.Minute('5'))]).agg({'<LOW>': lambda s: s.min(), '<HIGH>': lambda s: s.max(), '<OPEN>': lambda s: s[0], '<CLOSE>': lambda s: s[-1]}) ata_indexed_Daily = data_indexed

How to display the prices and the volumes on a candlesticks chart with Highstock Charts?

被刻印的时光 ゝ 提交于 2019-12-25 06:58:55
问题 The example on the demo page shows the prices and the volumes on 2 charts (http://www.highcharts.com/stock/demo/candlestick-and-volume). Is it possible to render them in one chart only? Thanks. Update: Ok, got it here: http://jsfiddle.net/eAFJ3/3/: $('#container').highcharts('StockChart', { rangeSelector: { enabled: false }, scrollbar: { enabled: false }, navigator: { enabled: false }, title: { text: 'AAPL Historical' }, yAxis: [{ title: { text: 'OHLC' }, lineWidth: 2 }, { title: { text:

matplotlib candlestick chart error xy = (t-OFFSET, lower), TypeError: unsupported operand type(s) for -: 'datetime.date' and 'float'

删除回忆录丶 提交于 2019-12-25 02:44:16
问题 I am trying to plot a candlestick chart using matplotplib. I have queried my database, returned the relevant data and appended in to an anrray named candleAr, in the required format (date,open,close,high,low) My code is as follows: import matplotlib.pyplot as plt import numpy as np import matplotlib.ticker as mticker import matplotlib.dates as mdates from matplotlib.finance import candlestick candleAr=[] cursor = conx.cursor() query= 'SELECT ticker,date,time,open,low,high,close FROM eurusd

xytext details in Matplotlibs Annotate

随声附和 提交于 2019-12-24 10:58:13
问题 With the following code I am plotting a candlestick graph and also make use of annotations. I have played arround until I found the right positions for the text, but I still don't understand what the figures xytext=(-15, -27) and xytext=(-17, 20) have to do with their current position. It is very strange to me. could somebody please explain it to me? Many thanks in advance! This is what my graph looks like and below is the code: import matplotlib.pyplot as plt import matplotlib.dates as

how to plot candlesticks in python

北城以北 提交于 2019-12-24 00:39:33
问题 I´m trying to create a simple plot with candlesticks. For that I get the data from Yahoo and plot it using the function candlestick2_ohlc. The goal is to export the image in a jpg file using. This is the code what I´m using: from pandas_datareader import data import matplotlib.pyplot as plt from mpl_finance import candlestick2_ohlc import matplotlib.dates as mdates import fix_yahoo_finance as yf import datetime start = datetime.date(2018, 1, 1) end = datetime.date.today() aapl = yf.download(

Plotting candlestick with matplotlib for time series w/o weekend gaps

烈酒焚心 提交于 2019-12-23 03:24:32
问题 trying to plot a candlestick serie after importing datas from yahoo-finance. I'm using python 2.7 I have already a serie plotted and I want to add the same one as candlestick but I don't see how I can do that : import matplotlib.pyplot as plt from matplotlib.finance import candlestick2_ohlc #Reset the index to remove Date column from index df_ohlc = data.reset_index() #Naming columns df_ohlc.columns = ["Date","Open","High",'Low',"Close", "Adj Close", "Volume"] #Normal plot ax1 = plt.subplot()

gnuplot candlestick red and green fill

…衆ロ難τιáo~ 提交于 2019-12-22 05:52:16
问题 Candlestick plots on the financial sites, at least the ones I have seen, fill the candlestick green if the close is higher then the open, and red if the close is lower then the open. If I set the fill style all candlesticks are filled with the fill color, is there a way in gnuplot 4.6 to use the color scheme as I described above? A sample script is: set xdata time set timefmt"%Y-%m-%d %H:%M:%S" set xrange ["2014-01-01":"2014-01-02"] set yrange [*:*] set datafile separator "," plot '201401

Annotation Google Chart API

跟風遠走 提交于 2019-12-17 17:15:25
问题 i'm trying to use Google Chart API for building an Waterfall chart. I noticed that Candlestick/Waterfall charts are not supporting the annotations. See this jsfiddle sample google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Category'); data.addColumn('number', 'MinimumLevel'); data.addColumn('number', 'MinimumLevel1'); data.addColumn('number',