Bitcoin Halving Rainbow + S2F Model PriceOverview
The rainbow price line:
This script creates a colorful view of Bitcoin's price action, where different colors indicate the time until the next halving date. The color scale in the top right highlights what each main color group represents in terms of days until the next halving. Using historical data, the simple indication of days until the next halving has somewhat accurately predicted potential bottoms and tops of market cycles. Comparing current colors to previous cycles provides a rough view of where BTC is in its current cycle and what to expect going forward until the next halving date.
In addition to the colored price action, I have incorporated the stock-to-flow model price for Bitcoin.
The stock-to-flow (S2F) model price:
The stock-to-flow ratio is a calculation that aims to estimate how many years are required to produce the current stock of an asset, based on the current production rate. When applied to Bitcoin, we simply divide the total amount of bitcoins in circulation by the amount of bitcoins mined in a certain timeframe. Once we have this value, we can calculate a model price based on the stock-to-flow ratio. This S2F model price uses a 463-day moving average. Preston Pysh came up with this number as he believed Bitcoin cycles happen in three phases: bull run, correction, and a reversion to the mean. He estimated there are about 200,000 blocks per cycle, three phases per cycle, and ~144 blocks per day. Dividing all three gets us 463. I have removed 1,000,000 coins from this calculation to account for Satoshi's coins.
The process I took to plot this model price (credit to PlanB for originally creating this calculation):
-Declare constant variables for the halving period, starting block reward, and the number of coins Satoshi owns.
-Fetch the block index by using the request.security() function.
-Determine the number of halvings that have occurred by dividing the block index by the halving period.
-Calculate the current block reward by multiplying the initial block reward by 0.5 raised to the power of the number of halvings.
-Calculate the number of blocks mined per period (day or week) and derive the stock (total bitcoins in circulation minus Satoshi's coins) and flow (annual block rewards) from it.
-Calculate the S2F ratio by dividing the stock by the flow.
-Calculate the S2F model price by applying a mathematical formula (ModelPrice = exp(-1.84) * S2F to the power of 3.36) along with a 463-day moving average.
** Please note, due to the use of the 463-day MA, the first ~400 days of the S2F model price is not entirely accurate.
In addition to the above, I have added vertical lines on each halving date, along with labels that have a tooltip if you hover over them, which will show more information about that particular halving.
Important tips:
-This script has been designed to work on the 1-Day timeframe but can also work on the 1-Week timeframe. Any other timeframe will not accurately plot all the information due to the way I have developed the script.
-This script is best used on the ticker I have posted this on, "INDEX:BTCUSD". It can also work on "BLX" or "BITSTAMP:BTCUSD".
-Hide candles when using the script to just show the halving rainbow (hover over the symbol name in the top left and press the eye icon).
-Right-click the price scale and select "Scale price chart only" to get a better view of the plots.
-Right-click the price scale and select "Logarithmic."
-I will update the script as time goes on to show future halvings along with adjusting the next halving date as we get closer (if it changes).
Settings Menu:
Tooltips are included explaining what the settings do, but here's a quick summary:
-'Show Vertical Halving Lines?': Default is true. This allows the user to remove the vertical lines shown on each halving date.
-'Show Halving Labels?': Default is true. This allows the user to remove the info labels shown on each halving date.
-'Halving Line and Label Color': Default is white. This allows the user to change the color of the halving lines and labels to better fit their chart layout.
-'Show Stock to Flow Model Price?': Default is true. This allows the user to remove the S2F model price.
-'Stock to Flow Model Price Color': Default is white. This allows the user to change the color of the S2F model price to better fit their chart layout.
-'Draw Color Table?': Default is true. This allows the user to remove the color table in the top right of the chart.
-'Distance rainbow is away from actual price action': Default is 0 (Plots over candles). This allows the user to adjust where the halving rainbow is plotted if they would like to also see candles on the chart. (Use any value under 0.9)
Feel free to message me or comment on the post with any questions or issues!
Much more to come!
Thanks for reading, enjoy!
BLX
B1rd's Puell MultipleThis metric looks at the supply side of Bitcoin's economy - bitcoin miners and their revenue.
It explores market cycles from a mining revenue perspective. Bitcoin miners are sometimes referred to as compulsory sellers due to their need to cover fixed costs of mining hardware in a market where price is extremely volatile. The revenue they generate can therefore influence price over time.
The Puell Multiple is calculated by dividing the daily issuance value of bitcoins (in USD) by the 365-day moving average of daily issuance value.
So far, buying below 0.5 and taking profit above 4.0 has been proven profitable over the years.
This version allows you to expiriment with different moving average types.
I might update this version in the future with more expirimental tools of measurements, I just need some idea's to work with. So feel free to comment on what you'd like to see added to this version.
Bitcoin Trololo Lines - Logarithmic Regression for 1D BLXTrololo Lines - Logarithmic Regression lines for Bitcoin with top and bottom ranges. Works only on BLX (BNC) 1 day time frame. Red lines indicate bottom buy range and top sell range. Thickest middle line is the origional "Trololo" or logarithmic regression line.
Bitcoin Cycle Top IndicatorBitcoin Cycle Top Indicator on the 1W Bitcoin Logarithmic chart.
Called all 3 tops so far to a T, this indicator will be great use for the next upcoming cycle.
I kept it sweet and simple, no need to overcomplicate. That's all this indicator does.
BLX GravityWavesEstimates generational tops and bottoms for bitcoin. Only works correctly for the BLX ticker (BNC:BLX). Although it has worked extremely well until the point of publication, don't assume it will work in the future; do your own research! :)
LinReg-Bitcoin's Power Oscillator.2019.01[wozdux]Bitcoin power oscillator from Harold Christopher Burger.
Since the first day of history is the most important, it is not correct to use this indicator on young exchanges with a short history.
The oscillator is calculated based on regression lines from the first day of history to the current day. The way of calculation of the oscillator. First, the regression line from the first day of history to the current bar is calculated for each bar.
Thus, for each bar, the formula of a straight regression line of the form Y=b*x + a is calculated. Where x is the number of days elapsed from the beginning of the history to the current drill. Y is the bitcoin price of the current day (bar) on the regression line. Thus, Y Is the predicted bitcoin price that would have to be. The second stage of calculation. Now we have the real price of bitcoin for the current day and the predicted price by the regression line. We calculate the ratio of the real price to the predicted one and take the logarithm of the obtained value. G=log10(Close/Y). This value is drawn in the form of a graph of the bitcoin power oscillator. The resulting oscillator oscillates in a constant range of values from -1 to +1.
This oscillator clearly captures the moments of price reversal. At the tops, the reversal occurs when the oscillator reaches the value range from 0.6 to 0.8. In the lowlands, the reversal occurs in the range of values from -0.8 to -0.4.
Indicator setting-description of buttons from top to bottom.
1) Raise the chart by X units. This is a corrective point in order to raise the chart above/below the zero line
2) Offset the start day of the story. The first day of history is the point relative to which all regression lines, all bars are calculated. This point can be slightly corrected by shifting the initial day to the left for a certain number of days.
3) button to switch between different ways to calculate the offset (A) in the formula Y=b*x + A.
4) the Orange level is the trend line of the historical power oscillator troughs. The orange level is an inclined level of price reversal from the bottom up.
5) the Green level is an important area of likely bitcoin price reversal at the tops.
6) the Red level is the horizontal level of the price reversal from the bottom up.
....
Осциллятор мощности биткоина от Harold Christopher Burger. "Это моя попытка воспроизвести вычисления данного генератора методами Pine Script .
Поскольку первый день истории имеет самое важное значение, то использовать данный индикатор на молодых биржах с короткой историей будет не корректно.
Осциллятор вычисляется на основе линий регрессии от первого дня истории до текущего дня. Путь вычисления осциллятора. Сначала для каждого бара вычисляется линия регрессии от первого дня истории до текущего бара.
Таким образом, для каждого бара вычисляется формула прямой линии регрессии вида Y=b*x + a. Где х -это количество дней, прошедших от начала истории до текущего бура. Y- это цена биткоина текущего дня (бара) на линии регрессии. Таким образом, Y- Это предсказанная цена биткоина, которая должна была бы быть. Второй этап вычисления. Теперь у нас есть реальная цена биткоина на текущий день и предсказанная цена линией регрессии. Вычисляем отношение реальной цены к предсказанной и берем логарифм , полученнного значения. G=log10(Close/Y). Это значение рисуем в виде графика осциллятора мощности биткоина. Полученный осциллятор колеблется в постоянном диапазоне значений от -1 до +1.
Данный осциллятор четко отлавливает моменты разворота цены. На вершинах разворот происходит тогда, когда осциллятор достигает области значения от 0.6 до 0.8. В низинах разворот происходит в области значений от -0.8 до -0.4.
Настройка индикатора - описание кнопок сверху вниз.
1 ) Поднять график на Х единиц. Это корректирующий пункт для того, чтобы приподнять график выше/ниже относительно нулевой линии
2) Смещение начального дня истории. Первый день истории -это та точка оносительно которой вычисялются все линиии регрессии, всех баров. Эту точку можно немного подкорректировать, сместив начальный день влево на какое-то количество дней.
3) Кнопка переключения между разными способами вычисления смещения (A) в формуле Y=b*x + A.
4) Оранжевый уровень - это линия тренда исторических впадин осциллятора мощности. Оранжевый уровень это наклонный уровень разворота цены снизу вверх.
5) Зеленый уровень - это важная область вероятного разворота цены биткоина на вершинах.
6) Красный уровень -это горизонтальный уровень областей разворота цены снизу вверх.
Yope BTC PL channelThis is a new version of the old "Yope BTC tops channel", but modified to reflect a power-law curve fitted, similar to the model proposed by Harold Christopher Burger in his medium article "Bitcoin’s natural long-term power-law corridor of growth".
My original tops channel fitting is still there for comparison. In fact, it looks like the old tops channel was a bit too pessimistic.
Note that these channels are still pure naive curve-fitting, and do not represent an underlying model that explains it, like is the case for PlanB's "Modeling Bitcoin's Value with Scarcity" which uses Stock-to-Flow.
The motivation for this exercise is to observe how long this empirical extrapolation is valid. Will the price of bitcoin stay in either of both channels?
Note on usage: This script _only_ works with the BLX "BraveNewCoin Liquid Index for Bitcoin" in the 1D, 3D and 1W time-frames!
It may be necessary to zoom in and out a few times to overcome drawing glitches caused by the extreme time-shifting of plots in order to draw the extrapolated part.
Bitcoin Liquid Indexbravenewcoin.com
TV doesn't allow you to view the Bitcoin Liquid Index on lower time frames if you aren't a Premium subscriber >:(
I cheesed the system by recreating the formula that BNC uses. It isn't an exact replica, but very very close!
It can be slow to load due to the security( ) calls.
Default settings use the timeframe of the chart, however, you can set a custom timeframe if you wish.
Cheers
DasanC