The documented function self.Plot able to plot only candle charts.
Here example:
class CalmOrangeGaur(QCAlgorithm):
def Initialize(self):
........
spy = self.AddEquity(self.sym, Resolution.Hour) #(!)
..........
stockPlot = Chart('Trade Plot')
from System.Drawing import Color
stockPlot.AddSeries(Series('Price', SeriesType.Candle, '$', Color.Green)) #(!)
self.AddChart(stockPlot)
def OnData(self, data):
..........
self.Plot('Trade Plot', 'Price', data.Bars["SPY"].Close)
the output is the DAILY candlesticks, but if we change SeriesType to Line,
we definitely get the hourly line chart, the same for minutes.
Question 1: How to get Hour/Minutes candles?
Question 2: Is it correct when we use argument data.Bar[xxx].Close and we get back, as a result, a candle series instead line?
Question 3: How to add a subChart to the existing candle chart (Vol for example)?
Question 4: Is it possible to draw just a vertical line or other figures like a semitransparent square?
Shile Wen
Hi Alex,
Best,
Shile Wen
Alex Matt
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!