OPEN-SOURCE SCRIPT
Relative Performance Comparison

The Script was made to compare the performance of the YM and the NQ for a period of time that you can adjust with the lookback period. There is also the possibility to adjust the smoothing of the lines in the graph and you can enable or disable the several visuals. If you wish to compare something different then you could also enter the ticker of the assets that you want to compare.
For YM and NQ the idea is that they have a high correlation and that if one of them is weaker than the other one, the stronger one could have more potential in that direction. Or if for example the weaker one is shifting in sctructure then the stronger one could also shift in structure but has the possibility of more gain as it held stronger through the weakness of the other one.
For YM and NQ the idea is that they have a high correlation and that if one of them is weaker than the other one, the stronger one could have more potential in that direction. Or if for example the weaker one is shifting in sctructure then the stronger one could also shift in structure but has the possibility of more gain as it held stronger through the weakness of the other one.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.