Hello,
I'm trying to deploy an algorithm but I noticed the order prices vary a lot from the open and closing price of the renko consolidator. Does anyone know why?
QUANTCONNECT COMMUNITY
Hello,
I'm trying to deploy an algorithm but I noticed the order prices vary a lot from the open and closing price of the renko consolidator. Does anyone know why?
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.
Mia Alissi
Based on the provided code, it seems like the algorithm is using a
ClassicRenkoConsolidator
to create Renko bars. TheClassicRenkoConsolidator
produces a new bar that spans a specified amount (in this case,self.td
) every time an asset closes that amount away from the close of the previous bar. If the price jumps multiple dollars in a single tick, theClassicRenkoConsolidator
only produces one bar per time step where the open of each bar matches the close of the previous bar.The order prices may vary from the open and closing price of the Renko consolidator due to the nature of Renko bars. Renko bars are price movement based, not time-based. This means that a new bar is only created when the price moves a certain amount, not after a certain amount of time. Therefore, the open and close prices of the Renko bars may not align with the actual open and close prices of the asset for a given time period.
Also, it's important to note that the
ClassicRenkoConsolidator
ignores the volume of the input data and enforces the open and close of each bar to be a multiple of the bar size. This could also contribute to the difference in prices.If you want the Renko bars to be more reflective of the actual price movements, you might want to consider using a different type of consolidator or adjusting the bar size. For example, the
RenkoConsolidator
produces Renko bars by their traditional definition, which might give you results that are more in line with what you're expecting.Here is the code snippet for creating a
ClassicRenkoConsolidator
:And here is how you can add an event handler to the consolidator:
For more information, you can refer to the Classic Renko Consolidators and Renko Consolidators sections in the QuantConnect documentation.
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.
Renata
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!