Back

Plot minute candle stick

Hello,

When plotting candle charts the data is aggregated into days (or weeks). is there any way to plot the bars of an equity directly, without this aggregation?

I want to see minute bars in order to test my custom indicators.

I've tried plotting daily bars, thinking that I could strech minute data into daily data, but the chart skips every other day - so even if I plot daily data not everything is shown.

Is there a simple way to disable the aggregation or to make the daily plots show every day?

I understand the chart is limited to 4000 data points, but that should be enough for me - if they are all continous data in bars, with no skips/aggregation...

Also, theres no way to plot a TradeBar instance - I can only plot one of it's prices (e.g. close) and let the aggregator create a candlestick from it. Shouldn't there be a method that plots TradeBars directly?

Thank you very much!

 

Update Backtest









Hey boris, thanks for your reply!

I've read the discussion you've linked, but that is not the issue I'm having.

I'm writing an indicator which takes a whole TradeBar as an input, and I want to test it's response.

Its based on machine learning methods so I can't easily test it numerically, so I was hoping that I could at least do it visually - what I want to do is to overlay that indicator over a candlestick plot of the price.

The problem is getting such a plot to work - using candlestick SeriesType always results in partial data being displayed; minute data is aggregated into days, eliminating the intra-day information; daily data is sometimes skipped entirely (plotting bars only for monday and wednesday, for example). This is even if I use Plot() on every call to OnData().

I was looking for a workaround but couldn't find any, at least not yet.

For now I'm working outside of Lean in order to test my indicator, but that is hardly a good solution...

Thanks!

0

We have created an issue at QuantConnect/Lean GitHub page to implement this feature: Enable candle charts using TradeBar.

Meanwhile, you can try to use scatter plots:

//In Initialize
var assets = new Chart(ticker);
assets.AddSeries(new Series("Open", SeriesType.Scatter));
assets.AddSeries(new Series("High", SeriesType.Scatter));
assets.AddSeries(new Series("Low", SeriesType.Scatter));
assets.AddSeries(new Series("Close", SeriesType.Scatter));
AddChart(assets);

//In OnData
Plot(ticker, "Open", bar.Open);
Plot(ticker, "High", bar.High);
Plot(ticker, "Low", bar.Low);
Plot(ticker, "Close", bar.Close);

to test your machine learning strategy visually.

0

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.


Thank you so much!

And have a great new year!

0

Hey!

Was this implemented yet? Is there any idea when/if it should be?

Thanks.

0

Not yet.
Unfotunately, it is not a priority.

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed