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.


Hi all,

it is still not possible, to create CandleSticks on an sub daily basis in the charts (for example each candle one hour)? 

I want to create charts with price candle charts and additional my indicators and buy/sell attached. Only thing i can’t get to work are the hourly candle sticks in a chart, for me they always end up on a daily basis. The goal would be to be able to visualise my strategy to be able to see the flaws. Tradingview does this really great, but i would like to have it in QC to have one solution for it and not slightly different data and functions.

Would be great i anyone could point me in the right direction if this works.
On the other hand, what do you guys to to improve your strategies? Are you exporting the logs and work in excel???

Plz help \o/

0

Quick additional Question, because i ran into more problems regarding restrictions to "Only 10 Series allowed" and "max number of 4000 data points exceeded". If i do run my backtest locally with lean, will i run into the same restrictions?

0

Yes backtesting locally will avoid these restrictions; but I think you're misunderstanding how to use LEAN if you're trying to plot candle sticks. This isn't a charting platform, also we cannot allow exporting data due to licensing restrictions by the data providers so you cannot export the data to excel plotting. 

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.


Hi Jared,

Just joining this conversation if I may.

I agree this is not a charting platform, but backtesting on higher than daily frequency becomes a complete black box then. It is still super helpful, especially for amateur algo traders like myself, to be able to visualize what the strategy is doing based on the indicators, entries, exits, etc. Platforms like TradingView attract many people from this backgrownd for that reason. I assume your target audience is not the same as TradingView, but I think some of those capabilties would still be useful for any trader at any level.

I know you know this already so not adding anything new but still wanted to add the feedback.

I also understand capacity is a big constraint at the moment so please don't take this as a complaint!

Thanks for the amazing work,

Emilio

0

Thanks for your Feedback.

Yes, I'm not a Pro in this field. Just trying to get as much Information out of the backtests to improve my algosand to SEE where they work and where not.
So how do the 'Pros' improve their algos with lean in the right way? 

1

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