Bitcoin Futures vs. Spot Tri-Frame - Strategy [presentTrading]Prove idea with a backtest is always true for trading.
I developed and open-sourced it as an educational material for crypto traders to understand that the futures and spot spread may be effective but not be as effective as they might think. It serves as an indicator of sentiment rather than a reliable predictor of market trends over certain periods. It is better suited for specific trading environments, which require further research.
█ Introduction and How it is Different
The "Bitcoin Futures vs. Spot Tri-Frame Strategy" utilizes three different timeframes to calculate the Z-Score of the spread between BTC futures and spot prices on Binance and OKX exchanges. The strategy executes long or short trades based on composite Z-Score conditions across the three timeframes.
The spread refers to the difference in price between BTC futures and BTC spot prices, calculated by taking a weighted average of futures prices from multiple exchanges (Binance and OKX) and subtracting a weighted average of spot prices from the same exchanges.
BTCUSD 1D L/S Performance
█ Strategy, How It Works: Detailed Explanation
🔶 Calculation of the Spread
The spread is the difference in price between BTC futures and BTC spot prices. The strategy calculates the spread by taking a weighted average of futures prices from multiple exchanges (Binance and OKX) and subtracting a weighted average of spot prices from the same exchanges. This spread serves as the primary metric for identifying trading opportunities.
Spread = Weighted Average Futures Price - Weighted Average Spot Price
🔶 Z-Score Calculation
The Z-Score measures how many standard deviations the current spread is from its historical mean. This is calculated for each timeframe as follows:
Spread Mean_tf = SMA(Spread_tf, longTermSMA)
Spread StdDev_tf = STDEV(Spread_tf, longTermSMA)
Z-Score_tf = (Spread_tf - Spread Mean_tf) / Spread StdDev_tf
Local performance
🔶 Composite Entry Conditions
The strategy triggers long and short entries based on composite Z-Score conditions across all three timeframes:
- Long Condition: All three Z-Scores must be greater than the long entry threshold.
Long Condition = (Z-Score_tf1 > zScoreLongEntryThreshold) and (Z-Score_tf2 > zScoreLongEntryThreshold) and (Z-Score_tf3 > zScoreLongEntryThreshold)
- Short Condition: All three Z-Scores must be less than the short entry threshold.
Short Condition = (Z-Score_tf1 < zScoreShortEntryThreshold) and (Z-Score_tf2 < zScoreShortEntryThreshold) and (Z-Score_tf3 < zScoreShortEntryThreshold)
█ Trade Direction
The strategy allows the user to specify the trading direction:
- Long: Only long trades are executed.
- Short: Only short trades are executed.
- Both: Both long and short trades are executed based on the Z-Score conditions.
█ Usage
The strategy can be applied to BTC or Crypto trading on major exchanges like Binance and OKX. By leveraging discrepancies between futures and spot prices, traders can exploit market inefficiencies. This strategy is suitable for traders who prefer a statistical approach and want to diversify their timeframes to validate signals.
█ Default Settings
- Input TF 1 (60 minutes): Sets the first timeframe for Z-Score calculation.
- Input TF 2 (120 minutes): Sets the second timeframe for Z-Score calculation.
- Input TF 3 (180 minutes): Sets the third timeframe for Z-Score calculation.
- Long Entry Z-Score Threshold (3): Defines the threshold above which a long trade is triggered.
- Short Entry Z-Score Threshold (-3): Defines the threshold below which a short trade is triggered.
- Long-Term SMA Period (100): The period used to calculate the simple moving average for the spread.
- Use Hold Days (true): Enables holding trades for a specified number of days.
- Hold Days (5): Number of days to hold the trade before exiting.
- TPSL Condition (None): Defines the conditions for taking profit and stop loss.
- Take Profit (%) (30.0): The percentage at which the trade will take profit.
- Stop Loss (%) (20.0): The percentage at which the trade will stop loss.
By fine-tuning these settings, traders can optimize the strategy to suit their risk tolerance and trading style, enhancing overall performance.
Btc!
CME Gap Oscillator [CryptoSea]Introducing the CME Gap Oscillator , a pioneering tool designed to illuminate the significance of market gaps through the lens of the Chicago Mercantile Exchange (CME). By leveraging gap sizes in relation to the Average True Range (ATR), this indicator offers a unique perspective on market dynamics, particularly around the critical weekly close periods.
Key Features
Gap Measurement : At its core, the CME Oscillator quantifies the size of weekend gaps in the context of the market's volatility, using the ATR to standardize this measurement.
Dynamic Levels : Incorporating a dynamic extreme level calculation, the tool adapts to current market conditions, providing real-time insights into significant gap sizes and their implications.
Band Analysis : Through the introduction of upper and lower bands, based on standard deviations, traders can visually assess the oscillator's position relative to typical market ranges.
Enhanced Insights : A built-in table tracks the frequency of the oscillator's breaches beyond these bands within the latest CME week, offering a snapshot of recent market extremities.
Settings & Customisation
ATR-Based Measurement : Choose to measure gap sizes directly or in terms of ATR for a volatility-adjusted view.
Band Period Adjustability : Tailor the oscillator's sensitivity by modifying the band calculation period.
Dynamic Level Multipliers : Adjust the multiplier for dynamic levels to suit your analysis needs.
Visual Preferences : Customise the oscillator, bands, and table visuals, including color schemes and line styles.
In the example below, it demonstrates that the CME will want to return to the 0 value, this would be considered a reset or gap fill.
Application & Strategy
Deploy the CME Oscillator to enhance your market analysis
Market Sentiment : Gauge weekend market sentiment shifts through gap analysis, refining your strategy for the week ahead.
Volatility Insights : Use the oscillator's ATR-based measurements to understand the volatility context of gaps, aiding in risk management.
Trend Identification : Identify potential trend continuations or reversals based on the frequency and magnitude of gaps exceeding dynamic levels.
The CME Oscillator stands out as a strategic tool for traders focusing on gap analysis and volatility assessment. By offering a detailed breakdown of market gaps in relation to volatility, it empowers users with actionable insights, enabling more informed trading decisions across a range of markets and timeframes.
Multi BTC Rolling APY Calculator [presentTrading]█ Introduction and How it is Different
The "Multi BTC Rolling APY Calculator " is an innovative Pine Script indicator tailored for cryptocurrency traders, providing insights into arbitrage opportunities and market sentiment by calculating the Rolling Annual Percentage Yield (APY) between spot and futures prices of Bitcoin. Unlike traditional APY calculators, this tool specializes in capturing the nuances of the highly volatile and less efficient cryptocurrency markets. Rolling APY is derived from traditional market basis arbitrage but adapted to highlight significant discrepancies that frequently occur between derivative and underlying asset prices in crypto markets.
Historical backtesting has revealed that Bitcoin's Rolling APY can serve as a robust indicator of market sentiment:
- Below 0%: Often indicates panic or 'end-of-world' scenarios.
- 0-5%: Signifies extreme market fear.
- 5-10%: Reflects a calm market environment.
- 10-15%: Suggests a moderately warm market.
- 15-20%: Indicates an overheated market.
- **Above 20%: Signals FOMO (fear of missing out).
This nuanced understanding of Rolling APY helps investors not only spot arbitrage opportunities but also gauge the emotional state of the market, providing a dual function that enhances trading strategies in the volatile realm of cryptocurrencies.
█ Strategy: How It Works – Detailed Explanation
🔶 Rolling APY Calculation
The Rolling APY calculation is crucial for understanding the annualized potential returns from arbitrage strategies, given by the formula:
APY = ((Future Price - Spot Price) / Spot Price) * (365 / Days Until Expiration) * 100
This annualizes the observed premium or discount on futures contracts relative to the spot price, providing a year-over-year expectation of returns if one were to engage in arbitrage over the specified period.
🔶 Days Calculation
The accuracy of APY is contingent upon the precise calculation of days until each contract expires:
Days = (Expiration Timestamp - Current Timestamp) / 86400000
This calculation ensures the APY reflects true market dynamics for each futures contract's duration.
█ Trade Direction
While this tool does not provide direct trading signals, it informs traders about potential arbitrage opportunities and the prevailing market sentiment. Traders can leverage this data to make strategic decisions, aligning long or short positions with the anticipated market movements and arbitrage conditions.
█ Usage
By inputting specific parameters related to their market analysis, traders can monitor discrepancies in Bitcoin’s pricing across different timelines, which is especially beneficial for those involved in derivatives trading, arbitrage, and sentiment analysis.
█ Default Settings
- Resolution: Controls the frequency of data (default is daily).
- Show numbers in annual: Determines whether APY is displayed on an annual basis.
- Base Symbol and Future Symbols: Specify the spot and futures markets for analysis.
panpanXBT BTC Risk Metric OscillatorThis is the Bitcoin Risk Metric. Inspired by many power law analysts, this script assigns a risk value to the price of Bitcoin. The model uses regression of 'fair value' data to assign risk values and residual analysis to account for diminishing returns as time goes on. This indicator is for long-term investors looking to maximise their returns by highlighting periods of under and overvaluation for Bitcoin.
This is a companion script for panpanXBT BTC Risk Metric . Use this indicator in tandem to achieve the view shown in the chart above.
Please note, this indicator will only work on BTCUSD charts but will work on any timeframe.
DISCLAIMER: The product on offer presents a novel way to view the price history of Bitcoin. It should not be relied upon solely to inform financial decisions. What you do with the information is entirely up to you. Please thoroughly consider your decisions and consult many different sources to make sure you're making the most well-informed decision.
### How to Interpret
The risk scale goes from 0 to 100,
Blue - 0 being low risk, and
Red - 100 being high risk.
Low risk values represent periods of historical undervaluation, while high values represent overvaluation. These periods are marked by a colourscale from blue to red.
### Use Cases and Best Practice
A dynamic DCA strategy would work best with this indicator, whereby an amount of capital is deployed/retired on a regular basis. This amount deployed grows or shrinks depending on the proximity of the risk level to the extremes (0 and 100).
Let's say you have a maximum of $500 to deploy per month.
When risk is between 0 and 10, you could deploy the full $500.
When risk is between 10 and 20, you could deploy $400.
When risk is between 20 and 30, you could deploy $300.
When risk is between 30 and 40, you could deploy $200.
When risk is between 40 and 50, you could deploy $100.
Conversely, when risk is above 50, you could:
Sell 1/15th of your BTC stack when risk is between 50 and 60.
Sell 2/15th of your BTC stack when risk is between 60 and 70.
Sell 3/15th of your BTC stack when risk is between 70 and 80.
Sell 4/15th of your BTC stack when risk is between 80 and 90.
Sell 5/15th of your BTC stack when risk is between 90 and 100.
This framework allows the user to accumulate during periods of undervaluation and derisk during periods of overvaluation, capturing returns in the process.
In contrast, simply setting limit orders at 0 and 100 would yield the absolute maximum returns, however there is no guarantee price will reach these levels (see 2018 where the bear market bottomed out at 20 risk, or 2021 where price topped out at 97 risk).
### Caveats
"All models are wrong, some are useful"
No model is perfect. No model can predict exactly what price will do as there are too many factors at play that determine the outcome. We use models as a guide to make better-informed decisions, as opposed to shooting in the dark. This model is not a get rich quick scheme, but rather a tool to help inform decisions should you consider investing. This model serves to highlight price extremities, which could present opportune times to invest.
### Conclusion
This indicator aims to highlight periods of extreme values for Bitcoin, which may provide an edge in the market for long-term investors.
Thank you for your interest in this indicator. If you have any questions, recommendations or feedback, please leave a comment or drop me a message on TV or twitter. I aim to be as transparent as possible with this project, so please seek clarification if you are unsure about anything.
panpanXBT BTC Risk MetricThis is the Bitcoin Risk Metric. Inspired by many power law analysts, this script assigns a risk value to the price of Bitcoin. The model uses regression of 'fair value' data to assign risk values and residual analysis to account for diminishing returns as time goes on. This indicator is for long-term investors looking to maximise their returns by highlighting periods of under and overvaluation for Bitcoin.
This is a companion script for panpanXBT BTC Risk Metric Oscillator . Use this indicator in tandem to achieve the view shown in the chart above.
Please note, this indicator will only work on BTCUSD charts but will work on any timeframe.
DISCLAIMER: The product on offer presents a novel way to view the price history of Bitcoin. It should not be relied upon solely to inform financial decisions. What you do with the information is entirely up to you. Please thoroughly consider your decisions and consult many different sources to make sure you're making the most well-informed decision.
### How to Interpret
The risk scale goes from 0 to 100,
Blue - 0 being low risk, and
Red - 100 being high risk.
Low risk values represent periods of historical undervaluation, while high values represent overvaluation. These periods are marked by a colourscale from blue to red.
### Use Cases and Best Practice
A dynamic DCA strategy would work best with this indicator, whereby an amount of capital is deployed/retired on a regular basis. This amount deployed grows or shrinks depending on the proximity of the risk level to the extremes (0 and 100).
Let's say you have a maximum of $500 to deploy per month.
When risk is between 0 and 10, you could deploy the full $500.
When risk is between 10 and 20, you could deploy $400.
When risk is between 20 and 30, you could deploy $300.
When risk is between 30 and 40, you could deploy $200.
When risk is between 40 and 50, you could deploy $100.
Conversely, when risk is above 50, you could:
Sell 1/15th of your BTC stack when risk is between 50 and 60.
Sell 2/15th of your BTC stack when risk is between 60 and 70.
Sell 3/15th of your BTC stack when risk is between 70 and 80.
Sell 4/15th of your BTC stack when risk is between 80 and 90.
Sell 5/15th of your BTC stack when risk is between 90 and 100.
This framework allows the user to accumulate during periods of undervaluation and derisk during periods of overvaluation, capturing returns in the process.
In contrast, simply setting limit orders at 0 and 100 would yield the absolute maximum returns, however there is no guarantee price will reach these levels (see 2018 where the bear market bottomed out at 20 risk, or 2021 where price topped out at 97 risk).
### Caveats
"All models are wrong, some are useful"
No model is perfect. No model can predict exactly what price will do as there are too many factors at play that determine the outcome. We use models as a guide to make better-informed decisions, as opposed to shooting in the dark. This model is not a get rich quick scheme, but rather a tool to help inform decisions should you consider investing. This model serves to highlight price extremities, which could present opportune times to invest.
### Conclusion
This indicator aims to highlight periods of extreme values for Bitcoin, which may provide an edge in the market for long-term investors.
Thank you for your interest in this indicator. If you have any questions, recommendations or feedback, please leave a comment or drop me a message on TV or twitter. I aim to be as transparent as possible with this project, so please seek clarification if you are unsure about anything.
[MAD] BTC ETF Volume In/OutflowThe " BTC ETF Volume In/Outflows" indicator is designed to analyze and visualize the volume data of various Bitcoin Exchange-Traded Funds (ETFs) across different exchanges. This indicator helps traders and analysts observe the inflows and outflows of trading volume in a structured and comparative manner.
Features
Multi-Ticker Support: The indicator is capable of handling volume data from multiple ETFs simultaneously, making it versatile for comparative analysis.
Volume Adjustments: Provides an option to view volume data either as the number of pieces (shares) traded or as monetary flow (value traded).
Compression Factor: Includes a volume compression factor setting that helps in emphasizing smaller volume changes or smoothing out volume spikes.
Data Calculation
Volume data is processed using a custom function that adjusts the data based on user settings for piece or monetary representation and applies a logarithmic compression factor.
This processed data is then fetched for each ticker.
Visualization
Volume data is visualized on the chart using column plots where each ETF's volume data is stacked and offset to provide a clear visual representation of in/outflows. Horizontal lines indicate the zero level for reference.
Usage Scenario
This indicator is particularly useful for traders who track multiple ETFs and need to compare their volume activities simultaneously. It provides insights into market trends, potentially indicating bullish or bearish shifts based on volume inflows and outflows across different instruments.
have fun :-)
True Market Mean BandsIntroducing the "True Market Mean Bands" (TMMB) , a technical analysis tool designed for Bitcoin. TMMB provides a model of market valuation by integrating the concept of Vaulted Realized Price with dynamic volatility bands, offering traders insights into potential market movements.
Core Concept and Utility:
The TMMB centers around the Vaulted Realized Price, an advanced metric that refines the realized price by accounting for Bitcoin that is "vaulted" - or held out of active circulation. This metric offers a deeper understanding of market valuation by considering not just the last transaction prices but also the long-term holding behaviors of investors.
Innovative Bands:
Building on this core concept, the TMMB introduces multiple bands that reflect market volatility and supply dynamics. These bands are derived using a combination of statistical analysis and customizable multipliers, allowing for adaptation to varying market conditions. The bands include:
Standard Deviation Bands: Adjusted for market volatility, providing a dynamic measure of overbought and oversold conditions.
Vaulted Realized Price Multiplier Bands: These bands use multipliers inspired by the price distribution around the mean, aligning with key psychological and mathematical levels in the market.
Technical Insight:
At the heart of TMMB lies a robust calculation framework that leverages:
Security Function: To fetch relevant market data, ensuring real-time accuracy and relevance.
Customizable Multipliers: Allowing users to adjust the sensitivity of the bands according to their trading strategies.
Statistical Analysis: Utilizing standard deviation and mean calculations to dynamically adapt the bands to market conditions.
Originality and Usefulness:
The TMMB stands out by offering a unique perspective on Bitcoin's market valuation, taking into account long-term holding patterns which are often overlooked in traditional indicators. This approach not only enriches market analysis but also provides traders with actionable insights, potentially enhancing trading strategies.
Application and Value:
TMMB is especially useful for traders and analysts looking for a deeper understanding of market dynamics, beyond surface-level price movements. It offers a valuable tool for identifying potential entry and exit points, assessing market sentiment, and making informed trading decisions.
BTC Purchasing Power 2009-20XX! Hello, today I'm going to show you something that shifts our perspective on Bitcoin's value, not just in nominal terms, but adjusted for the real buying power over the years. This Pine Script TAS developed for TradingView does exactly that by taking into account inflation rates from 2009 to the present.
As you know, inflation erodes the purchasing power of money. That $100 in 2009 does not buy you the same amount in goods or services today. The same concept applies to Bitcoin. While we often look at its price in terms of dollars, pounds, or euros, it's crucial to understand what that price really means in terms of purchasing power.
What this script does is adjust the price of Bitcoin for cumulative inflation since 2009, allowing us to see not just how the nominal price has changed, but how its value as a means of purchasing goods and services has evolved.
For example, if we see Bitcoin's price at $60,000 today, that number might seem high compared to its early years. However, when we adjust this price for inflation, we might find that in terms of 2009's purchasing power, the effective price might be somewhat lower. This adjusted price gives us a more accurate reflection of Bitcoin's true value over time.
This script plots two lines on the chart:
The Original BTC Price: This is the unadjusted price of Bitcoin as we typically see it.
BTC Purchasing Power: This line shows Bitcoin's price adjusted for inflation, reflecting how many goods or services Bitcoin could buy at that point in time compared to 2009.
By comparing these lines, we can observe periods where Bitcoin's purchasing power significantly increased, even if the nominal price was not at its peak. This can help us identify moments when Bitcoin was undervalued or overvalued in real terms.
This analysis is crucial for long-term investors and traders who want to understand Bitcoin's value beyond the surface-level price movements. It helps us appreciate Bitcoin's potential as a store of value, especially in contexts where traditional currencies are losing purchasing power due to inflation.
Remember, investing is not just about riding price waves; it's about understanding the underlying value. And that's precisely what this script helps us to uncover
(mab) Dynamic Bitcoin NVT SignalBitcoin`s NVT is calculated by dividing the Network Value (market cap) by the USD volume transmitted through the blockchain daily. Note this equivalent of the bitcoin token supply divided by the daily BTC value transmitted through the blockchain, NVT is technically inverse monetary velocity.
Credits go to Willy Woo for creating the Network Value Transaction Ratio (NVT). Credits go also to Dimitry Kalichkin improving NVT and creating the NVT Signal (NVTS).
According to its creator, the NVT Ratio is somewhat similar to the PE Ratio used in equity markets. When Bitcoin`s NVT is high, it indicates that its network valuation is outstripping the value being transmitted on its payment network, this can happen when the network is in high growth and investors are valuing it as a high return investment, or alternatively when the price is in an unsustainable bubble.
I created this indicator because the NVT indicator I was using suddenly stopped working. I tried a number of other NVT indicators, but all of them seem to have the same problem and stopped updating after a certain date. The cause is that the data feed from 'Quandl' that is used by most NVT indicators is no longer updated through the previous API.
Instead TradingView created a special API to access 'Quandl" data. This indicator not only uses the new API for 'Quandl', it can also access data from other providers like 'Glassnode', 'CoinMetrics' and 'IntoTheBlock'. However, the 'Quandl' data feed seems to produce the best results with this indicator.
The indicator provides dynamically adjusting overbought and oversold thresholds based on a two year moving average and standard devition with adjustable multipliers. It also implements alerts for NVT going into overbought, oversold or crossing the moving average.
Version 1.0
--
Version history
0.1 Beta
- Initial version
1.0
- First release
BTC/USD Inflation priced in! ~Period 2009 - 2023 (by TAS)The script creates a custom indicator titled "BTC Adjusted for Economic Factors.
Adjusted BTC Price is plotted in red, making it more prominent. The adjusted price is Bitcoin's historical closing prices adjusted for cumulative inflation over time, based on the Core Consumer Price Index (CPI) annual inflation rates from 2009 onwards.
The script calculates the adjusted price of Bitcoin by taking into account the effect of inflation on its value. It uses annual CPI rates for each year from 2009 to 2022 to calculate a cumulative inflation factor. The script assumes a placeholder inflation rate of 2.5% for 2023, indicating that this value should be updated when the actual rate is available. The script suggests adding CPI rates for additional years as they become available to maintain the accuracy of the adjustment.
Here's a breakdown of how the script works:
Core CPI Annual Inflation Rates: It starts by defining the annual inflation rates for each year from 2009 to 2022, expressed as a percentage divided by 100 to convert to a decimal.
Cumulative Inflation Calculation: The script calculates cumulative inflation starting from the year 2009 up to the current year. For each year that has passed since 2009, it multiplies the cumulative inflation factor by (1 + cpiRate), where cpiRate is the inflation rate for that year. This effectively compounds the inflation rate over time.
Adjusting Bitcoin's Price: The script then adjusts Bitcoin's closing price (close) for the calculated cumulative inflation to get the adjusted price (adjustedPrice).
Plotting the Prices: Finally, it plots both the original and the adjusted Bitcoin prices on the chart, allowing users to visually compare how inflation has theoretically impacted Bitcoin's value over time.
--------------------------------------------------------------------------------------------------
Important to notice, Fib. Retracements from the 2017 cycle top to the recent top (¬80K) doesn't look invalidated.
--------------------------------------------------------------------------------------------------
Inputs and feedback are welcome!
STABLECOINS DEPEG FINDERSTABLECOINS DEPEG FINDER
With this script, you will be able to understand how DePeg in stablecoins USDT, USDC, and FDUSD can influence the TOTAL Market Cap.
WHAT IS DEPEG?
DePeg occurs when a stablecoin loses its peg. It can't maintain the $1.00 price for a while (or anymore). Traders can use DePeg for high-quality trading both in Crypto and Stablecoins. Usually, a Negative DePeg (e.g., 0.98%) means you can buy Stablecoins at a 2% discount. This translates to a 2% gain when the Stablecoin returns to its peg. Additionally, a Positive DePeg could be a good moment for selling or withdrawal.
WHY DEPEG MATTERS IN THE CRYPTO SPACE
Depeg in Crypto markets is primarily a matter of "earning from small differences in peg." If well understood, it can help traders and analysts to spot whales' next moves. Usually, when a negative DePeg (below $1) occurs, it means whales are in a hurry to sell their Stablecoin tokens for Crypto Tokens. In this hurry, they sell Stablecoins at a discount. In the short term, a Crypto pump is likely planned, and they buy the next x100 token.
On the other hand, a positive DePeg (above $1) means whales are in a hurry to convert tokens into Stablecoins because they are heavily selling Crypto Tokens. This leads to them paying more for Stablecoins. Positive Depeg is more interesting than Negative DePeg. Usually, it signifies an important sell-off in the crypto environment, creating high tension to safeguard your hard-earned money. Whales hurry to convert altcoins and tokens into stablecoins, causing a Positive Depeg (they are willing to pay more to be safe). Positive DePeg is plotted as Intense Background Color.
Identifying 'areas' where this occurs could help traders and analysts understand this highly manipulative market better and take positions.
THE SCRIPT
This script will help traders and analysts understand when USDT, USDC, and FDUSD depegged and how the crypto market reacted. It comes with the possibility to check and plot backgrounds when there's Positive DePeg or Negative DePeg for USDT, USDC, or FDUSD.
It's pretty useful for data analysis. In the bottom-right part, you can check the actual stablecoin peg for the three Stablecoins:
- Highest Positive DePeg in a given BackTrace
- Average Positive DePeg in a given BackTrace
- Actual Peg for USDT, USDC, FDUSD
- Average Negative DePeg in a given BackTrace
- Lowest Negative DePeg in a given BackTrace
UNDERSTANDING THE BACKGROUND PLOT
NEGATIVE DEPEG
For each Stablecoin, negative DePeg is plotted as Translucent Background Color: USDT lime, USDC aqua, FDUSD grey. You can choose from settings whether it needs to be enabled or disabled for each token.
POSITIVE DEPEG
For each Stablecoin, positive DePeg is plotted as Intense Background Color: USDT lime, USDC aqua, FDUSD grey. You can choose from settings whether it needs to be enabled or disabled for each token.
USE CASE EXAMPLES
With this script you can plan to be alerted WHEN one of those stablecoin are depegging over a threesold. Than you can act accordingly.
BUY OPPORTUNITY
Let' suppose you want to see how USDC can influence Crypto Price when deppeged
I've setup signal to be plotted only for negative Depeg when USDC goes below 0.998. As you can see it was a very good and nice buy area for the entire crypto market
SELL OPPORTUNITY
Spot a selling point could be harder. In the example below let's see how USDC positive DePeg can show signal of Crypto dump earlier in daily TF
BitBell - EMA PullBack RSI EXO
🔵 Introduction
Version 1.1
This is a Pine 5 trend following strategy. It has a four strategy with several alerts and signals. The design intent is to produce a commercial grade signal generator that can be adapted to any symbol in cryptocurrency and only 1H Chart. Ideally, the script is reliable enough to be the basis of an automated trading system web-hooked to a server with API access to crypto brokerages. The strategy can be run in three different modes: long, short and bidirectional.
As a trend following strategy, the behavior of the script is to buy on strength and sell on weakness. As such the trade orders maintain its directional bias according to price pressure. What you will see on the chart is long positions on the left side of the mountain and short on the right. Long and short positions are not intermingled as long as there exists a detectable trend. This is extremely beneficial feature in long running bull or bear markets. The script uses multiple setups to avoid the situation where you got in on the trend, took a small profit but couldn’t get back in because the logic is waiting for a pullback or some other intricate condition.
Deep draw-downs are a characteristic of trend following systems and this system is no different. However, this script makes use of the TradingView pyramid feature with three NPUs to find better place and even you can change drop percentage in settings for another trigger, accessible from the properties tab.
When trend market break it will stop the trade and usually it takes 2-4 percent loss but don't worry it has prefect money management and you can use it for Futures market and even Spot market.
🔵 Design
This script uses twelve indicators on two time frames. The chart (primary) interval and one higher time frame which is based on the primary. The higher time frame identifies the trend for which the primary will trade. I’ve tried to keep the higher time frame around five times greater than the primary. The original trading algorithms are a port from a much larger program on another trading platform. I’ve converted some of the statistical functions to use standard indicators available on TradingView. The setups make heavy use of the Hull Moving Average in conjunction with EMAs that form the Bill Williams Alligator as described in his book “New Trading Dimensions” Chapter 3. Lag between the Hull and the EMAs form the basis of the entry and exit points. The alligator itself is used to identify the trend main body.
The entire script is around 740 lines of Pine code which is the maximum incidental size given the TradingView limits: local scopes, run-time duration and compile time. I’ve been working on this script for over a year and have tested it on various instruments stock crypto. It performs well on higher liquidity markets that have at least a year of historical data. Though it can be configured to work on any interval between 15 minutes and 4 hour, trend trading is generally a longer term paradigm. For day trading the 10 to 15 minute interval will allow you to catch momentum breakouts. For intraweek trades 30 minutes to 1 hour should give you a trade every other a day.
Inputs to the script use cone centric measurements in effort to avoid exposing adjustments to the various internal indicators. The goal was to keep the inputs relevant to the actual trade entry and exit locations as opposed to a series of MA input values and the like. As a result the strategy exposes over 12 inputs grouped into long or short sections. Inputs are available for the usual minimum profit and stop-loss as well as trade, modes, presets, reports and lots of calibrations. The inputs are numerous, I’m aware. Unfortunately, at this time, TradingView does not offer any other method to get data in the script. The usual initialization files such as cnf, cfg, ini, json and xml files are currently unsupported.
Example configurations for various instruments along with a detailed PDF user manual is available.
it has no repaint i guaranty this, and you can have 10 days free with comment and check it by yourself
One issue that comes up when comparing the strategy with the study is that the strategy trades show on the chart one bar later than the study. This problem is due to the fact that “strategy.entry()” and “strategy_close()” do not execute on the same bar called. The study, on the other hand, has no such limitation since there are no position routines. However, alerts that are subsequently fired off when triggered in the study are dispatched from the TradingView servers one bar later from the study plot. Therefore the alert you actually receive on your cell phone matches the strategy plot but is one bar later than the study plot.
Please be aware that the data source matters. Cryptocurrency has no central tick repository so each exchange supplies TradingView its feed. Even though it is the same symbol the quality of the data and subsequently the bars that are supplied to the chart varies with the exchange. This script will absolutely produce different results on different data feeds of the same symbol. Be sure to backtest this script on the same data you intend to receive alerts for. Any example settings I share with you will always have the exchange name used to generate the test results.
🟡 Usage
It sends long and short signals with pyramid orders of up to 3, meaning that the strategy can trigger up to 3 orders in the same direction. Good risk and money management.
It's important to note that the strategy combines 2 systems working together (Long and LongX). Let’s describe the specific features of this strategy.
🔵 If Findes Supports And Ressitances And Trend Lines As Best As It Can, And You Can See:
🟢 Frist Simple Long Condition = It Look At The Trend Wait For RSI Cross 30 Number Then Ckeck Risk To Reward, check something else such as divergence:
🟢 Another Long Example:
🔴 Frist Simple Short Condition = It Look At The Trend Wait For RSI Cross 70 Number Then Ckeck Risk To Reward, check something else such as divergence:
🔴 Another Short Example:
The following steps provide a very brief set of instructions that will get you started but will most certainly not produce the best backtest. A trading system that you are willing to risk your hard earned capital will require a well crafted configuration that involves time, expertise and clearly defined goals. As previously mentioned, I have several example configs that I use for my own trading that I can share with you along with a PDF which describes each input in detail. To get hands on experience in setting up your own symbol from scratch please follow the steps below.
The input dialog box contains over 12 inputs, There are four options must to be configured: Choose Target, side, Choose Settings, Money Management,and settings that apply to both. The following steps address these four main options only.
Money Management System For Leverage 10:
Bot Finds Last Lower Low And Calculate Distance From Entry Price, Then Cross It To Initial Capitan And Cross Leverage =>
Position_Size = (((1.64) * (initial Capital)) * (leverage))
And Check Dominances Too For Getting Best Money Management Result
🔵 Settings
* Side, You Can Set Long Or Short Or Both.
* Choose Target, You Can Set One Target Or All Targets.
* Money Management, You Can ON Or OFF It, With OFF You Can USE It For SPOT Trades.
* Choose Settings, In This Field You Can Set Mathematical Optimization, Ddepends On Which Pair You USE.
* Clear With Daily PullBack?, With This Check Box You Can Clear Signals With Daily PullBack.
* Long X, You Can Set Long Leverage.
* Short X, You Can Set Short Leverage.
* Second Order X, You Can Set Pyramiding Leverage.
* Target Long, You Can Set Percent For Long Target.
* Target Short, You Can Set Percent For Short Target.
* Short Martin Percent, You Can Set Short Martingale Percent.
* Long Martin Percent, You Can Set Long Martingale Percent.
🟡 Pyraming 3
🟡 Commission Is 0.065 %
🟡 Slippage Is 10 ticks
🔴Only Use For 1 Hour Chart
🔴 CONCLUSION
We believe that success lies in the association of the user with the indicator, opposed to many traders who have the perspective that the indicator itself can make them become profitable. The reality is much more complicated than that.
The aim is to provide an indicator comprehensive, customizable, and intuitive enough that any trader can be led to understand this truth and develop an actionable perspective of technical indicators as support tools for decision making.
🔴 RISK DISCLAIMER
Trading is risky & most day traders lose money. All content, tools, scripts, articles, & education provided by BitBell are purely for informational & educational purposes only. Past performance does not guarantee future results.
ATH Gain PotentialThe indicator quantifies the relative position of a symbol's current closing price in relation to its historical all-time high (ATH).
By evaluating the ratio between the ATH and the present closing price, it provides an analytical framework to estimate the potential gains that could accrue if the symbol were to revert to its ATH from a specified reference point. The ratio serves as a quantitative measure for assessing the distance between the current market value and the symbol's historical peak, enabling investors to gauge the prospective profitability of a return to the ATH.
MicroStrategy / Bitcoin Market Cap RatioThis indicator offers a unique analytical perspective by comparing the market capitalization of MicroStrategy (MSTR) with that of Bitcoin (BTC) . Designed for investors and analysts interested in the correlation between MicroStrategy's financial performance and the Bitcoin market, the script calculates and visualizes the ratio of MSTR's market capitalization to Bitcoin's market capitalization.
Key Features:
Start Date: The script considers data starting from July 28, 2020, aligning with MicroStrategy's initial announcement to invest in Bitcoin.
Data Sources: It retrieves real-time data for MSTR's total shares outstanding, MSTR's stock price, and BTC's market capitalization.
Market Cap Calculations: The script calculates MicroStrategy's market cap by multiplying its stock price with the total shares outstanding. It then forms a ratio of MSTR's market cap to BTC's market cap.
Bollinger Bands: To add a layer of analysis, the script includes Bollinger Bands around the ratio, with customizable parameters for length and multiplier. These bands can help identify overbought or oversold conditions in the relationship between MSTR's and BTC's market values.
The indicator plots the MSTR/BTC market cap ratio and the Bollinger Bands, providing a clear visual representation of the relationship between these two market values over time.
This indicator is ideal for users who are tracking the impact of Bitcoin's market movements on MicroStrategy's valuation or vice versa. It provides a novel way to visualize and analyze the interconnectedness of a leading cryptocurrency asset and a major corporate investor in the space.
BTC ETF Premium IndicatorThe "BTC ETF Premium Indicator" (BEPI) is a sophisticated tool designed for investors and traders who seek to analyze the performance of Bitcoin ETFs relative to the actual market price of Bitcoin. This indicator provides a comprehensive visualization of the premium or discount at which each ETF is trading compared to its Net Asset Value (NAV).
Functionality:
ETF Selection: Users can toggle the visibility of individual ETFs to customize their view, focusing on the ETFs most relevant to their trading or analysis strategies.
Premium Computation: BEPI calculates the premium of each selected ETF by comparing its market share price to its NAV, expressed as a percentage. A positive percentage indicates a premium, while a negative percentage suggests a discount.
Aggregate View: The indicator can plot an average premium based on the selection, providing a consolidated perspective of the overall market sentiment across the chosen ETFs.
Customizable Display: With the option to display only the average or individual ETF premiums, the BEPI offers flexibility in data presentation, ensuring that users can quickly glean the insights that matter most to them.
Visual Clarity: Premiums are visualized with color-coded columns, making it easy to distinguish between ETFs performing above or below their NAV. A zero baseline is included for reference, indicating no premium or discount.
Dynamic Labels: For real-time analysis, dynamic labels present the latest premium values for each ETF, ensuring users have up-to-date information at their fingertips.
Currently, BEPI supports Blackrock, ARK 21Shares, and Valkyrie ETFs, reflecting the most active segments of the market. As the landscape of Bitcoin ETFs evolves, there are plans to expand the indicator's capabilities to include a broader range of ETFs, enhancing its utility for a wider audience.
Whether you're looking for arbitrage opportunities, assessing ETF performance, or simply keeping an eye on the market, BEPI is the go-to indicator for a clear and concise overview of Bitcoin ETF premiums.
MVRV Z-ScoreThe MVRV ratio was created by Murad Mahmudov & David Puell. It simply compares Market Cap to Realised Cap, presenting a ratio (MVRV = Market Cap / Realised Cap). The MVRV Z-Score is a later version, refining the metric by normalising the peaks and troughs of the data.
BTC Halving [YinYangAlgorithms]This Indicator not only estimates what it thinks may be the PRICE for the Start, High and Low of the Halving, but likewise estimates WHEN the Start, High and Low of Halving may be. It then creates Trend Lines based on these predictions so that you may get an evaluation towards if the Price is currently Overbought or Oversold. These Trend Lines may be very useful for seeing the Slope in which the Price may move if it is to reach the estimated Price by the estimated Date. By evaluating the Prices location based on these Trend Lines we may determine if the Price is currently Overbought or Oversold.
These Trend Lines likewise may help identify locations of Support and Resistance. If the Price is much higher than its current Trend Line it is Overbought. There is a chance it will Consolidate back to the Trend Line or it may even correct with a dump all the way back to it; the opposite is true if it is much lower than its current Trend Line.
Trend Lines and Estimates are not all that is featured within this Indicator however. There are also Price Zones which may help identify if the price is currently:
Very Overbought (Red)
Slightly Overbought (Orange)
Neutral (Yellow)
Slightly Oversold (Teal)
Very Oversold (Green)
These zones may help give you an idea of how the price is currently fairing and its potential for movement. Likewise, it may help define where Support and Resistance may be found.
The trend line estimates are done with an algorithm created to evaluate the difference between price and % change that has occurred between the Start, High and Low of all the halvings over how many days between each data type. This may allow us to make an educated estimate towards what Price and Date the Start, High and Low will occur at.
Our Zones are created by evaluating the current Market Cap and circulating supply vs Max Supply of BTC. This may help give us an evaluation of what Price may be considered to be Overbought and Oversold; and likewise may help with estimations of where there may be Support and Resistance based on these Zones.
Tutorial:
In the example above we’re displaying the Halving Start Trend Line, our Information Tables and our Estimated Halving Vertical Marker. This Trend Line may help to display not only the trajectory and slope the Price needs to take to reach the Estimated Halving Price by the Estimated Halving Date; but it may also help to show if the price is Overvalued or Undervalued based on its position above or below this Trend Line.
Based on the Trajectory of the Estimated High Upward Trend Line (Green Line) in the photo above and from the ‘High Date’ estimated in the Information tables; we may attempt to estimate the location the ATH of this Bull Market will create and the price slope it may follow in doing so. This Trajectory may be very useful for understanding the price action that may occur for it to reach the High estimated Price by the High estimated Date.
We currently allow for two different types of zones within our Settings, one called ‘Fast’ displayed in the example above; and the other called ‘Slow’ displayed in the example below.
Our Fast Zone aims to move the Zone Levels Faster in an attempt to move with volatility and parabolic movement. This may help to keep the Very Overbought (Red) and Very OverSold (Green) Levels more accurate by attempting to keep the price within them. By doing so, we may aim to keep all of the Slightly Overbought, Slightly Oversold and Neutral Levels more accurate as well.
The Levels within these zones are defined by the Bright (less transparent) Lines. Whereas the Darker (more transparent) lines represent the Basis Lines between two different levels. These Basis lines may likewise act as a Support and Resistance Location too, but generally hold less weight than the actual Levels themselves.
What you may see is that during the Bull Market, the price is within the very Overbought Zones and even touches again the Very Overbought Level a few times. Likewise, during the Bear Market, the price is within the very Oversold Zones and even slightly drops below the Very Oversold Level. This may be expected and likewise may help to give estimates at potential for growth and decay within the Price based on which condition the Market is within.
Slow Zones move a little slower than Fast Zones, however they may still be accurate. Likewise, it is up to you to decide which Zone works better for your specific Trading Style; however, by default, the Zone type is set to Fast.
If you refer to both the Fast and Slow examples above, you may notice in the Fast the Price is only slightly above the ‘Slightly Oversold’ (Teal) line. Also, In the Fast, the Price where the ‘Very Overbought’ Level is 100k. This is one of the many reasons we’ve opted for ‘Fast’ as the default, and it is because it allows more room for movement; and in our opinion, potentially accuracy as well.
If you refer to the Slow example, you’ll see that the price is currently facing the Neutral Level as a Resistance location. However, if you refer to the price residing at the Slows ‘Very Overbought’ Level, it is only 81.5k, compared to the 100k of Fast.
The BTC Halving is a major event that takes place roughly every 4 years. It historically has a major impact on the market, and some may even say it signifies the Start, or close to start of the Bull Market. Therefore, since historically there may be cycles that BTC and potentially crypto itself follows, we’ve developed this Indicator in hopes that it may solve one of the biggest questions traders face. What Date will the Start, High and Low of the Halving occur and also at what Price.
Hopefully this Tutorial has given you some guidance as to how this Indicator may be used to help identify some of these key levels; including the slope at which the price may have to move if it is to reach its projection Price by its projected Date.
Settings:
1. Show Prediction Trend Lines:
- Options:
All
Start + High
Start + Low
High + Low
Start
High
Low
None
- Description:
Prediction Trend Lines may be an important way to see the Slope the Price needs to take to reach the Predicted Price by the Predicted Date. This may be useful for identifying if the Price is currently Overbought or Oversold.
2. Zone Type:
- Options:
Fast
Slow
- Description:
Zone types change the way the Zones expand.
3. Show Zones:
- Options:
All
Zones
Basis
None
- Description:
Zones are a way of seeing Overbought and Oversold Price locations based on Market Cap and Circulating Supply vs Max Supply.
4. Vertical Markers:
- Options:
All
Line
Label
None
- Description:
Vertical Markers display where the Halving has occurred with a Vertical Line and Label.
5. Show Tables:
Tables may be useful for seeing the Price and Date for when the Start, High and Low of the Halving may occur.
6. Fill Zones:
Filling in Zones may help to identify which Zone the Price is currently in.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
USDT+USDC+BUSD Market CapThis Pine Script indicator visualizes the combined market capitalization of three prominent stablecoins: USDT, USDC, and BUSD, on a daily basis.
It fetches the daily closing market caps of these stablecoins and sums them. The resulting line graph is displayed in its own separate pane below the main price chart.
The line is color-coded: green on days when the market cap is increasing compared to the previous day, and red when it's decreasing.
High/Low of week: Stats & Day of Week tendencies// Purpose:
-To show High of Week (HoW) day and Low of week (LoW) day frequencies/percentages for an asset.
-To further analyze Day of Week (DoW) tendencies based on averaged data from all various custom weeks. Giving a more reliable measure of DoW tendencies ('Meta Averages').
-To backtest day-of-week tendencies: across all asset history or across custom user input periods (i.e. consolidation vs trending periods).
-Education: to see how how data from a 'hard-defined-week' may be misleading when seeking statistical evidence of DoW tendencies.
// Notes & Tips:
-Only designed for use on DAILY timeframe.
-Verification table is to make sure HoW / LoW DAY (referencing previous finished week) is printing correctly and therefore the stats table is populating correctly.
-Generally, leaving Timezone input set to "America/New_York" is best, regardless of your asset or your chart timezone. But if misaligned by 1 day =>> tweak this timezone input to correct
-If you want to use manual backtesting period (e.g. for testing consolidation periods vs trending periods): toggle these settings on, then click the indicator display line three dots >> 'Reset Points' to quickly set start & end dates.
// On custom week start days:
-For assets like BTC which trade 7 days a week, this is quite simple. Pick custom start day, use verification table to check all is well. See the start week day & time in said verification table.
-For traditional assets like S&P which trade only 5 days a week and suffer from occasional Holidays, this is a bit more complicated. If the custom start day input is a bank holiday, its custom 'week' will be discounted from the data set. E.g.1: if you choose 'use custom start day' and set it to Monday, then bank holiday Monday weeks will be discounted from the data set. E.g.2: If you choose 'use custom start day' and set it to Thursday, then the Holiday Thursday custom week (e.g Thanksgiving Thursday >> following Weds) would be discounted from the data set.
// On 'Meta Averages':
-The idea is to try and mitigate out the 'continuation bias' that comes from having a fixed week start/end time: i.e. sometimes a market is trending through the week start/end time, so the start/end day stats are over-weighted if one is trying to tease out typical weekly profile tendencies or typical DoW tendencies. You'll notice this if you compare the stats with various custom start days ('bookend' start/end days are always more heavily weighted). I wanted to try to mitigate out this 'bias' by cycling through all the possible new week start/end days and taking an average of the results. i.e. on BTC/USD the 'meta average' for Tuesday would be the average of the Tuesday HoW frequencies from the set of all 7 possible custom weeks(Mon-Sun, Tues-Mon, Weds-Tues, etc etc).
// User Inputs:
~Week Start:
-use custom week start day (default toggled OFF); Choose custom week start day
-show Meta Averages (default toggled ON)
~Verification Table:
-show table, show new week lines, number of new week lines to show
-table formatting options (position, color, size)
-timezone (only for tweaking if printed DoW is misaligned by 1 day)
~Statistics Table:
-show table, table formatting options (position, color, size)
~Manual Backtesting:
-Use start date (default toggled OFF), choose start date, choose vline color
-Use end date (defautl toggled OFF), choose end date, choose vline color
// Demo charts:
NQ1! (Nasdaq), Full History, Traditional week (Mon>>Friday) stats. And Meta Averages. Annotations in purple:
NQ1! (Nasdaq), Full History, Custom week (custom start day = Wednesday). And Meta Averages. Annotations in purple:
Quantitative Trend Strategy- Uptrend longTrend Strategy #1
Indicators:
1. SMA
2. Pivot high/low functions derived from SMA
3. Step lines to plot support and resistance based on the pivot points
4. If the close is over the resistance line, green arrows plot above, and vice versa for red arrows below support.
Strategy:
1. Long Only
2. Mutable 2% TP/1.5% SL
3. 0.01% commission
4. When the close is greater than the pivot point of the sma pivot high, and the close is greater than the resistance step line, a long position is opened.
*At times, the 2% take profit may not trigger IF; the conditions for reentry are met at the time of candle closure + no exit conditions have been triggered.
5. If the position is in the green and the support step line crosses over the resistance step line, positions are exited.
How to use it and what makes it unique:
Use this strategy to trade an up-trending market using a simple moving average to determine the trend. This strategy is meant to capture a good risk/reward in a bullish market while staying active in an appropriate fashion. This strategy is unique due to it's inclusion of the step line function with statistics derived from myself.
This description tells the indicators combined to create a new strategy, with commissions and take profit/stop loss conditions included, and the process of strategy execution with a description on how to use it. If you have any questions feel free to PM me and boost if you enjoyed it. Thank you, pineUSERS!
TTP NVT StudioNVT Studio is an indicator that aims to find areas of reversal of the Bitcoin price based on the extreme areas of Network Value Transaction.
Instructions:
- We recommend using it on INDEX:BTCUSD
- Use the daily or weekly timeframe
The indicator works as an oscillator and offers to visualisation modes.
1) Showing the short term oscillations of NVT showing signals in potential areas of reversal.
2) The actual value of NVT displayed. When in green is an area of value and in red when its overextended.
This indicator can be used based on the signals or based on breakouts of trend lines drawn in the oscillator mode.
Red/green dots: signal type 1 - extremes with confirmation, these might trigger late
Yellow/Orange: signal type 2 - extremes without confirmation, might trigger too soon
TTP Breaking PointThis signal uses information from BITFINEX:BTCUSDLONGS and BITFINEX:BTCUSDSHORTS to forecast tops and bottoms.
The idea behind is very simple.
We calculate the RSI of the ratio of longs vs shorts and find areas where both the SMA of this RSI and the RSI itself are overextended.
You might notice that the win rate is not high but most of the wins provide a decent move that, if combined with proper risk management, can be used to build profitable strategies.
The signal offers a backtesting stream: 1 for buy and 2 for sell.
Shortly I'll be adding new features including: alerts, support for other symbols, filters, etc.
Fierytrading: Volatility DepthDear Tradingview community,
I'd like to share one of my staple indicators with you. The volatility depth indicator calculates the volatility over a 7-day period and plots it on your chart.
This indicator only works for the DAILY chart on BTC/USD.
Colors
I've color coded the indicator as follows:
- Red: Extreme Volatility
- Orange: High Volatility
- Yellow: Normal Volatility
- Green: Low Volatility
Red: extreme changes in price. Often during local tops and bottoms.
Orange: higher than average moves in price. Often before or after a "red" period. Often seen in the middle of bear or bull markets.
Yellow: normal price action. Often seen during early stage bull-markets and late stage bear-markets.
Green: very low price movement. Often during times of indecision. Once this indicator becomes green, you can expect a big move in either direction. Low volatility is always followed by high volatility.
In a long-term uptrend, a green period often signals a bullish break out. In a long-term downtrend it often signals a bearish break out.
How to use
Save the indicator and apply it to your chart. You can change the length in the settings, but it's optimized for 7 days, so no need to change it.
I've build in alerts for all 4 different volatility periods. In most cases, the low volatility alert is enough.
Good luck!