Momentum Burst Tools Kit By TradeINskiMomentum Burst Tools Kit By TradeINski
First Things First
- This indicator cuts through the noise and helps you see if a stock's price is swinging more (expansion) or less (contraction) compared to yesterday. When the indicator shows a positive number, it means the stock's price range is wider today than yesterday. Conversely, a negative number indicates the price range is tighter today. And also helps in position sizing with fast and effective solutions.
- Disclaimer: This indicator will not give any buy or sell signal. This is just a supporting tool to improve efficiency in my trading.
- Users can change most of the default options in settings according to their personal preference in settings such as text color, size and table location or to show/hide the specific metrics using “check mark”.
Contents
Capital
- Capital is nothing but account size by default it is 1M.
- This will be helpful by knowing where exactly their account is standing at what value at any given point of time.
- This is also required to calculate quantity based metrics so users should input accordingly.
Risk (%)
- Percentage of risk per trade you are willing to take according to account size or capital.
This helps in knowing what kind of position sizing you're about to take for the following trade. Knowing what is at stake and how much is at stake.
- This is also required to calculate quantity based metrics so users should input according to their trading plan.
Closing Range (CloseR)
- % Level based on current price with respect to today's range.
- Higher the better, Which indicates strength.
Range Expansion (RangeE)
- Today's % range with respect to previous days range. That is nothing but a percentage indicating the change in the daily price range compared to the previous day. Useful for identifying potential volatility shifts and trend continuation or reversal.
- For example if yesterday's range was small and today's range is big that means with respect to yesterday today stock had a range expansion by how much is the value shown here irrespective of the direction. Which helps in breakout scenarios.
SL From LOD/HOD (StopL)
- Here LOD means low of the day and HOD means high of the day.
When %Change is +VE then its low of the day (LOD) value is printed and when %Change is -VE then its high of the day (HOD).
- Because LOD and HOD are important levels where we usually keep our stops as per direction we are trading in. LOD is considered for longs and HOD for shorts as per % change.
SL at Half of day (StopH)
- Half level of today's body is what is printed.
- This helps to know where exactly half of today’s price level is at. Sometimes this can be used as stop loss. That is the Price level representing the midpoint between the day's open and close, commonly used as a reference for setting stop-loss orders.
% Distance From StopL (DisL)
- This will tell us how far we are from LOD/HOD in terms of percentage.
- And Whenever %Change is +VE then LOD is considered for distance and whenever %Change is -VE then HOD is considered. This switch over is done automatically.
- This helps traders to make a decision to conclude whether to make a position or not, Which also helps in determining if the risk reward is favorable hypothetically considering entry at current price and SL as StopL LOD/HOD.
% Distance From StopH (DisH)
- This will tell us how far we are from half price of today's body in terms of percentage.
- This is the distance between current close and price level representing the midpoint between the day's open and close.
- This also helps in determining if the risk reward is favorable hypothetically considering entry at current price and SL as StopH.
Quantity Based on StopL (QtyL)
- Quantity shown here is based on Capital, Risk and considering latest price as entry point and also low of the day (LOD) as stop loss (SL) that is “StopL” as and When %Change is positive and whenever %Change is -VE then high of the day (HOD) is considered as stop loss (SL).
- When %Change is +VE then Capital multiplied Risk (%) divided by close minus today's low this will fetch you desired quantity based on defined capital and risk (%) earlier. Similarly when %Change is -VE instead of close minus low, today’s high minus close is considered for determining the quantity.
- This is printed in real time and switchover is done automatically between high and low based on %Change. A result of which Position SIze calculation is done is a jiffy.
Quantity Based on StopH (QtyL)
- Quantity shown here is based on Capital, Risk which are defined earlier and considering latest price as entry point and also half of the day (StopH) )as stop loss (SL). A result of which Position SIze calculation is done is a jiffy.
This script empowers traders by giving them a clear view of daily price changes. With this knowledge, they can make smarter trading choices based on important price movements. Plus, it can be customized to fit how you like to trade, making it user-friendly and adaptable to different trading styles.
*****
Utiliti Pine
Checklist By TradeINskiChecklist By TradeINski
First Things First
This indicator is a supporting tool for trading momentum burst that is 2 Lynch setup by stock bee aka Pradeep Bonde.
Disclaimer: This indicator will not give any buy or sell signal. This is just a supporting tool to improve efficiency in my trading.
Apply Indicators and then open indicator settings and read the following simultaneously to understand better.
Default color settings are best suited for light themes. Which is also my personal preference.
Users can change most of the default options in settings according to their personal preference in settings.
When we open settings we can see 3 tabs that are {Inputs tab} {Style tab} {Visibility tab} each tab have its own options, Understand and use it accordingly.
Indicator will be only visible in the Daily time frame as its primary TF is daily. In the lower time frame nothing is plotted.
An indicator is plotted on an existing plane and overlaid on the existing plane.
Contents
My Checklist Lynch
Table Header Settings
Position
Size
Text Color
Background Color
“ON/OFF” Header “Text Box” “Info”
Table Content
Text Color
Background Color
“ON/OFF” R (1 - 10) “Text Box” T (1 - 10) “Text Box”
My Checklist - 2Lynch
This is the checklist I use while placing the trade just to make use of not missing anything based on predefined rules of the setup I trade.
2 - The stock should not be Up more than 2 days in a row, Minor movement can be acceptable.
L - The stock price movement should be linear, validation of established momentum
Y - Young trend in preference 1 - 3rd breakout from base
N - Narrow Range or -ve day before breakout
C - Consolidation should be narrow, linear and low volume. No more than one 4% breakdown.
H - The candle should close near high or at least 20% within when entered.
Table Headers Settings
Position - “Drop Down” with 9 different options which are self explanatory. Users can change the position of the table as per their preference.
Size - “Drop Down” with 6 different options which are self explanatory. Users can change the size of all the text printed in the table as per their preference.
Text Color - “Default Color is White” This setting is specifically only for header text. And users can change the text color of the header as per their preference.
Background Color - “Default Color is Blue” This setting is specifically only for header
background color. Users can change the background color of the header as per their preference.
“ON/OFF” Header “Text Box” “Info”
“Check Mark” - To show or hide the header that is “ON/OFF”.
“Header” - Heading of the table.
“Text Box” - Users can input as per their preference.
“Info” - Info symbol that shows short form and important note that is (Max 50 characteristics for all text boxes) .
Table Content
Text Color - “Default Color is White” This setting is specifically for table texts. And users can change the text color of the all content table texts as per their preference.
Background Color - “Default Color is black” This setting is specifically for content table texts background color. Users can change the background color of the header as per their preference.
“ON/OFF” R (1 - 10) “Text Box” T (1 - 10) “Text Box”
“Check Mark” - To show or hide the complete Row. Users have options and can change as per their preferences.
R (1-10) - “R” stands for Row and (1-10) is Number of rows available for users to enter text. Users have 10 different options.
“Text Box” - Place to enter text that users want to print on column 1 of the table.
T (1-10) - “T” stands for table and (1-10) is Number of text boxes available for users to enter text. Users have 10 different options.
“Text Box” - Place to enter text that users want to print on column 2 of the table.
Tic Tac Toe Game [TradeDots]Feeling bored with trading?
Time to inject some fun into your decision-making process with our Tic Tac Toe Indicator!
The Tic Tac Toe game transforms your chart into a competitive playground where trading pairs face off in a classic game of Tic Tac Toe.
HOW TO PLAY
Our Tic Tac Toe game invites you to pit one trading pair against another directly on your chart. Choose the competitors and watch as they battle it out in a traditional grid setup.
Navigate to settings and select your competitor pair.
Choose who kicks off the game.
After the close of each new bar, the algorithm will utilize the closing prices of both symbols. These numbers feed into a random number generator which alternates the turns for placing marks on the grid.
The game progresses until one pair aligns three consecutive symbols and wins, or the board fills up. After that, the game resets every three bars, offering continual engagement during active market hours.
MANUAL PLAYING MODE
Currently, due to PineScript's limitations, a fully interactive manual mode is not supported, as all previous data will be lost with each new user input, preventing the replication of existing game states.
However, users can input a sequence at the start, guiding the placement of symbols throughout the game.
Stay tuned for future updates!
Watermark, Date, Symbol & Timeframe [ANR Trades]" Watermark, Date, Symbol & Timeframe " is a simple yet powerful TradingView indicator designed to provide essential information directly on your trading charts.
Key Features:
- Add a watermark with a title and subtitle to your charts. Customize the position, colour, and size to suit your preferences.
- View the current date, symbol, and timeframe directly on your chart.
This indicator is essential for traders who frequently save or share their chart images publicly who would want to watermark their chart as well as make it easier to know when it was, what symbol and what timeframe it was on.
date & symbolHey y'all
If you are like me and you keep a record of your performance, adding date and symbol information will surely help you.
You can choose English or Spanish, and also choose between full or abbreviated date. If you want to see the day and if you want to see the symbol.
You can customize position, text size, text color, background.
Trend Fusion: ADX&EMA+IchimokuTrend Fusion: ADX & EMA+Ichimoku is an innovative indicator designed to provide traders with comprehensive insights into market trends. Combining the power of the Average Directional Index (ADX) with Exponential Moving Averages (EMA) and the Ichimoku Cloud, this indicator offers a sophisticated approach to trend analysis.
This indicator stands out for its unique integration of multiple trend-following indicators, offering traders a holistic view of market dynamics. Unlike traditional trend indicators that focus solely on price movements, Trend Fusion incorporates the ADX, EMA, and Ichimoku Cloud to provide a more nuanced understanding of trend strength and direction. By combining these indicators, traders can make more informed decisions and enhance their trading strategies.
How it works:
Trend Fusion generates buy and sell signals based on the convergence of these indicators. A combination of strong ADX readings, EMA crossovers, and alignment with the Ichimoku Cloud confirms trend direction and provides entry and exit points for traders.
Average Directional Index (ADX): Measures the strength of the prevailing trend by analyzing price movements. A rising ADX indicates a strengthening trend, while a falling ADX suggests weakening momentum.
Exponential Moving Averages (EMA): Detects potential trend reversals through crossover signals. A bullish crossover (fast EMA crossing above slow EMA) suggests an uptrend, while a bearish crossover indicates a downtrend.
Ichimoku Cloud: Provides support and resistance levels along with trend direction. Price movements above the cloud indicate bullish sentiment, while movements below the cloud suggest bearish sentiment.
How to use
Colour codes:
Green Candles: Represent a strong uptrend, indicating robust buying momentum. The intensity of green color deepens with increasing trend strength.
Red Candles: Indicate a strong downtrend, signaling significant selling pressure in the market. The intensity of red color deepens with increasing trend strength.
Yellow Candles: Suggest a weak trend, characterized by indecision and lack of clear direction. The intensity of yellow color varies based on the strength of the trend, with lighter shades indicating weaker trends and darker shades suggesting slightly stronger trends.
Trend Strength: Monitor the ADX to gauge the strength of the prevailing trend. Higher ADX values indicate stronger trends, while lower values suggest weaker trends.
Trend Direction: Confirm trend direction using EMA crossovers and Ichimoku Cloud signals. Look for bullish crossovers and price movements above the cloud for uptrends, and bearish crossovers and movements below the cloud for downtrends.
Entry and Exit Signals: Enter trades when all components align, signaling a strong trend. Use EMA crossovers and cloud confirmations to identify potential entry points, and consider exiting trades when these signals reverse.
The ADX calculation and signal logic are based on the ADX script by PineCoders, with modifications to integrate it into this indicator.
The EMA crossover logic is adapted from the GDAX EMA Cross script by stefano98.
The Ichimoku Cloud calculation and plotting are adapted from the Ichimoku Cloud script by lonesometheblue.
Trading involves risk, and past performance is not indicative of future results. It is recommended to use this indicator alongside other technical analysis tools and risk management strategies.
Futures Risk CalculatorThe "Futures Risk Calculator" is designed to assist traders in calculating the number of contracts to risk based on their account size, risk percentage, and stop loss level. This script provides a convenient way for traders to determine their position size in futures or other instruments where contracts are used.
The script prompts users to input their account size, risk percentage, entry price, and stop loss price. It then calculates the stop size in points, risk in dollars, and the number of contracts to risk. These calculations are based on standard risk management principles commonly used in trading.
The script plots the entry and stop loss lines on the chart for visual reference. Additionally, it displays a label in the top-right corner of the chart, showing the calculated number of contracts to risk. The label updates dynamically as the input values or market conditions change.
Originality and Usefulness:
This script is original and adds value to the TradingView community by providing traders with a practical tool for managing risk in their trading strategies. It is focusing on risk management, an essential aspect of successful trading.
By automating the calculation process, the script saves traders time and reduces the potential for manual errors. It encourages traders to adopt disciplined risk management practices, which are crucial for long-term profitability and capital preservation.
How to Use:
Input your account size, risk percentage, entry price, and stop loss price in the script settings.
Enter the pip size according to the instrument you are using (by default its's based for NASDAQ)
The script will automatically calculate the number of contracts to risk based on the provided inputs.
The entry and stop loss lines will be plotted on the chart for visual reference.
The calculated number of contracts to risk will be displayed in the top-right corner of the chart.
By following these steps, traders can effectively manage their risk exposure and make informed decisions when entering trades.
Speedometer RevisitedSpeedometer Revisited is a new way to draw custom metric speedometers and is intended to be a utility for other coders to use.
@rumpypumpydumpy originally introduced the Speedometer Toolkit in version 4 of Pine Script. Since then, Pine Script has been updated to version 5, introducing some amazing new features such as polylines and chart.points. This indicator is an example of what can be done with these newer features.
The indicator starts off with a handful of functions that will be used to create the drawings. Notes are left throughout the code explaining what each line of the functions does. My goal was to make these functions user-friendly and somewhat easy to understand. I then demonstrate two examples: one speedometer with five segments and another with three.
The first example demonstrates how to visually represent the analysts' ratings for a stock using the built-in syminfo.recommendations. The speedometer is divided into five segments, each representing a different level of analyst recommendation: strong sell, sell, hold, buy, and strong buy.
Each segment is drawn using a polyline from the createSeg function, with colors assigned as follows:
Red for 'Strong Sell'
Maroon for 'Sell'
Yellow for 'Hold'
Green for 'Buy'
Lime for 'Strong Buy'
The script identifies the maximum value among the analyst ratings, calculates the midpoint of the corresponding segment, and draws a needle pointing to this midpoint.
The second example employs the speedometer design to display market sentiment through the put-call ratio. The put-call ratio is a gauge of investor sentiment, where values above 1 indicate a bearish sentiment (more puts being bought relative to calls), and values below 1 suggest a bullish outlook (more calls being bought relative to puts).
The speedometer is divided into three segments, reflecting different ranges of the put-call ratio:
Red for a ratio greater than 1 (bearish sentiment)
Yellow for a ratio between 0.8 and 1 (neutral to bearish sentiment)
Lime for a ratio less than 0.8 (bullish sentiment)
Depending on the value of the put-call ratio, the script calculates which segment the current value falls into and determines the appropriate segment number. The script calculates the midpoint of the selected segment and draws a needle pointing to this value.
Both examples show how the speedometer can be used as a visual indicator of certain market conditions, helping traders quickly recognize trends and adjust their strategies accordingly.
A big thanks to @rumpypumpydumpy for his original Speedometer Toolbox. I hope this take on it can be useful for other coders.
Divergence Scaner 3D Dynamic_tHello MY friend
divergence scanner 3D dynamic
It is a dynamic 3D scanner for identifying positive and negative divergences in 10 indicators.
This indicator can identify the types of Regular_Hidden_Exaggerated divergences for bullish and bearish states in the following indicators.
(MACD_L, MACD_H, RSI, Stochastic, Volume, CCI, MFI, Momentum, OBV, ADX)
This indicator is able to identify the mentioned divergences in the desired price source and in the desired settings for each indicator.
This can be done in up to 3 scans with different sensitivities at the same time. Therefore, the chances of identifying different price points are increased.
Also, the price point for each scan is determined and drawn separately.
This is a dynamic indicator.
That is, the divergence is not misdiagnosed at any moment, and it expresses the presence or absence of divergence for each indicator, and at the first moment of divergence in each sweep, it informs the user of its existence. And if the divergence disappears at the first instant, the label text is corrected.
That is why we say it is dynamic.
This indicator can calculate and identify the divergence with the percentage of allowed deviation both in the price and in the indicator if the user needs.
This indicator has an alert function to inform about the formation of divergence in one scan with desired settings for all divergence modes and for all 10 indicators.
This indicator can label the last 5 divergences for positive and negative divergences and for all three scans. Also display the Fibonacci level for the last divergence.
According to your needs, you can activate only a number of scans that you want or activate only a number of indicators that you want.
The logic of calculation and identification of divergence in the indicator:
As you know, divergences are more valid if they occur between two consecutive peaks and valleys.
In this indicator, three scans are considered, and the user can identify tiny and small pivots according to his needs and strategy by entering different degrees of sensitivity for each scan.
The indicator identifies the desired divergences for 2 consecutive valleys and 2 consecutive peaks in each scan separately and displays them to the user.
Important note:
This indicator is not limited to identifying the indicator points only in line with the price points, that is, the price points and the indicator may not be in the same line.
The higher the sensitivity of your scan, the smaller waves will be detected, and the lower the selection number, the larger waves will be detected.
By enabling pints you can see detected pivots and also by enabling Fibonacci you can see the value of the Fibonacci number for the last detected divergence.
You can see the deviations with the allowed deviation rate if needed and You can also get midpoint error and midline error.(More details are given in the clip.)
This indicator can be customized according to your needs and will identify the divergences of your choice for active scans.
For better display in label printing, the indicator tries to print the output of all active scans in one label, provided that the label printing location is the same.
Note that divergence label printing is done only with the lowest and highest price.
However, drawing the divergence line and printing the point labels depends on the price source you select in each scan.
You can see the scan number written in front of the marker name on the printed label to identify which scan this divergence is for.
Also, before the name of the indicator, an abbreviation related to the type of divergence is also written so that you can understand the type of divergence. For example, H stands for HD divergence.
It is better to consider a color for each scan so that it remains easily in your mind and you can easily recognize the points of each scan.
It is better to adjust the detection sensitivity in scans so that small and large spots are detected simultaneously to increase the performance of the marker.
last word :
Due to the capability of three simultaneous scans as well as dynamics at any moment, we think that the error in detecting the divergence in this indicator is below 1% and also the error in finding the divergence is below 3%. Also, the chances of identifying different price points are increased.
This can be said. It is a very good implementation. You can experience it in back test and forward test.
I tried to show you the full explanation with details in the form of a few clips. You can refer to my YouTube channel for a better introduction of the indicator and to know how to set the settings correctly.
Be careful to experience better execution speed ,Run the indicator when the market is open.
thank you
Candlestick Patterns detection and backtester [TrendX_]INTRODUCTION:
The Candlestick Patterns detection and backtester is designed to empower traders by identifying and analyzing candlestick patterns. Leveraging the robust Pine Script's add-in “All Candlestick Patterns”, this indicator meticulously scans the market for candlestick formations, offering insights into potential market movements. With its backtesting capabilities, we evaluate historical data to present traders with performance metrics such as win rates, net profit, and profit factors for each pattern. This allows traders to make informed decisions based on empirical evidence. The customizable settings, including trend filters and exit conditions, provide a tailored experience, adapting to various trading styles and strategies.
CREDIT:
This indicator is powered by the Pinescript add-in, *All Candlestick Patterns*, which provides a comprehensive library of candlestick formations.
TABLE USAGE:
The indicator features a detailed usage table that presents backtested results of all candlestick patterns. This includes:
Win Rates: The percentage of trades that resulted in a profit.
Net Profit: The total profit after subtracting losses from gains.
Profit Factor: A measure of the indicator’s profitability (gross profit / gross loss).
Total Trades: The total number of trades taken for every candlestick pattern's appearance.
CHART CANDLESTICK USAGE:
The indicator integrates candlestick pattern detections directly into the chart, displaying:
Pattern Detections: Each detected pattern is marked on the chart.
Win Rates: The win rate of each pattern is shown in brackets next to the detection.
CHART SETTINGS:
Users can customize the indicator with a variety of trend filters and settings:
Trend Filters: Apply filters based on SMA50, SMA200, Supertrend, and RSI threshold to refine pattern detections.
Exit Condition: Set an exit condition based on the crossing of a simple moving average of customizable length.
Visibility: Choose to show or hide the candlestick patterns’ detections on the chart.
RSI EMA WMA (hieuhn)Indicator: RSI & EMA & WMA (14-9-45)
This indicator, named "RSI & EMA & WMA", is a versatile tool designed to provide insights into market momentum and trend strength by combining multiple technical indicators.
The Relative Strength Index (RSI) is a popular momentum oscillator used to measure the speed and change of price movements. In this indicator, RSI is plotted alongside its Exponential Moving Average (EMA) and Weighted Moving Average (WMA). EMA and WMA are smoothing techniques applied to RSI to help identify trends more clearly.
Key features of this indicator include:
RSI: The main RSI line is plotted on the chart, offering insights into overbought and oversold conditions.
EMA of RSI: The Exponential Moving Average of RSI smooths out short-term fluctuations, aiding in trend identification.
WMA of RSI: The Weighted Moving Average of RSI gives more weight to recent data points, providing a faster response to price changes.
Additionally, this indicator marks specific RSI levels considered as bullish and bearish trends, helping traders identify potential entry or exit points based on market sentiment.
By combining these technical indicators, traders can gain a comprehensive understanding of market dynamics, helping them make more informed trading decisions.
Futures Tick and Point Value TableDisplays a table in the upper right corner of the chart showing the tick and point value in USD.
Prepare Targets, Stop Loss, Position Size and calculate PnL You are watching the price action of your favorite coin. Then the price changes quickly and you know you could start a good trade now.
But how much should you buy, where should you set your Target for Profit Taking and your Stop Loss? How much money do you want to risk, how much money would you win if the trade is succesfull?
This indicator helps you to set up your trade in a quick way, no need to do some calculations by hand.
How does it work?
Just enter the prices where you want to take Profit and where your Stopp Loss should be.
Enter the number of coins and wether you buy or sell/go long or short.
These targets are then shown in the chart, move them around to see if your stopp loss is positioned well. See directly what your profit or loss would be.
See some Screenshots with more explanations for what is possible and how to set up everything.
General Overview:
How to set up the Trade:
Formatting and Extras:
Let me know if you like it!
Murrey Math
The Murrey Math indicator is a set of horizontal price levels, calculated from an algorithm developed by stock trader T.J. Murray.
The main concept behind Murrey Math is that prices tend to react and rotate at specific price levels. These levels are calculated by dividing the price range into fixed segments called "ranges", usually using a number of 8, 16, 32, 64, 128 or 256.
Murrey Math levels are calculated as follows:
1. A particular price range is taken, for example, 128.
2. Divide the current price by the range (128 in this example).
3. The result is rounded to the nearest whole number.
4. Multiply that whole number by the original range (128).
This results in the Murrey Math level closest to the current price. More Murrey levels are calculated and drawn by adding and subtracting multiples of the range to the initially calculated level.
Traders use Murrey Math levels as areas of possible support and resistance as it is believed that prices tend to react and pivot at these levels. They are also used to identify price patterns and possible entry and exit points in trading.
The Murrey Math indicator itself simply calculates and draws these horizontal levels on the price chart, allowing traders to easily visualize them and use them in their technical analysis.
HOW TO USE THIS INDICATOR?
To use the Murrey Math indicator effectively, here are some tips:
1. Choose the appropriate Murrey Math range : The Murrey Math range input (128 by default in the provided code) determines the spacing between the levels. Common ranges used are 8, 16, 32, 64, 128, and 256. A smaller range will give you more levels, while a larger range will give you fewer levels. Choose a range that suits the volatility and trading timeframe you're working with.
2. Identify potential support and resistance levels: The horizontal lines drawn by the indicator represent potential support and resistance levels based on the Murrey Math calculation. Prices often react or reverse at these levels, so they can be used to spot areas of interest for entries and exits.
3. Look for price reactions at the levels: Watch for price action like rejections, bounces, or breakouts at the Murrey Math levels. These reactions can signal potential trend continuation or reversal setups.
4. Trail stop-loss orders: You can place stop-loss orders just below/above the nearest Murrey Math level to manage risk if the price moves against your trade.
5. Set targets at future levels: Project potential profit targets by looking at upcoming Murrey Math levels in the direction of the trend.
7. Adjust range as needed: If prices are consistently breaking through levels without reacting, try adjusting the range input to a different value to see if it provides better levels.
In which asset can this indicator perform better?
The Murrey Math indicator can potentially perform well on any liquid financial asset that exhibits some degree of mean-reversion or trading range behavior. However, it may be more suitable for certain asset classes or trading timeframes than others.
Here are some assets and scenarios where the Murrey Math indicator can potentially perform better:
1. Forex Markets: The foreign exchange market is known for its ranging and mean-reverting nature, especially on higher timeframes like the daily or weekly charts. The Murrey Math levels can help identify potential support and resistance levels within these trading ranges.
2. Futures Markets: Futures contracts, such as those for commodities (e.g., crude oil, gold, etc.) or equity indices, often exhibit trading ranges and mean-reversion trends. The Murrey Math indicator can be useful in identifying potential turning points within these ranges.
3. Stocks with Range-bound Behavior: Some stocks, particularly those of large-cap companies, can trade within well-defined ranges for extended periods. The Murrey Math levels can help identify the boundaries of these ranges and potential reversal points.
4. I ntraday Trading: The Murrey Math indicator may be more effective on lower timeframes (e.g., 1-hour, 30-minute, 15-minute) for intraday trading, as prices tend to respect support and resistance levels more closely within shorter time periods.
5. Trending Markets: While the Murrey Math indicator is primarily designed for range-bound markets, it can also be used in trending markets to identify potential pullback or continuation levels.
1995-Present - Inflation and Purchasing PowerGood day, everyone! Today, we're going to look at a chart that's a bit different from the usual price charts we analyse. This isn't just any chart; it's a lens into the past, adjusted for the reality of inflation—a concept we often hear about but seldom see directly applied to our trading charts.
What we have here is an 'Inflation Adjusted Price' indicator on TradingView, and it's doing something quite special. It's showing us the price of our asset, let's say the S&P 500, not just in today's dollars, but in the dollars of 1995. Why 1995, you ask? Well, it's the starting point we've chosen to measure how much actual buying power has changed since then.
So, every point on this red line we see represents what the S&P 500's value would be if we stripped away the effects of inflation. This is the price in terms of what your money could actually buy you back in 1995.
As traders and investors, we're always looking at prices going up and thinking, 'Great! My investment is growing!' But the real question we should ask is, 'Is my money growing in real terms? Can it buy me more than it did last year, or five, ten, or twenty-five years ago?'
This chart tells us exactly that. If the red line is above the actual price, it means that the S&P 500 has not just grown in nominal terms, but it has actually outpaced inflation. Your investment has grown in real terms; it can buy you more now than it could back in 1995.
On the flip side, if the red line is below the actual price, that's a sign that while the nominal price might be up, the real value, the purchasing power, hasn't grown as much or could even have fallen.
This view is crucial, especially for the long-term investors among us. It gives us a reality check on our investments and savings. Are we truly growing our wealth, or are we just keeping up with the cost of living? This indicator answers that.
Remember, the true measure of financial growth is not just the numbers on a chart. It's what you can do with those numbers—how much bread, or eggs, or yes, even houses, you can buy with your hard-earned money
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
Vertical line at 8 AMThis indicator plots a blue vertical line on the chart when it's 8 AM, providing a clear visual reference of this time point on the TradingView chart.
Stock Bee's 4%Stock Bee's 4%
First Things First
- This indicator is a replica of Pradeep Bonde aka Stock Bee’s 4% indicator which he uses in the TC2000 platform for trading momentum burst and EP 9 million setup.
- Disclaimer: This indicator will not give any buy or sell signal. This is just a supporting tool to improve efficiency in my trading.
- Apply Indicators and then open indicator settings and read the following simultaneously to understand better.
- Default color settings are best suited for light themes. Which is also my personal preference.
- Users can change most of the default options in settings according to their personal preference in settings.
- When we open settings we can see 3 tabs that are {Inputs tab} {Style tab} {Visibility tab} each tab have its own options, Understand and use it accordingly.
- Background Color grading that is “Green” background means parameter favorable, “Red” not favorable for my trading.
- Indicator will be only visible in the Daily time frame as its primary TF is daily. In the lower time frame nothing is plotted.
- An indicator is plotted on a different plane and does not overlay in the existing plane.
Contents
+4% BO
-4% BO
Volume
+4% BO
- If the %change is more than 4% and today's volume > yesterday's volume and volume > 100000 then the green line is plotted from 0 to 1.
- This helps in trading momentum burst setup and to spot 4% BO easily.
{Style Tab}
- “Check Mark” Users can Show/Hide the line.
- “+4% BO” Default “Green color”. Users have the option to change.
- “Line Type” Default settings, Users have the option to change.
-4% BO
If the %change is less than -4% and today's volume > yesterday's volume and volume > 100000 then the green line is plotted from 0 to 1.
This helps in trading momentum burst setup and to spot -4% BO easily.
{Style Tab}
- “Check Mark” Users can Show/Hide the line.
- “-4% BO” Default “Red color”. Users have the option to change.
- “Line Type” Default settings, Users have the option to change.
Volume
- If Today’s Volume is greater than Default settings that is 9 Million then Blue color line is plotted similar to +/-4% B) however if u want to plot like Pradeep Bonde aka Stock Bee style then user have to change settings from “line” type to “histogram” type in style tab of settings.
- This is used for spotting EP 9 Million setup.
{Input Tab}
- “Volume” Default is (9). Users have the option to change as per their preference. And the number should be in millions.
{Style Tab}
- “Check Mark” Users can Show/Hide the line.
- “Volume” Default ”Blue color”. Users have the option to change.
- “Line Type” Default settings, Users have the option to change.
To use it similar to Stock Bee, change “Line” to “Histogram”.
Highly Recommended Setting to change immediately
{Style Tab} Outputs Section
“Check Mark” Labels on price scale. “Uncheck it”.
“Check Mark” Values in Status Line. “Uncheck it”.
*****
Bitcoin 5A Strategy@LilibtcIn our long-term strategy, we have deeply explored the key factors influencing the price of Bitcoin. By precisely calculating the correlation between these factors and the price of Bitcoin, we found that they are closely linked to the value of Bitcoin. To more effectively predict the fair price of Bitcoin, we have built a predictive model and adjusted our investment strategy accordingly based on this model. In practice, the prediction results of this model correspond quite high with actual values, fully demonstrating its reliability in predicting price fluctuations.
When the future is uncertain and the outlook is unclear, people often choose to hold back and avoid risks, or even abandon their original plans. However, the prediction of Bitcoin is full of challenges, but we have taken the first step in exploring.
Table of contents:
Usage Guide
Step 1: Identify the factors that have the greatest impact on Bitcoin price
Step 2: Build a Bitcoin price prediction model
Step 3: Find indicators for warning of bear market bottoms and bull market tops
Step 4: Predict Bitcoin Price in 2025
Step 5: Develop a Bitcoin 5A strategy
Step 6: Verify the performance of the Bitcoin 5A strategy
Usage Restrictions
🦮Usage Guide:
1. On the main interface, modify the code, find the BTCUSD trading pair, and select the BITSTAMP exchange for trading.
2. Set the time period to the daily chart.
3. Select a logarithmic chart in the chart type to better identify price trends.
4. In the strategy settings, adjust the options according to personal needs, including language, display indicators, display strategies, display performance, display optimizations, sell alerts, buy prompts, opening days, backtesting start year, backtesting start month, and backtesting start date.
🏃Step 1: Identify the factors that have the greatest impact on Bitcoin price
📖Correlation Coefficient: A mathematical concept for measuring influence
In order to predict the price trend of Bitcoin, we need to delve into the factors that have the greatest impact on its price. These factors or variables can be expressed in mathematical or statistical correlation coefficients. The correlation coefficient is an indicator of the degree of association between two variables, ranging from -1 to 1. A value of 1 indicates a perfect positive correlation, while a value of -1 indicates a perfect negative correlation.
For example, if the price of corn rises, the price of live pigs usually rises accordingly, because corn is the main feed source for pig breeding. In this case, the correlation coefficient between corn and live pig prices is approximately 0.3. This means that corn is a factor affecting the price of live pigs. On the other hand, if a shooter's performance improves while another shooter's performance deteriorates due to increased psychological pressure, we can say that the former is a factor affecting the latter's performance.
Therefore, in order to identify the factors that have the greatest impact on the price of Bitcoin, we need to find the factors with the highest correlation coefficients with the price of Bitcoin. If, through the analysis of the correlation between the price of Bitcoin and the data on the chain, we find that a certain data factor on the chain has the highest correlation coefficient with the price of Bitcoin, then this data factor on the chain can be identified as the factor that has the greatest impact on the price of Bitcoin. Through calculation, we found that the 🔵number of Bitcoin blocks is one of the factors that has the greatest impact on the price of Bitcoin. From historical data, it can be clearly seen that the growth rate of the 🔵number of Bitcoin blocks is basically consistent with the movement direction of the price of Bitcoin. By analyzing the past ten years of data, we obtained a daily correlation coefficient of 0.93 between the number of Bitcoin blocks and the price of Bitcoin.
🏃Step 2: Build a Bitcoin price prediction model
📖Predictive Model: What formula is used to predict the price of Bitcoin?
Among various prediction models, the linear function is the preferred model due to its high accuracy. Take the standard weight as an example, its linear function graph is a straight line, which is why we choose the linear function model. However, the growth rate of the price of Bitcoin and the number of blocks is extremely fast, which does not conform to the characteristics of the linear function. Therefore, in order to make them more in line with the characteristics of the linear function, we first take the logarithm of both. By observing the logarithmic graph of the price of Bitcoin and the number of blocks, we can find that after the logarithm transformation, the two are more in line with the characteristics of the linear function. Based on this feature, we choose the linear regression model to establish the prediction model.
From the graph below, we can see that the actual red and green K-line fluctuates around the predicted blue and 🟢green line. These predicted values are based on fundamental factors of Bitcoin, which support its value and reflect its reasonable value. This picture is consistent with the theory proposed by Marx in "Das Kapital" that "prices fluctuate around values."
The predicted logarithm of the market cap of Bitcoin is calculated through the model. The specific calculation formula of the Bitcoin price prediction value is as follows:
btc_predicted_marketcap = math.exp(btc_predicted_marketcap_log)
btc_predicted_price = btc_predicted_marketcap / btc_supply
🏃Step 3: Find indicators for early warning of bear market bottoms and bull market tops
📖Warning Indicator: How to Determine Whether the Bitcoin Price has Reached the Bear Market Bottom or the Bull Market Top?
By observing the Bitcoin price logarithmic prediction chart mentioned above, we notice that the actual price often falls below the predicted value at the bottom of a bear market; during the peak of a bull market, the actual price exceeds the predicted price. This pattern indicates that the deviation between the actual price and the predicted price can serve as an early warning signal. When the 🔴 Bitcoin price deviation is very low, as shown by the chart with 🟩green background, it usually means that we are at the bottom of the bear market; Conversely, when the 🔴 Bitcoin price deviation is very high, the chart with a 🟥red background indicates that we are at the peak of the bull market.
This pattern has been validated through six bull and bear markets, and the deviation value indeed serves as an early warning signal, which can be used as an important reference for us to judge market trends.
🏃Step 4:Predict Bitcoin Price in 2025
📖Price Upper Limit
According to the data calculated on February 25, 2024, the 🟠upper limit of the Bitcoin price is $194,287, which is the price ceiling of this bull market. The peak of the last bull market was on November 9, 2021, at $68,664. The bull-bear market cycle is 4 years, so the highest point of this bull market is expected in 2025. That is where you should sell the Bitcoin. and the upper limit of the Bitcoin price will exceed $190,000. The closing price of Bitcoin on February 25, 2024, was $51,729, with an expected increase of 2.7 times.
🏃Step 5: Bitcoin 5A Strategy Formulation
📖Strategy: When to buy or sell, and how many to choose?
We introduce the Bitcoin 5A strategy. This strategy requires us to generate trading signals based on the critical values of the warning indicators, simulate the trades, and collect performance data for evaluation. In the Bitcoin 5A strategy, there are three key parameters: buying warning indicator, batch trading days, and selling warning indicator. Batch trading days are set to ensure that we can make purchases in batches after the trading signal is sent, thus buying at a lower price, selling at a higher price, and reducing the trading impact cost.
In order to find the optimal warning indicator critical value and batch trading days, we need to adjust these parameters repeatedly and perform backtesting. Backtesting is a method established by observing historical data, which can help us better understand market trends and trading opportunities.
Specifically, we can find the key trading points by watching the Bitcoin price log and the Bitcoin price deviation chart. For example, on August 25, 2015, the 🔴 Bitcoin price deviation was at its lowest value of -1.11; on December 17, 2017, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.69; on March 16, 2020, the 🔴 Bitcoin price deviation was at its lowest value at the time, -0.91; on March 13, 2021, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.1; on December 31, 2022, the 🔴 Bitcoin price deviation was at its lowest value at the time, -1.
To ensure that all five key trading points generate trading signals, we set the warning indicator Bitcoin price deviation to the larger of the three lowest values, -0.9, and the smallest of the two highest values, 1. Then, we buy when the warning indicator Bitcoin price deviation is below -0.9, and sell when it is above 1.
In addition, we set the batch trading days as 25 days to implement a strategy that averages purchases and sales. Within these 25 days, we will invest all funds into the market evenly, buying once a day. At the same time, we also sell positions at the same pace, selling once a day.
📖Adjusting the threshold: a key step to optimizing trading strategy
Adjusting the threshold is an indispensable step for better performance. Here are some suggestions for adjusting the batch trading days and critical values of warning indicators:
• Batch trading days: Try different days like 25 to see how it affects overall performance.
• Buy and sell critical values for warning indicators: iteratively fine-tune the buy threshold value of -0.9 and the sell threshold value of 1 exhaustively to find the best combination of threshold values.
Through such careful adjustments, we may find an optimized approach with a lower maximum drawdown rate (e.g., 11%) and a higher cumulative return rate for closed trades (e.g., 474 times). The chart below is a backtest optimization chart for the Bitcoin 5A strategy, providing an intuitive display of strategy adjustments and optimizations.
In this way, we can better grasp market trends and trading opportunities, thereby achieving a more robust and efficient trading strategy.
🏃Step 6: Validating the performance of the Bitcoin 5A Strategy
📖Model interpretability validation: How to explain the Bitcoin price model?
The interpretability of the model is represented by the coefficient of determination R squared, which reflects the degree of match between the predicted value and the actual value. I divided all the historical data from August 18, 2015 into two groups, and used the data from August 18, 2011 to August 18, 2015 as training data to generate the model. The calculation result shows that the coefficient of determination R squared during the 2011-2015 training period is as high as 0.81, which shows that the interpretability of this model is quite high. From the Bitcoin price logarithmic prediction chart in the figure below, we can see that the deviation between the predicted value and the actual value is not far, which means that most of the predicted values can explain the actual value well.
The calculation formula for the coefficient of determination R squared is as follows:
residual = btc_close_log - btc_predicted_price_log
residual_square = residual * residual
train_residual_square_sum = math.sum(residual_square, train_days)
train_mse = train_residual_square_sum / train_days
train_r2 = 1 - train_mse / ta.variance(btc_close_log, train_days)
📖Model stability verification: How to affirm the stability of the Bitcoin price model when new data is available?
Model stability is achieved through model verification. I set the last day of the training period to February 2, 2024 as the "verification group" and used it as verification data to verify the stability of the model. This means that after generating the model if there is new data, I will use these new data together with the model for prediction, and then evaluate the interpretability of the model. If the coefficient of determination when using verification data is close to the previous training one and both remain at a high level, then we can consider this model as stability. The coefficient of determination calculated from the validation period data and model prediction results is as high as 0.83, which is close to the previous 0.81, further proving the stability of this model.
📖Performance evaluation: How to accurately evaluate historical backtesting results?
After detailed strategy testing, to ensure the accuracy and reliability of the results, we need to carry out a detailed performance evaluation on the backtest results. The key evaluation indices include:
• Net value curve: As shown in the rose line, it intuitively reflects the growth of the account net value. By observing the net value curve, we can understand the overall performance and profitability of the strategy.
The basic attributes of this strategy are as follows:
Trading range: 2015-8-19 to 2024-2-18, backtest range: 2011-8-18 to 2024-2-18
Initial capital: 1000USD, order size: 1 contract, pyramid: 50 orders, commission rate: 0.2%, slippage: 20 markers.
In the strategy tester overview chart, we also obtained the following key data:
• Net profit rate of closed trades: as high as 474 times, far exceeding the benchmark, as shown in the strategy tester performance summary chart, Bitcoin buys and holds 210 times.
• Number of closed trades and winning percentage: 100 trades were all profitable, showing the stability and reliability of the strategy.
• Drawdown rate & win-loose ratio: The maximum drawdown rate is only 11%, far lower than Bitcoin's 78%. Profit factor, or win-loose ratio, reached 500, further proving the advantage of the strategy.
Through these detailed evaluations, we can see clearly the excellent balance between risk and return of the Bitcoin 5A strategy.
⚠️Usage Restrictions: Strategy Application in Specific Situations
Please note that this strategy is designed specifically for Bitcoin and should not be applied to other assets or markets without authorization. In actual operations, we should make careful decisions according to our risk tolerance and investment goals.
Bitcoin 5A Strategy - Price Upper & Lower Limit@LilibtcIn our long-term strategy, we have deeply explored the key factors influencing the price of Bitcoin. By precisely calculating the correlation between these factors and the price of Bitcoin, we found that they are closely linked to the value of Bitcoin. To more effectively predict the fair price of Bitcoin, we have built a predictive model and adjusted our investment strategy accordingly based on this model. In practice, the prediction results of this model correspond quite high with actual values, fully demonstrating its reliability in predicting price fluctuations.
When the future is uncertain and the outlook is unclear, people often choose to hold back and avoid risks, or even abandon their original plans. However, the prediction of Bitcoin is full of challenges, but we have taken the first step in exploring.
Table of contents:
Usage Guide
Step 1: Identify the factors that have the greatest impact on Bitcoin price
Step 2: Build a Bitcoin price prediction model
Step 3: Find indicators for warning of bear market bottoms and bull market tops
Step 4: Predict Bitcoin Price in 2025
Step 5: Develop a Bitcoin 5A strategy
Step 6: Verify the performance of the Bitcoin 5A strategy
Usage Restrictions
🦮Usage Guide:
1. On the main interface, modify the code, find the BTCUSD trading pair, and select the BITSTAMP exchange for trading.
2. Set the time period to the daily chart.
3. Select a logarithmic chart in the chart type to better identify price trends.
4. In the strategy settings, adjust the options according to personal needs, including language, display indicators, display strategies, display performance, display optimizations, sell alerts, buy prompts, opening days, backtesting start year, backtesting start month, and backtesting start date.
🏃Step 1: Identify the factors that have the greatest impact on Bitcoin price
📖Correlation Coefficient: A mathematical concept for measuring influence
In order to predict the price trend of Bitcoin, we need to delve into the factors that have the greatest impact on its price. These factors or variables can be expressed in mathematical or statistical correlation coefficients. The correlation coefficient is an indicator of the degree of association between two variables, ranging from -1 to 1. A value of 1 indicates a perfect positive correlation, while a value of -1 indicates a perfect negative correlation.
For example, if the price of corn rises, the price of live pigs usually rises accordingly, because corn is the main feed source for pig breeding. In this case, the correlation coefficient between corn and live pig prices is approximately 0.3. This means that corn is a factor affecting the price of live pigs. On the other hand, if a shooter's performance improves while another shooter's performance deteriorates due to increased psychological pressure, we can say that the former is a factor affecting the latter's performance.
Therefore, in order to identify the factors that have the greatest impact on the price of Bitcoin, we need to find the factors with the highest correlation coefficients with the price of Bitcoin. If, through the analysis of the correlation between the price of Bitcoin and the data on the chain, we find that a certain data factor on the chain has the highest correlation coefficient with the price of Bitcoin, then this data factor on the chain can be identified as the factor that has the greatest impact on the price of Bitcoin. Through calculation, we found that the 🔵 number of Bitcoin blocks is one of the factors that has the greatest impact on the price of Bitcoin. From historical data, it can be clearly seen that the growth rate of the 🔵 number of Bitcoin blocks is basically consistent with the movement direction of the price of Bitcoin. By analyzing the past ten years of data, we obtained a daily correlation coefficient of 0.93 between the number of Bitcoin blocks and the price of Bitcoin.
🏃Step 2: Build a Bitcoin price prediction model
📖Predictive Model: What formula is used to predict the price of Bitcoin?
Among various prediction models, the linear function is the preferred model due to its high accuracy. Take the standard weight as an example, its linear function graph is a straight line, which is why we choose the linear function model. However, the growth rate of the price of Bitcoin and the number of blocks is extremely fast, which does not conform to the characteristics of the linear function. Therefore, in order to make them more in line with the characteristics of the linear function, we first take the logarithm of both. By observing the logarithmic graph of the price of Bitcoin and the number of blocks, we can find that after the logarithm transformation, the two are more in line with the characteristics of the linear function. Based on this feature, we choose the linear regression model to establish the prediction model.
From the graph below, we can see that the actual red and green K-line fluctuates around the predicted blue and 🟢green line. These predicted values are based on fundamental factors of Bitcoin, which support its value and reflect its reasonable value. This picture is consistent with the theory proposed by Marx in "Das Kapital" that "prices fluctuate around values."
The predicted logarithm of the market cap of Bitcoin is calculated through the model. The specific calculation formula of the Bitcoin price prediction value is as follows:
btc_predicted_marketcap = math.exp(btc_predicted_marketcap_log)
btc_predicted_price = btc_predicted_marketcap / btc_supply
🏃Step 3: Find indicators for early warning of bear market bottoms and bull market tops
📖Warning Indicator: How to Determine Whether the Bitcoin Price has Reached the Bear Market Bottom or the Bull Market Top?
By observing the Bitcoin price logarithmic prediction chart mentioned above, we notice that the actual price often falls below the predicted value at the bottom of a bear market; during the peak of a bull market, the actual price exceeds the predicted price. This pattern indicates that the deviation between the actual price and the predicted price can serve as an early warning signal. When the 🔴 Bitcoin price deviation is very low, as shown by the chart with 🟩green background, it usually means that we are at the bottom of the bear market; Conversely, when the 🔴 Bitcoin price deviation is very high, the chart with a 🟥red background indicates that we are at the peak of the bull market.
This pattern has been validated through six bull and bear markets, and the deviation value indeed serves as an early warning signal, which can be used as an important reference for us to judge market trends.
🏃Step 4:Predict Bitcoin Price in 2025
📖Price Upper Limit
According to the data calculated on March 10, 2023(If you want to check latest data, please contact with author), the 🟠upper limit of the Bitcoin price is $132,453, which is the price ceiling of this bull market. The peak of the last bull market was on November 9, 2021, at $68,664. The bull-bear market cycle is 4 years, so the highest point of this bull market is expected in 2025, and the 🟠upper limit of the Bitcoin price will exceed $130,000. The closing price of Bitcoin on March 10, 2024, was $68,515, with an expected increase of 90%.
🏃Step 5: Bitcoin 5A Strategy Formulation
📖Strategy: When to buy or sell, and how many to choose?
We introduce the Bitcoin 5A strategy. This strategy requires us to generate trading signals based on the critical values of the warning indicators, simulate the trades, and collect performance data for evaluation. In the Bitcoin 5A strategy, there are three key parameters: buying warning indicator, batch trading days, and selling warning indicator. Batch trading days are set to ensure that we can make purchases in batches after the trading signal is sent, thus buying at a lower price, selling at a higher price, and reducing the trading impact cost.
In order to find the optimal warning indicator critical value and batch trading days, we need to adjust these parameters repeatedly and perform backtesting. Backtesting is a method established by observing historical data, which can help us better understand market trends and trading opportunities.
Specifically, we can find the key trading points by watching the Bitcoin price log and the Bitcoin price deviation chart. For example, on August 25, 2015, the 🔴 Bitcoin price deviation was at its lowest value of -1.11; on December 17, 2017, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.69; on March 16, 2020, the 🔴 Bitcoin price deviation was at its lowest value at the time, -0.91; on March 13, 2021, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.1; on December 31, 2022, the 🔴 Bitcoin price deviation was at its lowest value at the time, -1.
To ensure that all five key trading points generate trading signals, we set the warning indicator Bitcoin price deviation to the larger of the three lowest values, -0.9, and the smallest of the two highest values, 1. Then, we buy when the warning indicator Bitcoin price deviation is below -0.9, and sell when it is above 1.
In addition, we set the batch trading days as 25 days to implement a strategy that averages purchases and sales. Within these 25 days, we will invest all funds into the market evenly, buying once a day. At the same time, we also sell positions at the same pace, selling once a day.
📖Adjusting the threshold: a key step to optimizing trading strategy
Adjusting the threshold is an indispensable step for better performance. Here are some suggestions for adjusting the batch trading days and critical values of warning indicators:
• Batch trading days: Try different days like 25 to see how it affects overall performance.
• Buy and sell critical values for warning indicators: iteratively fine-tune the buy threshold value of -0.9 and the sell threshold value of 1 exhaustively to find the best combination of threshold values.
Through such careful adjustments, we may find an optimized approach with a lower maximum drawdown rate (e.g., 11%) and a higher cumulative return rate for closed trades (e.g., 474 times). The chart below is a backtest optimization chart for the Bitcoin 5A strategy, providing an intuitive display of strategy adjustments and optimizations.
In this way, we can better grasp market trends and trading opportunities, thereby achieving a more robust and efficient trading strategy.
🏃Step 6: Validating the performance of the Bitcoin 5A Strategy
📖Model accuracy validation: How to judge the accuracy of the Bitcoin price model?
The accuracy of the model is represented by the coefficient of determination R square, which reflects the degree of match between the predicted value and the actual value. I divided all the historical data from August 18, 2015 into two groups, and used the data from August 18, 2011 to August 18, 2015 as training data to generate the model. The calculation result shows that the coefficient of determination R squared during the 2011-2015 training period is as high as 0.81, which shows that the accuracy of this model is quite high. From the Bitcoin price logarithmic prediction chart in the figure below, we can see that the deviation between the predicted value and the actual value is not far, which means that most of the predicted values can explain the actual value well.
The calculation formula for the coefficient of determination R square is as follows:
residual = btc_close_log - btc_predicted_price_log
residual_square = residual * residual
train_residual_square_sum = math.sum(residual_square, train_days)
train_mse = train_residual_square_sum / train_days
train_r2 = 1 - train_mse / ta.variance(btc_close_log, train_days)
📖Model reliability verification: How to affirm the reliability of the Bitcoin price model when new data is available?
Model reliability is achieved through model verification. I set the last day of the training period to February 2, 2024 as the "verification group" and used it as verification data to verify the reliability of the model. This means that after generating the model if there is new data, I will use these new data together with the model for prediction, and then evaluate the accuracy of the model. If the coefficient of determination when using verification data is close to the previous training one and both remain at a high level, then we can consider this model as reliable. The coefficient of determination calculated from the validation period data and model prediction results is as high as 0.83, which is close to the previous 0.81, further proving the reliability of this model.
📖Performance evaluation: How to accurately evaluate historical backtesting results?
After detailed strategy testing, to ensure the accuracy and reliability of the results, we need to carry out a detailed performance evaluation on the backtest results. The key evaluation indices include:
• Net value curve: As shown in the rose line, it intuitively reflects the growth of the account net value. By observing the net value curve, we can understand the overall performance and profitability of the strategy.
The basic attributes of this strategy are as follows:
Trading range: 2015-8-19 to 2024-2-18, backtest range: 2011-8-18 to 2024-2-18
Initial capital: 1000USD, order size: 1 contract, pyramid: 50 orders, commission rate: 0.2%, slippage: 20 markers.
In the strategy tester overview chart, we also obtained the following key data:
• Net profit rate of closed trades: as high as 474 times, far exceeding the benchmark, as shown in the strategy tester performance summary chart, Bitcoin buys and holds 210 times.
• Number of closed trades and winning percentage: 100 trades were all profitable, showing the stability and reliability of the strategy.
• Drawdown rate & win-loose ratio: The maximum drawdown rate is only 11%, far lower than Bitcoin's 78%. Profit factor, or win-loose ratio, reached 500, further proving the advantage of the strategy.
Through these detailed evaluations, we can see clearly the excellent balance between risk and return of the Bitcoin 5A strategy.
⚠️Usage Restrictions: Strategy Application in Specific Situations
Please note that this strategy is designed specifically for Bitcoin and should not be applied to other assets or markets without authorization. In actual operations, we should make careful decisions according to our risk tolerance and investment goals.
Gradient Candles
The Gradient Candles indicator is crafted to be a comprehensive replacement for default candlesticks, offering users an enhanced and visually stunning alternative. To experience the intended results and fully immerse in the distinctive features of Gradient Candles, it's recommended to hide the default candlesticks. This ensures that traders can fully appreciate the unique color gradient and dynamic visual representation that this indicator brings to chart analysis.
Designed to elevate chart analysis, Gradient Candles not only offer a fresh perspective on price movements but also captivate users with their visually appealing representation of market dynamics. Departing from traditional candlestick coloration, the dynamic adaptation of colors, the 'color.from_gradient()' function plays a pivotal role in translating the current source value into a color that reflects its proximity to the highest and lowest values and corresponding colors. Beyond its analytical capabilities, Gradient Candles transform market analysis into an aesthetically enriching experience, providing traders with a unique and comprehensive tool for their technical analysis toolkit.
Traders can tailor the indicator's appearance to suit their preferences and seamlessly integrate it into their personal trading environment. From color inversion to transparency adjustments and the option to fill candles instead of outlining them, the customization features empower users to create a visual representation that aligns precisely with their unique preferences.
TMS By TradeINskiTMS (Trade Management System) By TradeINski
First Things First
- Disclaimer: This indicator will not give any buy or sell signal this is just a supporting tool to improve efficiency in my trading.
- Apply Indicators and then open indicator settings and read the following simultaneously to understand better.
- Default color settings are best suited for light themes. Which is also my personal preference.
Users can change most of the default options in settings according to their personal preference in settings.
- When we open settings we can see 3 tabs that are {Inputs tab} {Style tab} {Visibility tab} each tab have its own options, Understand and use it accordingly.
- Background Color grading that is “Green” background means parameter favorable, “Red” not favorable for my trading, “Nah” and black means no sufficient data for calculation especially IPO stocks and other colors are not just for color grading but also have some significance.
Indicator will be only visible in the intraday time frame as its primary TF is lower time frame.
Contents
Table - Trade Management System
Capital
Risk (%)
Stop Loss (%)
RQBC - Real Time Quantity Based On PDC
%DC - Distance From PDC
RQBL - Real Time Quantity Based On LOD
%DL / %DH - Distance From LOD/ HOD
R_VOL
Markers - Intraday levels
Q - Quantity Based on SL
QL - Quantity Based On LOD
E @ - Entry % Distance From PDC
L1 - Line 1 % Distance From PDC
L2 - Line 2 % Distance From PDC
Low of the Day
Table - Trade Management System
Capital
- Capital is nothing but your account size in number. Default value is 1000000.
- Eg. Capital is 10L then enter 1000000.
{Input Tab}
- “Check Mark” Users can show or hide from the table.
- “Capital” Default “1000000”.
- Color Code of the cell is the default Blue color.
- Note - If Currency is INR then output is in Cr’s and other currency is in thousands K & M for millions.
Risk (%)
- Risk in percentage is the percentage of risk per trade you're willing to take from the deployed capital. Default 0.50%.
- Eg. 10L capital 0.5% Risk (%) ie. 5000 is the risk per trade.
{Input Tab}
- “Check Mark” Users can show or hide from the table.
- “Risk (%)” Default “0.50”.
- Color Code of the cell is the default Blue color.
Stop Loss (%)
- Percentage stop loss willing to take or decided for each specific trade from enter level. Default value is 2%
- Eg. Planned SL for specific trade is 2%.
{Input Tab}
- “Check Mark” Users can show or hide intraday markers.
- “Stop Loss (%)” Default “2%”.
- “Color” Users can change as per their preference. Default color is Red.
RQBC - Real Time Quantity Based On PDC (Previous Day Close)
- Here quantity is calculated real time based on four factors i.e account size, risk (%) and current close and with respect to previous day close. This helps in deciding ideal position size quickly.
- Eg. RQBC is 10 as per Account size, Risk (%), Current close and with respect to Previous day close.
{Input Tab}
- “Check Mark” Users can show or hide from the table.
- “RQBC - Real Time Quantity Based On PDC”. Color code of the cell changes as per % change of the stock i.e Green & Red accordingly.
%DC - Distance From PDC (Previous Day Close)
- This is exact same logic as % change ie. based on two factors which are the previous day close and current close and then % change or move is calculated.
- Eg. Stock has moved 3.5% ie. % change is 3.5%
{Input Tab}
- “Check Mark” Users can show or hide from the table.
- “%DC - Distance from PDC”. Color code of the cell changes as per % change of the stock i.e Green & Red accordingly.
RQBL - Real Time Quantity Based On LOD (Low of the Day)
- Here quantity is calculated realtime based on four factors i.e account size, risk (%) and current close with respect to the low of the day that is today's low. This helps in deciding ideal position size based on the current low of the day quickly.
- Eg. Stock has moved 2.7% from the low of the day which most of the time differs from %DC that is % change.
{Input Tab}
- “Check Mark” Users can show or hide from the table.
- “RQBL - Real Time Quantity Based On LOD”. Color code of the cell changes as per %Change of the stock i.e Green & Red accordingly.
%DL / %DH - Distance From LOD (Low Of The Day) / HOD (High Of The Day)
- This is similar to % change but based on two factors which are the low of the day and current close for %DL that is when %change is positive and when % change is negative %DH is calculated based on current close and high of the day. In both cases, % move is calculated.
- Eg. Stock has moved 3.5% from low of the day then its %DL and for %DH vice versa considering high of the day.
{Input Tab}
- “Check Mark” Users can show or hide from the table.
- “%DL / %DH - Distance from LOD / HOD”. Color code of the cell changes as per % change of the stock i.e Green & Red accordingly.
R_VOL - Relative Volume
- Value shown in terms of percentage, Is how much volume is present today with respect to average volume and average volume period is 50.
- Eg. If R_VOL is less than 100% that means specific day volume is less than average volume and if RVOL is more than average volume then specific day volume is more than average volume.
{Inputs Tab}
- “Check Mark” Users can show or hide from the table.
- “R_VOL” Period “50” - Users have the option to choose accordingly.
- “Op” Means output “Drop down” User can choose between complete & Percentage only Play around to notice the difference.
{Note}
- The Following settings for the complete table.
- Position “Drop Down”. Users can choose accordingly.
- Size “Drop Down”. Users can choose accordingly.
MARKER - INTRADAY LEVELS
{Note}
- The Following settings are for all the intraday markers .
- “Line Type” “Drop Down”. Users can choose accordingly.
- Width ”↕” “1”. Mini = 1 & Max = 4. Users can choose accordingly.
- Label Size “Drop Down”. Users can choose accordingly.
Q - Quantity Based On SL (Stop Loss)
- Here Quantity is calculated based on four factors and marked on an intraday time frame and those factors are capital, Risk (%), Stop loss (%) and E @ ie. Entry level. Objective is based on different factors determining ideal position size quickly.
- Eg. Q is 25 based on capital, Risk(%), Stop loss (%) & Entry (%) Ie E @.
{Inputs Tab}
“Check Mark” Users can show or hide intraday markers.
“Q - Quantity Based On SL”. Color of the marker can be changed from the color settings of E @.
{Output}
- “Q - 25” is marked on E @ - Entry % Distance From PDC.
- Marker is colored green by default.
QL - Quantity Based On LOD (Low Of The Day)
- Here Quantity is calculated based on four factors and marked on an intraday time frame and those factors are capital, Risk (%), LOD ie. low of the day and E @ ie. Entry level. Objective is based on different factors determining ideal position size.
- Eg. Q is 25 based on capital, Risk(%), LOD & Entry (%) Ie E @.
{Inputs Tab}
- “Check Mark” Users can show or hide intraday markers.
- “Q - Quantity Based On LOD”. Color of the marker can be changed from the color settings of E @.
{Output}
- “QL - 25” is marked on E @ - Entry %Distance From PDC.
- Marker is colored green by default.
E @ - Entry % Distance From PDC (Previous Day Close)
- Here Entry Price Level is determined and marked, that is how far from previous day close in percentage that is nothing but saying after how much % change you're willing to enter.
- Eg. Enter after 2% Move then the marker shows its price along with “Q” & “QL”.
{Inputs Tab}
- “Check Mark” Users can show or hide intraday markers.
- E - Entry % Distance From PDC.
- “E @ - Entry (%)” Default “2”. Users have the option to change accordingly.
- “Green Color”. Users can choose as per their preference.
{Output}
- “E @ ” “Default 2%” : “Price” / “Q - ” Calculated Quantity based on SL / “QL - “ Calculated quantity based on LOD. Green Color Label.
L1 - Line 1 % DIstance from PDC (Previous Day Close)
- Here Line 1 is the level which is determined by how far from previous day close in percentage that is nothing but saying at what % change the marker should be shown. This acts as a visual support level. Logic is in the live market the price is nearing the entry level and be vigilant to take action.
- Eg. Support level is 1.5% that is 1.5% away from PDC.
{Inputs Tab}
- “Check Mark” Users can show or hide intraday markers.
- L1 - Line 1 % Distance From PDC.
- “L1 - Line 1 (%)” Default “1.5”. Users have the option to change accordingly.
- “Gray Color”. Users can choose as per their preference.
{Output}
- “L1” “Default 1.5%” : “Price”. Gray Color label.
L2 - Line 2 % Distance from PDC (Previous Day Close)
- Here Line 2 is the level which is determined by how far from previous day close in percentage that is nothing but saying at what % change the marker should be shown. This acts as a visual support level. Logic is in the live market the price is nearing the entry level and be vigilant to take action.
- Eg. Support level is 1% that is 1% away from PDC.
{Inputs Tab}
- “Check Mark” Users can show or hide intraday markers.
- L2 - Line 2 % Distance From PDC.
- “L2 - Line 2 (%)” Default “1.5”. Users have the option to change accordingly.
- “Gray Color”. Users can choose as per their preference.
{Output}
- “L2” “Default 1%” : “Price”. Gray Color label.
Low Of The Day
- Here the current low of the day is marked and its price is shown in the intraday label.
Eg. Stock low of the day is 100 then it marks 100.
{Inputs Tab}
- “Check Mark” Users can show or hide intraday markers.
- Low Of the Day
- “Fuchsia Color”. Users can choose as per their preference.
{Output}
- “LOD” : “Price”. Fuchsia Color label.
Trend Deviation strategy - BTC [IkkeOmar]Intro:
This is an example if anyone needs a push to get started with making strategies in pine script. This is an example on BTC, obviously it isn't a good strategy, and I wouldn't share my own good strategies because of alpha decay.
This strategy integrates several technical indicators to determine market trends and potential trade setups. These indicators include:
Directional Movement Index (DMI)
Bollinger Bands (BB)
Schaff Trend Cycle (STC)
Moving Average Convergence Divergence (MACD)
Momentum Indicator
Aroon Indicator
Supertrend Indicator
Relative Strength Index (RSI)
Exponential Moving Average (EMA)
Volume Weighted Average Price (VWAP)
It's crucial for you guys to understand the strengths and weaknesses of each indicator and identify synergies between them to improve the strategy's effectiveness.
Indicator Settings:
DMI (Directional Movement Index):
Length: This parameter determines the number of bars used in calculating the DMI. A higher length may provide smoother results but might lag behind the actual price action.
Bollinger Bands:
Length: This parameter specifies the number of bars used to calculate the moving average for the Bollinger Bands. A longer length results in a smoother average but might lag behind the price action.
Multiplier: The multiplier determines the width of the Bollinger Bands. It scales the standard deviation of the price data. A higher multiplier leads to wider bands, indicating increased volatility, while a lower multiplier results in narrower bands, suggesting decreased volatility.
Schaff Trend Cycle (STC):
Length: This parameter defines the length of the STC calculation. A longer length may result in smoother but slower-moving signals.
Fast Length: Specifies the length of the fast moving average component in the STC calculation.
Slow Length: Specifies the length of the slow moving average component in the STC calculation.
MACD (Moving Average Convergence Divergence):
Fast Length: Determines the number of bars used to calculate the fast EMA (Exponential Moving Average) in the MACD.
Slow Length: Specifies the number of bars used to calculate the slow EMA in the MACD.
Signal Length: Defines the number of bars used to calculate the signal line, which is typically an EMA of the MACD line.
Momentum Indicator:
Length: This parameter sets the number of bars over which momentum is calculated. A longer length may provide smoother momentum readings but might lag behind significant price changes.
Aroon Indicator:
Length: Specifies the number of bars over which the Aroon indicator calculates its values. A longer length may result in smoother Aroon readings but might lag behind significant market movements.
Supertrend Indicator:
Trendline Length: Determines the length of the period used in the Supertrend calculation. A longer length results in a smoother trendline but might lag behind recent price changes.
Trendline Factor: Specifies the multiplier used in calculating the trendline. It affects the sensitivity of the indicator to price changes.
RSI (Relative Strength Index):
Length: This parameter sets the number of bars over which RSI calculates its values. A longer length may result in smoother RSI readings but might lag behind significant price changes.
EMA (Exponential Moving Average):
Fast EMA: Specifies the number of bars used to calculate the fast EMA. A shorter period results in a more responsive EMA to recent price changes.
Slow EMA: Determines the number of bars used to calculate the slow EMA. A longer period results in a smoother EMA but might lag behind recent price changes.
VWAP (Volume Weighted Average Price):
Default settings are typically used for VWAP calculations, which consider the volume traded at each price level over a specific period. This indicator provides insights into the average price weighted by trading volume.
backtest range and rules:
You can specify the start date for backtesting purposes.
You can can select the desired trade direction: Long, Short, or Both.
Entry and Exit Conditions:
LONG:
DMI Cross Up: The Directional Movement Index (DMI) indicates a bullish trend when the positive directional movement (+DI) crosses above the negative directional movement (-DI).
Bollinger Bands (BB): The price is below the upper Bollinger Band, indicating a potential reversal from the upper band.
Momentum Indicator: Momentum is positive, suggesting increasing buying pressure.
MACD (Moving Average Convergence Divergence): The MACD line is above the signal line, indicating bullish momentum.
Supertrend Indicator: The Supertrend indicator signals an uptrend.
Schaff Trend Cycle (STC): The STC indicates a bullish trend.
Aroon Indicator: The Aroon indicator signals a bullish trend or crossover.
When all these conditions are met simultaneously, the strategy considers it a favorable opportunity to enter a long trade.
SHORT:
DMI Cross Down: The Directional Movement Index (DMI) indicates a bearish trend when the negative directional movement (-DI) crosses above the positive directional movement (+DI).
Bollinger Bands (BB): The price is above the lower Bollinger Band, suggesting a potential reversal from the lower band.
Momentum Indicator: Momentum is negative, indicating increasing selling pressure.
MACD (Moving Average Convergence Divergence): The MACD line is below the signal line, signaling bearish momentum.
Supertrend Indicator: The Supertrend indicator signals a downtrend.
Schaff Trend Cycle (STC): The STC indicates a bearish trend.
Aroon Indicator: The Aroon indicator signals a bearish trend or crossover.
When all these conditions align, the strategy considers it an opportune moment to enter a short trade.
Disclaimer:
THIS ISN'T AN OPTIMAL STRATEGY AT ALL! It was just an old project from when I started learning pine script!
The backtest doesn't promise the same results in the future, always do both in-sample and out-of-sample testing when backtesting a strategy. And make sure you forward test it as well before implementing it!
Furthermore this strategy uses both trend and mean-reversion systems, that is usually a no-go if you want to build robust trend systems .
Don't hesitate to comment if you have any questions or if you have some good notes for a beginner.