In this strategy, I'm trying to create an indicator with a dynamic length.
Length is computed based on the correlation between Price and its momentum.
You can set min and max values for the , and if the correlation is close to 1, we'll be at a min value. When it's -1, we'll be at the max level.
I got this idea from Sofien Kaabar's book.
The strategy is super simple, and there might be much room for improvement.
Performance on the deep backtesting is not excellent, so I think the strategy needs some filters for regimes, etc.
Thanks to @MUQWISHI for helping me code it.
Please remember that past performance may not indicate future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Pine Programming v5: https://qntly.com/pineprog
Adv.Pine Use-Cases: https://qntly.com/advpine
Access to Pro Indic.: https://qntly.com/proind
Hire Me: https://qntly.com/hirepine
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.