OPEN-SOURCE SCRIPT
Price Log Regression (by Currency)

1. Introduction
This indicator draws a logarithmic regression line directly on top of the price candles, showing the long‑term “average” growth path of any asset in the currency you select (for example USD). It is inspired by popular log‑regression studies used on assets like Bitcoin, where price is transformed to a log scale and a straight regression line is used to visualize macro trends and diminishing returns over time.
2. Key Features
- Currency‑aware trend line: Before calculating the regression, the script converts the asset’s price into the chosen currency, so the line represents the trend of “price in USD”, not just the original quote on the chart.
- Logarithmic regression: The script takes the logarithm (base 10) of the converted price, applies a linear regression to that log series, and then converts the result back to normal price; this produces a smooth line that follows the exponential character of many long‑term price moves.
- On‑chart overlay: Only the regression line is plotted and `overlay` is enabled, so the line appears directly over your existing candles, keeping the chart clean and making it easy to compare current price versus its long‑term log‑trend in the selected currency.
3. How to Use
- Add the script to any symbol and timeframe, then choose the Currency input (for example set it to “USD” if you want to see the trend of that asset measured in Dolars).
- Adjust the Regression length input: longer lengths give a slower, smoother macro line, while shorter lengths react more to recent price action; use what best matches the horizon you are analysing.
- Read the line as an analytical tool, not as guaranteed support or resistance: if price is far above the line, it may indicate an extended move relative to its long‑term path in that currency; if it is far below, it may indicate a cheaper zone relative to that same path, always remembering that this is educational analysis and not financial advice.
Note: This indicator focuses on long‑term logarithmic trends rather than short‑term noise, it is best suited for longer‑horizon approaches such as swing trading and position trading, rather than intraday scalping.
This indicator draws a logarithmic regression line directly on top of the price candles, showing the long‑term “average” growth path of any asset in the currency you select (for example USD). It is inspired by popular log‑regression studies used on assets like Bitcoin, where price is transformed to a log scale and a straight regression line is used to visualize macro trends and diminishing returns over time.
2. Key Features
- Currency‑aware trend line: Before calculating the regression, the script converts the asset’s price into the chosen currency, so the line represents the trend of “price in USD”, not just the original quote on the chart.
- Logarithmic regression: The script takes the logarithm (base 10) of the converted price, applies a linear regression to that log series, and then converts the result back to normal price; this produces a smooth line that follows the exponential character of many long‑term price moves.
- On‑chart overlay: Only the regression line is plotted and `overlay` is enabled, so the line appears directly over your existing candles, keeping the chart clean and making it easy to compare current price versus its long‑term log‑trend in the selected currency.
3. How to Use
- Add the script to any symbol and timeframe, then choose the Currency input (for example set it to “USD” if you want to see the trend of that asset measured in Dolars).
- Adjust the Regression length input: longer lengths give a slower, smoother macro line, while shorter lengths react more to recent price action; use what best matches the horizon you are analysing.
- Read the line as an analytical tool, not as guaranteed support or resistance: if price is far above the line, it may indicate an extended move relative to its long‑term path in that currency; if it is far below, it may indicate a cheaper zone relative to that same path, always remembering that this is educational analysis and not financial advice.
Note: This indicator focuses on long‑term logarithmic trends rather than short‑term noise, it is best suited for longer‑horizon approaches such as swing trading and position trading, rather than intraday scalping.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.