OPEN-SOURCE SCRIPT

Price Log Regression (by Currency)

50
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.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.