BTC Price OverlayThis is not a crazy strategy like most of the code I write. It's a simple overlay so you can drop BTC on top of whatever chart you are watching. It will track BTC's price on Binance.us (though the exchange is changeable with a few lines of code, maybe I will make it a dropdown on the next iteration of this.)
It uses TradingView's scale function to show both assets on a relative chart. BTC's price is on the left and your asset is on the right.
I've made this available for free because it is quick and easy. I plan to write a bot based around this code and that one will be private.
BTCUSD
Bitmex BTC Perpetual Premium and FundingThis script tracks the premium (default red line) and the funding rate (default yellow area) of the Bitmex XBTUSD pair perpetual contract.
The calculations are based on the 8H TWAP of interest rates and premium index from Bitmex.
BTC 30m ScriptWhat are your thoughts on this script? I connected it to Coinbase Pro via AWS lambda for auto-trading. I'm waiting for BTC to start bullish again before turning it on in production. Thoughts? Thank you! John
[VIP] Composite BTC Funding Rate APR
Calculates and displays a BTC funding rate (positive or negative) in terms of APR. Positive APR = Positive funding. Negative APR = Negative funding
This calculation is sourced from a variety of spot and perpetual markets on a couple of top-volume exchanges, Binance, FTX, etc.
This logic is utilized in Dip Hunter and Take Profit Hunter
Code is open source! All feedback and improvements encouraged
Universal logarithmic growth curves, with support and resistanceLogarithmic regression is used to model data where growth or decay accelerates rapidly at first and then slows over time. This model is for the long term series data (such as 10 years time span).
The user can consider entering the market when the price below 25% or 5% confidence and consider take profit when the price goes above 75% or 95% confidence line.
This script is:
- Designed to be usable in all tickers. (not only for bitcoin now!)
- Logarithmic regression and shows support-resistance level
- Shape of lines are all linear adjustable
- Height difference of levels and zones are customizable
- Support and resistance levels are highlighted
Input panel:
- Steps of drawing: Won't change it unless there are display problems.
- Resistance, support, other level color: self-explanatory.
- Stdev multipliers: A constant variable to adjust regression boundaries.
- Fib level N: Base on the relative position of top line and base line. If you don't want all fib levels, you might set all fib levels = 0.5.
- Linear lift up: vertically lift up the whole set of lines. By linear multiplication.
- Curvature constant: It is the base value of the exponential transform before converting it back to the chart and plotting it. A bigger base value will make a more upward curvy line.
FAQ:
Q: How to use it?
A: Click "Fx" in your chart then search this script to get it into your chart. Then right click the price axis, then select "Logarithmic" scale to show the curves probably.
Q: Why release this script?
A: - This script is intended to to fix the current issues of bitcoins growth curve script, and to provide a better version of the logarithmic curve, which is not only for bitcoin , but for all kinds of tickers.
- In the public library there is a hardcoded logarithmic growth curve by @quantadelic . But unfortunately that curve was hardcoded by his manual inputs, which makes the curve stop updating its value since 2019 the date he publish that code. Many users of that script love using it but they realize it was stop updating, many users out there based on @quantadelic version of "bitcoin logarithmic growth curves" and they tried their best to update the coordinates with their own hardcode input values. Eventually, a lot of redundant hardcoded "Bitcoin growth curve" scripts was born in the public library. Which is not a good thing.
Q: What about looking at the regression result with a log scale price axis?
A: You can use this script that I published in a year ago. This script display the result in a log scale price axis.
BTC Golden Bottom with Adaptive Moving AverageIntroduction:
This study uses Adaptive Moving Average with 1 year of length to plot on all time history Index Calculated by Tradingview . All previous $BTC bear runs bottomed on this curve which makes it important enough. Use this only on " "
Default Values:
AMA length is 1 year
Minor length is 50
Major length is 100
BTC Puell Multiple with alert functionThe Puell Multiple examines the fundamentals of mining profitability and the way they shape market cycles. It is calculated by taking a ratio of daily coin issuance (in USD) and the 365 moving average of daily coin issuance (in USD).
Interpretation of the Puell Multiple can generally be considered in the following framework:
high values indicate that current miner profitability if high compared to the yearly average. As such, the incentive for miners to liquidate their treasuries is high and greater sell pressure may be expected.
Low values indicate that current miner profitability is low compared to the yearly average. As such, income stress may become a factor, and some miners may need to start reducing hash-power by switching off rigs. This increases the hash-share of remaining miners who can then sell fewer coins to cover their operations, reducing their impact on liquid supply.
Halving events will drop the current coin issuance by 50% relative to the preceding year creating an immediate halving of the Puell Multiple also. The effect on miner profitability will thus be as per the point on low values above.
60-Day Accumulated Increasing RateIs this Bitcoin bull run still driven by new investors and new funds? Definitely. That’s why the 60-day accumulative increasing rate is so important and it can even determine everything. The only thing that can be trusted is the math. In history, each capital inflow uptrend bull run has ended once the 60-day accumulative increasing rate reached a high level and when the short-term euphoric investors push BTC price to rise at a fast speed and use up all kinds of leverages. At that point, there’s no time for new investors and new funds to flow in, thus the cryptocurrency market will crash from the global top.
In that sense, the crashes on 4th September, 2017 and 19th May, 2021 didn’t end the bull run, instead,they lengthened the bull run span.The last bull run cycle (2017) might have ended prematurely when BTC reached $10,000, recording 150% accumulated increase over 60 days. Then BTC won’t be pumped up to $20,000 if the course wasn’t interrupted by September 4th, 2017 incident.
Technical analysts(they are far from trustworthy, full of bollocks) call the correction of BTC: “consolidation or wipeout”, just like that diabetes is called as Liver Qi Stagnation, weight lossing, being thirsty and other symptoms. It’s quite fun to watch so many people explaining it in a false concept. Everyone knows what the maths is. That’s enough.
PS: This indicator can only be applied to Bitcoin daily chart!
Aggregated BTC SpreadThis script is used to aggregate the bitcoin spread on futures contracts on different platforms.
It works by averaging the for every selected exchange, and apply an EMA of .
It is supporting
Binance (USD / USDT)
Okex
FTX
Huobi
Deribit
Ascendex
CME (BTC1!)
Linear Regression Channel Breakout StrategyThis strategy is based on LonesomeTheBlue's Linear Regression Channel Indicator. First of all, I would like to thank LonesomeTheBlue. Breaking the Linear Regression Channel to close the candle triggers a Long or Short signal. If the slope of the Linear Regression Channel is positive, it is Short when it breaks out the lower line, and when the slope is negative, it is Long when it breaks out the upper line. The default is optimized for 8-hour candles, and for other hour candles, find the optimal value yourself. Below is a description of LonesomeTheBlue's Linear Regression Channel.
이 전략은 LonesomeTheBlue의 Linear Regression Channel Indicator를 기반으로 만들어졌습니다. 우선 LonesomeTheBlue님께 감사의 말씀을 드립니다. Linear Regression Channel을 돌파하여 봉 마감하면 Long 또는 Short 신호를 트리거합니다. Linear Regression Channel의 기울기가 양인 경우 하단 라인을 돌파하면 Short이고 그 기울기가 음인 경우 상단 라인을 돌파하면 Long입니다. 기본값은 8시간봉에 최적화 되어 있으며, 다른 시간봉은 직접 최적값을 찾아보십시오. 아래는 LonesomeTheBlue의 Linear Regression Channel에 대한 설명을 퍼왔습니다.
________________________________________________
There are several nice Linear Regression Channel scripts in the Public Library. and I tried to make one with some extra features too. This one can check if the Price breaks the channel and it shows where is was broken. Also it checks the momentum of the channel and shows it's increasing/decreasing/equal in a label, shape of the label also changes. The line colors change according to direction.
using the options, you can;
- Set the Source (Close, HL2 etc)
- Set the Channel length
- Set Deviation
- Change Up/Down Line colors
- Show/hide broken channels
- Change line width
meaning of arrows:
⇑ : Uptrend and moment incresing
⇗ : Uptrend and moment decreasing
⇓ : Downtrend and moment incresing
⇘ : Downtrend and moment decreasing
⇒ : No trend
BTC Risk Metric - Estimates the risk of BTC price versus the USD
- To be used on the daily timeframe
- Works best on a BTC pair that has a lot of bars, e.g. The Bitcoin All Time History Index
- 0 is the lowest risk, 1 is the highest risk
- Historically, buying when the risk was low and selling when the risk was high would have yielded good ROI
- The risk bands are 0.1 in width and are highlighted on the plot
Typical Strategy:
- weighted DCA into the market when risk <0.5, do nothing between 0.5-0.6 and weighted DCA out of the market when risk >0.6
- x = buy amount per DCA interval
- y = 1/10th total BTC held by the user
- if 0 ≤ Risk < 0.1 then buy 5x
- if 0.1 ≤ Risk < 0.2 then buy 4x
- if 0.2 ≤ Risk < 0.3 then buy 3x
- if 0.3 ≤ Risk < 0.4 then buy 2x
- if 0.4 ≤ Risk < 0.5 then buy x
- if 0.5 ≤ Risk < 0.6 then do nothing
- if 0.6 ≤ Risk < 0.7 then sell y
- if 0.7 ≤ Risk < 0.8 then sell 2y
- if 0.8 ≤ Risk < 0.9 then sell 3y
- if 0.9 ≤ Risk ≤ 1.0 then sell 4y
Simple EMA Crossing Strategy TradeMathSimple EMA Crossing strategy, based on crossover Fast exponential moving average = EMA21 and Slow exponential moving average = EMA55.
Default stop loss is 3%, but you can change it.
Default take profit is 9%, it based on stop loss.
Risk to Reward ratio is 1 to 3.
Strategy was tested on BTCUSDT 1H timeframe and works fine with these parameters.
Roberts Pi Cycle Top and Bottom Indicator BTCIndicator Overview
The Pi Cycle Top Indicator has historically been effective in picking out the timing of market cycle highs to within 3 days.
It uses the 111 day moving average (111DMA) and a newly created multiple of the 350 day moving average, the 350DMA x 2.
This updated indicator is based on the original x2 Daily Simple Moving Average Pi Cycle Top Indicator for BTCUSD but with the addition of a 3rd 350 SMA
Standard Pi Cycle SMA = 350*2 SMA + 111 SMA
Updated Pi Cycle SMA = 350*2 SMA + 111 SMA + 350 SMA
How It Can Be Used / How to Read:
Chart should be used on BTCUSD only
Chart should be set to Daily Timeframe only
Buy signal RED SMA crosses up over WHITE SMA
Sell Signal RED SMA crosses up over GREEN SMA (a vetical yellow line will indicate the cycle top)
[CP]Pivot Boss Floor Pivots with ATR Dilation and Dynamic LevelsINTRODUCTION:
Compared to all the Pivot Indicators available on Trading View Public Library, this Floor Pivots Indicator differentiates itself in two major original ways:
Dilates the Pivot Support/Resistance Levels into Support/Resistance Bands based on volatility
Displays the S/R Levels Dynamically , that is, only those levels will be shown that are close enough to the price resulting in much cleaner looking charts.
There were a few features whose logic I had figured out, but I could not implement them due Pine Script’s Limitation (they should really work on increasing Pine Script’s capacity instead of adding more and more features to the language in order to make it look ‘better’):
Showing multiple timeframe pivots at the same time (not possible due to Pine Script’s limitation on the ‘Max Number of Outputs’ )
Automatic Detection of highly profitable Double Hot Pivot Zones (DPZ), also due to the ‘Max Number of Outputs’ limit
GENERAL USER INPUTS:
Most of the settings are self-explanatory, however, a few of them need some explanation:
Show Floor Pivots Dynamically – This will turn ON the dynamic pivot levels, please note that this function will work ONLY IN INTRADAY timeframes.
Dynamic Pivot ATR Period – Period over which the ATR value is calculated to show the pivots dynamically.
ATR Threshold for Dynamic Floor Pivots – Simply put, the indicator will start displaying Pivot Levels if they fall within the 2*ATR distance (default value) of the price. You can increase this number if the volatility increases and vice-versa.
Use ATR to Dilate Intraday Pivot Levels – This will turn ON Floor Pivot Dilation, turning pivot ‘lines’ into ‘bands’ .
ATR Dilation Factor – This number decides the width of the Pivot bands. Larger this number, thicker the bands. Typically, high volatility stocks will require a higher number.
ATR Period – Same as Dynamic Pivot ATR Period, but for Pivot Level Dilation.
INDICATOR USAGE EXAMPLES:
This indicator works great in conjunction with my Pivot Boss Candlestick Scanner indicator.
There are a lot of optimizations I have done in the code, although it looks trivial at first glance, but it's fairly complex.
Feel free to use it and modify it as you wish.
Here are a few examples where the indicator has shown great entries and exits, with the default settings:
NIFTY 5m Chart
Reliance 5m Chart
Tesla 5m Chart
Bitcoin-USDT 15m Chart
FINAL WORDS:
Please understand that I have Cherry Picked the examples to showcase the capability of the indicator and its usage.
DO NOT conflate the accuracy of examples with the accuracy of this indicator.
Once you start using floor pivots, you will realize that a lot of days simply don’t give any high probability setups and you will simply sit out of the market and do nothing (which is a good thing).
If you really want to learn how to use Pivots, read the book ’Secrets of a Pivot Boss’ . This book can change your life.
BTCUSD Risk Oscillator- To be used with the BTCUSD All Time History Index (on the daily)
- Estimates the current risk of BTCUSD
- The risk model oscillates between 0 and 1 (0 is the lowest risk, 1 is the highest)
- Historically, buying when the risk is low and selling when the risk is high yields good ROI
- User inputs generally do not need to be changed, they are used to create integers for the normalization process
Bitcoin Logarithmic Fractal Growth Model By ARUDDThis model, which I'm calling the Logarithmic Fractal Growth Mode (L.F.G) , uses Bitcoin's mathematical monetary policy to evaluate the future possible price valuation.
It takes into account fractal (and logarithmic) growth as well as how those who hold bitcoins might react to certain events such as changes in supply and demand. It also shows that it is mathematically logical that someday it must become stable.
The information gained from knowing this helps people make more informed decisions when buying bitcoin and thinking of its future possibilities.
The model can serve as some type of general guideline for determining how much bitcoins should be worth in the future if it follows a certain path from its current price.
Modeling Bitcoin's money supply mathematically, and knowing that there is a finite number of them, makes this whole process much more rational than just thinking about the possibilities in pure subjective terms.
Before going any further I want to say that no one can know with absolute certainty what will happen to bitcoins price in the future, but using mathematics gives us an idea of where things are headed.
The results presented here are based on very reasonable assumptions for how bitcoin might continue to grow (and then level out) once there are over 21 million bitcoins in existence.
The model shows that bitcoin's price can never go down to zero (thus creating the "death spiral" phenomenon), and as such, bitcoin has an extremely high probability of becoming stable as it approaches infinity.
Conversely, this model also shows that at some point there is a high probability that bitcoin will not continue to grow exponentially forever.
Credit goes to Quantadelic for the awesome original script.
ARUDD
Traffic Lights Strategy4HS Crypto Market Strategy
This strategy uses 4 ema to get Long or Short Signals
Length are: 4, 9, 18, 100
We take long positions when the order of the emas is the following:
green > yellow > red (As the color of Traffic Lights) and they are above white ema (Used as a filter for long positions)
We take short positions when the order of the emas is the following:
green < yellow < red (As the color of inverse Traffic Lights) and they are below white ema (Used as a filter for short positions)
Enable Long and/or Short Positions in settings
Enable Profit and Stop in strategy settings with different percentage to backtest the strategy. Also if it is better to use a Traditional Stop Loss or a Trailing Stop Loss based on ATR
Change ema filter resolution in settings for better strategy performance
This Strategy was tested on Crypto Market with good results in assets as BTC, ETH, BNB, ADA, LTC, XLM, BCH, among others
Feel free to optimize this strategy, optimizing its parameters. Each asset has its own "personality".
Super D2Momentum Indicator based on previous candle structure over past 40 periods
- Blue is momentum score
- Green = 15 ema
- Red = 50 sma
- orange = 100 sma
The indicator looks at the previous candles differences between open, close, high, and low to determine momentum. A high close relative to open or low indicates very strong momentum for example.
Optimized Keltner Channels SL/TP Strategy for BTCThis strategy is optimized for Bitcoin with the Keltner Channel Strategy, which is TradingView's built-in strategy. In the original Keltner Channel Strategy, it was difficult to predict the timing of entry because the Buy and Sell signals floated in the middle of the candle in real time. This strategy is convenient because if the bitcoin price hits the top or bottom of the Keltner Channel and closes the closing price, you can enter Buy or Sell at the next candle start price. In addition, this strategy provides Stop Loss and Take Profit functions to maximize profit.
_________________________________
Recommended settings are below.
- length: 9
- multiplier: 1
- source: close
- (v) Use EMA
- Bands Style: Average True Range
- ATR Length: 19
- Stop Loss (%): 20
- Take Profit (%) : 20
_________________________________
- length: 9
- multiplier: 1
- source: close
- (v) Use EMA
- Bands Style: Average True Range
- ATR Length: 18
- Stop Loss (%): 20
- Take Profit (%) : 5
_________________________________
▶ Usefulness and Originality
- Stop Loss and Take Profit functions are available
- Convenient Buy and Sell entry compared to the original Keltner Channel Strategy
- Optimized for BTCUSD market (maximizing profits)
___________________________________________
이 전략은 TradingView의 Built-in 전략인 Keltner Channel Strategy를 비트코인에 맞게 최적화되었습니다. 기존의 Keltner Channel Strategy는 Buy, Sell 신호가 캔들 중간에 실시간으로 떠서 진입 시점을 예측하기 어려운 불편함이 있었지만 이 전략은 비트코인 가격이 Keltner Channel 상단 혹은 하단을 찍고 종가를 마감하면 그 다음 캔들 시작가에서 Buy 혹은 Sell 진입이 가능하여 편리합니다. 또한, 이 전략은 Keltner Channel을 만나서 캔들을 마감한 가격 (bprice, sprice)을 시각적으로 plot을 제공하여 타점 및 차트를 보기에 편리하며 손절가 및 목표가를 지정한 백테스팅이 가능합니다.
Kimchi Premium Indicator with Selectable SymbolsThis indicator is the Korea Premium, also known as “Kimchi Premium” indicator, which shows how expensive and cheap the bitcoin price of the bitcoin exchange in Korea as compared to the bitcoin price traded in dollars or tether. Previously, the Kimchi premium indicator in TradingView does not have the recently added Upbit BTCKRW market, and it is not possible to select markets. In addition to the recently added Upbit BTCKRW market, this indicator is convenient because you can select all markets offered by TradingView. Therefore, not only bitcoin but also altcoin kimchi premium can be plotted.
▶ Usefulness and Originality
- Users can choose from various BTCKRW and BTCUSD markets.
- Users can plot altcoin Kimchi Premium in addition to Bitcoin.
_____________________________________________________________
이 지표는 달러 혹은 테더로 거래되고 있는 비트코인 가격 대비 한국에 있는 비트코인 거래소의 비트코인 원화 가격이 얼마나 비싸고 싼 지를 나타내는 코리아 프리미엄, 일명 "김치 프리미엄" 지표입니다. 이전에 트레이딩뷰에 있는 김치 프리미엄 지표는 최근에 추가된 업비트 BTCKRW 시장이 없을 뿐만 아니라 마켓을 선택할 수가 없습니다. 이 지표는 최근에 추가된 업비트 BTCKRW 마켓과 더불어 트레이딩뷰에서 제공하는 모든 마켓을 선택할 수 있어 편리합니다. 따라서 비트코인 뿐 만 아니라 알트코인의 김치 프리미엄도 plot할 수가 있습니다.
▶ 유용성과 독창성
- 사용자가 다양한 BTCKRW 및 BTCUSD 마켓을 선택할 수 있음
- 사용자가 비트코인 외에 알트코인 김치프리미엄도 plot 할 수 있음
Chanu Delta StrategyThis strategy is built on the Chanu Delta Indicator, which indicates the strength of the Bitcoin market. When the Chanu Delta Indicator hits “Delta_bull” and “Delta_bear” and closes the candle, long and short signals are triggered respectively. The example shown on the screen is a default setting optimized for a 4-hour candlestick strategy based on the Bybit BTCUSDT futures market. For the 15-minute candle, "Delta_bull=32", "Delta_bear=-31", "Source=hlc3" are best. You can use it by adjusting the setting value and modifying it to suit you.
If you use this strategy in conjunction with the Chanu Delta Indicator, it is convenient to anticipate alert signals in advance. Since the Chanu Delta Indicator represents the price difference based on the Bybit BTCUSDT futures market, backtesting is possible from March 2020.
Chanu Delta IndicatorThe Chanu Delta Indicator was created as the price difference between the two markets using the principle that the Bitcoin price fluctuations in the BTCUSD market on the BYBIT exchange are greater in the BTCUSDT market. This indicator shows the strength of the current market's buys and sells, and helps in short-term trading.
Chanu Delta Indicator (Δ) = BTCUSD ($) - BTCUSDT ($) (Unit: Dollar, Source: Close)
● Δ > 100 : Strong Buy
● 20 < Δ < 100 : Buy
● -20 < Δ < 20 : Neutral
● -100 < Δ < -20 : Sell
● Δ < -100 : Strong Sell
Bitcoin S2F(X)This indicator shows the BTCUSD price based on the S2F Model by PlanB.
We can see not only the S2F(Stock-to-Flow) but also the S2FX(Stock-to-Flow Cross Asset) model announced in 2020.
█ Overview
In this model, bitcoin is treated as comparable to commodities such as gold .
These commodities are known as "store of value" commodities because they retain their value over time due to their relative scarcity.
Bitcoins are scarce.
The number of coins in existence is limited, and the rate of supply is at an all-time low because mining the 2.2 million outstanding coins that have yet to be mined requires a lot of power and computing power.
The Stock-to-flow ratio is used to evaluate the current stock of a commodity (the total amount currently available) versus the flow of new production (the amount mined in a given year).
The higher this ratio, the more scarce the commodity is and the more valuable it is as a store of value.
█ How To View
On the above chart price is overlaid on top of the S2F(X) line. We can see that price has continued to follow the stock-to-flow of Bitcoin over time. By observing the S2F(X) line, we can expect to be able to predict where the price will go.
The coloured circles on the price line of this chart show the number of days until the next Bitcoin halving event. This is an event where the reward for mining new blocks is halved, meaning miners receive 50% fewer bitcoins for verifying transactions. Bitcoin halvings are scheduled to occur every 210,000 blocks until the maximum supply of 21 million bitcoins has been generated by the network. That makes stock-to-flow ratio (scarcity) higher so in theory price should go up.
The stock-to-flow line on this chart incorporates a 463-day average into the model to smooth out the changes caused in the market by the halving events.
I recommend using this indicator on a weekly or monthly basis for BITSTAMP:BTCUSD .
█ Reference Script
Bitcoin Stock to Flow Multiple by yomofoV