OPEN-SOURCE SCRIPT
已更新

Comparative Relative Strength - HongQuanTrader

964
This script is designed to enhance your trading strategy by comparing the current symbol with another comparative symbol. The goal is to trade a symbol only when its Relative Strength (RS) value surpasses the long moving average of the RS value, ensuring more informed and strategic trading decisions.

Default Mode

In the default mode, the RS value is calculated by simply dividing the base symbol by the comparative symbol:

Pine Script®
RS_SIMPLE = baseSymbol / comparativeSymbol


Period Mode
When you enable the “use period” option, the script uses the RS_PERIOD equation. This mode is particularly useful for comparing multiple symbols against the same comparative symbol, with the output normalized around 1.0 for easier comparison:

Pine Script®
RS_PERIOD = baseSymbol / baseSymbol[rsPeriod] / (comparativeSymbol / comparativeSymbol[rsPeriod])


By leveraging these calculations, you can gain deeper insights into the relative performance of different symbols, allowing you to make more precise and confident trading decisions. Whether you’re comparing stocks, currencies, or any other assets, this script provides a robust framework for enhancing your trading strategy.
版本注释
fix: Do not plot the horizontal line if not using RS_PERIOD method
版本注释
refactor: remove unnecessary code
版本注释
feat: add track line of RS line
版本注释
chore: add title for long and short moving average lines
版本注释
chore: add title for line 1.0 in RS Period mode
版本注释
Update to fix chart rules

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。