Rengo Trend Following Strategy with Crypto

Back

Hello!!

I've adapted a strategy made by Sergey Malchevskiy using Renko charts. The main goal of the strategy is following the trend, and the size of the bricks have been optimized.

If you want more information, you could vist Sergey post following this link:

https://medium.com/@sermal/adaptive-trend-following-trading-strategy-based-on-renko-9248bf83554

I'm learning python and Quantconnect framework, so any suggestion to improve the code would be welcome.

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.


Hi Leonardo,

Great start to using Python and QC! Here are a few things to consider:

  • The algorithm currently makes a History call everytime OnData is executed. This can be made more efficient by employing a RollingWindow with a warm up period. Our documentation and Fading The Gap Bootcamp lesson explain these very well.
  • Move the definition of `evaluate_renko` outside OnData to speed up execution. Also, remove the `self` keyword inside `evaluate_ranko` as it is unnecessary.
  • To calculate the IQR correctly, we need to find the percentile between 25% and 75%, not 50% and 80%.
  • `__get_optimal_brick_size` is never called, thus the brick size is static instead of being a function of the trailing ATR as the strategy blog post explains.
  • Adjust the algorithm's infrastructure to adhere to the Algorithm Framework. We have thorough documentation and a great Bootcamp lesson that explain how this can be done. With it, we can move all of the strategy logic outside of OnData and into an alpha model. Additionally, we can replace `LiquidateUnrealizedLosses` with a risk management module like the Maximum Drawdown Percent Per Security module.

Best,
Derek Melchin

1

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