trophy

Long Only, ETF Alpha Streams Competition with $27,500 Prize Pool

Back

Help me to plot candlesticks

Hey,

I want to plot candlesticks on hourly forex data. Can anybody tell me how to do this?

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.


Hey, gonna assume this is a repost of 

https://www.quantconnect.com/forum/discussion/5574/need-help-to-plot-candlesticks/p1

 

Please check the documentation on Charting and start there. Should be relatively self-explanatory but do let us know if you run into any issues!

0

Hey Douglas,

Thanks for replying. I did read the documentation. But it doesnt answer my questions. First, why is there skipping going on.? Candles are only plotted for every other hour, as opposed to every hour. Second, how do you attach low, high, open, close price data to the same candlestick? If I create a separate series for each of these, then four candle sticks will lay on top of each other, instead of one candlestick for all four. 

0

I'm attaching an example of as far as I understand candlestick plotting in QC. I don't know how to add OHLC to the candle - as far as I know, the chart will generate this itself based on the data you feed it. So if you feed all of the values into the same series (and make sure you feed your open first and your close last), you should get a bar that represents this accurately.

I'm sorry I can't help you fully - I haven't played enough with the charting to fully be able to help you.

To view the candles, try cloning the algo and backtesting it on your end. (I can't get the candles to show on the forum).

0


This may also help:

https://www.quantconnect.com/forum/discussion/1326/creating-ticks-from-bars-begnning-end-of-day-execution/p1/comment-16081

 

0

Thanks for your help Douglas. I cloned your example and ran it, there was no OHLC data printed on the bar. Only date and "Series1" were printed on the bar, Also, the examples were not written in Python, and the data in the example was not Forex. You know, Quotebars behave differently than Tradebars.

0

My example was meant to highlight a point - candles in Lean do not themselves contain OHLC values that you can set yourself, but rather the candles are simply visually generated based on the amount of data and time you've zoomed into. This is as far as I understand the candle concept - if you study the source code for how the candles are generated I think you will come to the same conclusion.

Please also take a look at the link I gave you - it illustrates how you can approximate a candle as best as possible, and it again highlights that the candles are visually generated based on the underlying point-by-point data rather than by 4 different series (OHLC).

1

Hey Douglas, the link that you sent was not very helpful because it wasnt Python code, which is the language that I work with... It is interesting, there are so many comments in the community that contain charts with candlesticks that show all four OHLC values. Yet, nobody seems to know anything about the issure. It is very weird. 

0

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