TrendPredator PROThe TrendPredator PRO
Stacey Burke, a seasoned trader and mentor, developed his trading system over the years, drawing insights from influential figures such as George Douglas Taylor, Tony Crabel, Steve Mauro, and Robert Schabacker. His popular system integrates select concepts from these experts into a consistent framework. While powerful, it remains highly discretionary, requiring significant real-time analysis, which can be challenging for novice traders.
The TrendPredator indicators support this approach by automating the essential analysis required to trade the system effectively and incorporating mechanical bias and a multi-timeframe concept. They provide value to traders by significantly reducing the time needed for session preparation, offering all relevant chart analysis and signals for live trading in real-time.
The PRO version offers an advanced pattern identification logic that highlights developing context as well as setups related to the constellation of the signals provided. It provides real-time interpretation of the multi-timeframe analysis table, following an extensive underlying logic with more than 150 different setup variations specifically developed for the system and indicator. These setups are constantly back- and forward-tested and updated according to the results. This version is tailored to traders primarily trading this system and following the related setups in detail.
The former TrendPredator ES version does not provide that option. It is significantly leaner and is designed for traders who want to use the multi-timeframe logic as additional confluence for their trading style. It is very well suited to support many other trading styles, including SMC and ICT.
The Multi-timeframe Master Pattern
Inspired by Taylor’s 3-day cycle and Steve Mauro’s work with “Beat the Market Maker,” Burke’s system views markets as cyclical, driven by the manipulative patterns of market makers. These patterns often trap traders at the extremes of moves above or below significant levels with peak formations, then reverse to utilize their liquidity, initiating the next phase. Breakouts away from these traps often lead to range expansions, as described by Tony Crabel and Robert Schabacker. After multiple consecutive breakouts, especially after the psychological number three, overextension might develop. A break in structure may then lead to reversals or pullbacks. The TrendPredator Indicator and the related multi-timeframe trading system are designed to track these cycles on the daily timeframe and provide signals and trade setups to navigate them.
Bias Logic and Multi-Timeframe Concept
The indicator covers the basic signals of Stacey Burke's system:
- First Red Day (FRD): Bearish break in structure, signalling weak longs in the market.
- First Green Day (FGD): Bullish break in structure signalling weak shorts in the markt.
- Three Days of Longs (3DL): Overextension signalling potential weak longs in the market.
- Three Days of Shorts (3DS): Overextension signalling potential weak shorts in the market.
- Inside Day (ID): Contraction, signalling potential impulsive reversal or range expansion move.
It enhances the original system by introducing:
Structured Bias Logic:
Tracks bias by following how price trades concerning the last previous candle high or low that was hit. For example if the high was hit, we are bullish above and bearish below.
- Bullish state: Breakout (BO), Fakeout Low (FOL)
- Bearish state: Breakdown (BD), Fakeout High (FOH)
Multi-Timeframe Perspective:
- Tracks all signals across H4, H8, D, W, and M timeframes, to look for alignment and follow trends and momentum in a mechanical way.
Developing Context:
- Identifies specific predefined context states based on the monthly, weekly and daily bias.
Developing Setups:
- Identifies specific predefined setups based on context and H8 bias as well as SB signals.
The indicator monitors the bias and signals of the system across all relevant timeframes and automates the related graphical chart analysis as well as context and setup zone identification. In addition to the master pattern, the system helps to identify the higher timeframe situation and follow the moves driven by other timeframe traders to then identify favourable context and setup situations for the trader.
Example: Full Bullish Cycle on the Daily Timeframe with Multi-Timeframe Signals
- The Trap/Peak Formation
The market breaks down from a previous day’s and maybe week’s low—potentially after multiple breakdowns—but fails to move lower and pulls back up to form a peak formation low and closes as a first green day.
MTF Signals: Bullish daily and weekly fakeout low; three consecutive breakdown days (1W Curr FOL, 1D Curr FOL, BO 3S).
Context: Reversal (REV)
Setup: Fakeout low continuation low of day (FOL Cont LOD)
- Pullback and Consolidation
The next day pulls further up after first green day signal, potentially consolidates inside the previous day’s range.
MTF Signals: Fakeout low and first green day closing as an inside day (1D Curr IS, Prev FOL, First G).
Context: Reversal continuation (REV Cont)
Setup: Previous fakeout low continuation low handing fruit (Prev FOL Cont LHF)
- Range Expansion/Trend
The following day breaks up through the previous day’s high, launching a range expansion away from the trap.
MTF Signals: Bullish daily breakout of an inside day (1D Curr BO, Prev IS).
Context: Uptrend healthy (UT)
Setup: Breakout continuation low hanging fruit (BO Cont LHF)
- Overextension
After multiple consecutive breakouts, the market reaches a state of overextension, signalling a possible reversal or pullback.
MTF Signals: Three days of breakout longs (1D Curr BO, Prev BO, BO 3L).
Context: Uptrend extended (UT)
- Reversal
After a breakout of previous days high that fails, price pulls away from the high showing a rollover of momentum across all timeframes and a potential short setup.
MTF Signals: Three days of breakout longs, daily fakeout high (1D 3L, FOH)
Context: Reversal countertrend (REV)
Setup: Fakeout high continuation high of day (FOH Cont HOD)
Note: This is only one possible illustrative scenario; there are many variations and combinations.
Example Chart: Full Bullish Cycle with Correlated Signals
Multi-Timeframe Signals examples:
Context and Setups examples:
Note: The signals shown along the move are manually added illustrations. The indicator shows these in realtime in the table at top and bottom right. This is only one possible scenario; there are many variations and combinations.
Due to the fractal nature of markets, this cycle can be observed across all timeframes. The strongest setups occur when there is multi-timeframe alignment. For example, a peak formation and potential reversal on the daily timeframe have higher probability and follow-through when they align with bearish signals on higher timeframes (e.g., weekly/monthly BD/FOH) and confirmation on lower timeframes (H4/H8 FOH/BD). With this perspective, the system enables the trader to follow the trend and momentum while identifying rollover points in a highly differentiated and precise way.
Using the Indicator for Trading
The automated analysis provided by the indicator can be used for thesis generation in preparation for a session as well as for live trading, leveraging the real-time updates as well as the context and setup indicated or alerted. It is recommended to customize the settings deeply, such as hiding the lower timeframes for thesis generation or the specific alert time window and settings to the specific trading schedule and playbook of the trader.
1. Context Assessment:
Evaluate alignment of higher timeframes (e.g., Month/Week, Week/Day). More alignment → Stronger setups.
- The context table offers an interpretation of the higher timeframe automatically. See below for further details.
2. Setup Identification:
Follow the bias of daily and H8 timeframes. A setup mostly requires alignment of these.
Setup Types:
- Trend Trade: Trade in alignment with the previous day’s trend.
Example: Price above the previous day’s high → Focus on long setups (dBO, H8 FOL) until overextension or reversal signs appear (H8 BO 3L, First R).
- Reversal Trade: Identify reversal setups when lower timeframes show rollovers after higher timeframe weakness.
Example: Price below the previous day’s high → Look for reversal signals at the current high of day (H8 FOH, BO 3L, First R).
- The setup table shows potential setups for the specific price zone in the table automatically. See below for further details.
3. Entry Confirmation:
Confirm entries based on H8 and H4 alignment, candle closes and lower timeframe fakeouts.
- H8 and H4 should always align for a final confirmation, meaning the breach lines should be both in the back of a potential trade setup.
- M15/ 5 candle close can be seen as acceptance beyond a level or within the setup zone.
- M15/5 FOH/ FOL signals lower timeframe traps potentially indicating further confirmation.
Example Chart Reversal Trade:
Context: REV (yellow), Reversal counter trend, Month in FOL with bearish First R, Week in BO but bearishly overextended with BO 3L, Day in Fakeout high reversing bearishly.
Setup: FOH Cont HOD (red), Day in Fakeout high after BO 3L overextension, confirmed by H8 FOH high of day, First R as further confluence. Two star quality and countertrend.
Entry: H4 BD, M15 close below followed by M15 FOH.
Detailed Features and Options
1. Context and Setup table
The Context and Setup Table is the core feature of the TrendPredator PRO indicator. It delivers real-time interpretation of the multi-timeframe analysis based on an extensive underlying logic table with over 150 variations, specifically developed for this system and indicator. This logic is continuously updated and optimized to ensure accuracy and performance.
1.1. Developing Context
States for developing higher timeframe context are determined based on signals from the monthly, weekly, and daily timeframes.
- Green and Red indicate alignment and potentially interesting developing setups.
- Yellow signals a mixed or conflicting bias, suggesting caution when taking trades.
The specific states are:
- UT (yellow): Uptrend extended
- UT (green): Uptrend healthy
- REV (yellow): Reversal day counter trend
- REV (green): Reversal day mixed trend
- REV Cont (green): Reversal continuation mixed trend
- REV Cont (yellow): Reversal continuation counter trend
- REV into UT (green): Reversal day into uptrend
- REV Cont into UT (green): Reversal continuation into uptrend
- UT Pullback (yellow): Counter uptrend breakdown day
- Conflicting (yellow): Conflicting signals
- Consolidating (yellow): Consolidating sideways
- Inside (yellow): Trading inside after an inside week
- DT Pullback (yellow): Counter downtrend breakout day
- REV Cont into DT (red): Reversal continuation into downtrend
- REV into DT (red): Reversal day into downtrend
- REV Cont (yellow): Reversal continuation counter trend
- REV Cont (red): Reversal continuation mixed trend
- REV (red): Reversal day mixed trend
- REV (yellow): Reversal day countertrend
- DT (red): Downtrend healthy
- DT (yellow): Downtrend extended
Example: Uptrend
The Uptrend Context (UT, green) indicates a healthy uptrend with all timeframes aligning bullishly. In this case, the monthly is in a Fakeout Low (FOL) and currently inside the range, while the weekly and daily are both in Breakout (BO) states. This context is favorable for developing long setups in the direction of the trend.
Example: Uptrend pullback
The Uptrend Pullback Context (UT Pullback, yellow) indicates a Breakdown (BD) on the daily timeframe against a higher timeframe uptrend. In this case, the monthly is in a Fakeout Low (FOL) and currently inside its range, the weekly is in Breakout (BO) and also currently inside, while the daily is in Breakdown (BD). This context reflects a conflicting situation—potentially signaling either an early reversal back into the uptrend or, if the breakdown extends, the beginning of a possible trend change.
Example: Reversal into Uptrend
The Reversal into Uptrend Context (REV into UT, green) indicates a lower timeframe reversal aligning with a higher timeframe uptrend. In this case, the monthly is in Breakout (BO), the weekly is in Breakout (BO) and currently inside its range, while the daily is showing a bullish Fakeout Low (FOL) reversal. This context is potentially very favorable for long setups, as it signals a strong continuation of the uptrend supported across multiple timeframes.
Example: Reversal
The Bearish Reversal Context indicates a lower timeframe rollover within an ongoing higher timeframe uptrend. In this case, the monthly remains in Breakout (BO), the weekly has shifted into a Fakeout High (FOH) after three weeks of breakout longs, and the daily is already in Breakdown (BD). This context suggests a potentially favorable developing short setup, as early signs of weakness appear across timeframes.
1.2. Developing Setup
The states for specific setups are based on the context and the signals from the daily timeframe and H8, indicating that price is in the zone of alignment. The setup description refers to the state of the daily timeframe, while the suffix relates to the H8 timeframe. For example, "prev FOH Cont LHF" means that the previous day is in FOH (Fakeout High) relative to yesterday's breakout level, currently trading inside, and we are in an H8 breakdown, indicating a potential LHF (Lower High Formation) short trade if the entry confirms. The suffix HOD means that H8 is in FOH or BO (Breakout).
The specific states are:
- REV HOD (red): Reversal high of day
- REV Cont LHF (red): Reversal continuation low hanging fruit
- BO Cont LHF (green): Breakout continuation low hanging fruit
- BO Cont LOD (green): Breakout continuation low of day
- FOH Cont HOD (red): Fakeout high continuation high of day
- FOH Cont LHF ((red): Fakeout high continuation low hanging fruit
- prev BD Cont HOD (red): Previous breakdown continuation high of day
- prev BD Cont LHF (red): Previous breakdown continuation low hanging fruit
- prev FOH Cont HOD (red): Previous fakeout high continuation high of day
- prev FOH Cont LHF (red): Previous fakeout high continuation low hanging fruit
- prev FOL Cont LOD (green): Previous fakeout low continuation low of day
- prev FOL Cont LHF (green): Previous fakeout low continuation low hanging fruit
- prev BO Cont LOD (green): Previous breakout continuation low of day
- prev BO Cont LHF (green): Previous breakout continuation low hanging fruit
- FOL Cont LHF (green): Fakeout low continuation low hanging fruit
- FOL Cont LOD (green): Fakeout low continuation low of day
- BD Cont LHF (red): BD continuation low hanging fruit
- BD Cont LOD (red): Breakdown continuation low of day
- REV Cont LHF (green): Reversal continuation low hanging fruit
- REV LOD (green): Reversal low of day
- Inside: Trading inside after an inside day
Type: Indicates the situation of the indicated setup concerning:
- Trend: Following higher timeframe trend
- Mixed: Mixed higher timeframe signals
- Counter: Against higher timeframe bias
Quality: Indicates the quality of the indicated setup according to the specified logic table
No star: Very low quality
* One star: Low quality
** Two star: Medium quality
*** Three star: High quality
Example: Breakout Continuation Trend Setup
This setup highlights a healthy uptrend where the month is in a breakout, the week is in a fakeout low, and the day is in a breakout after a first green day. As the H8 breaks out to the upside, a long setup zone is triggered, presenting a breakout continuation low-hanging fruit trade. This is a trend trade in an overextended situation on the H8, with an H8 3L, resulting in an overall quality rating of one star.
Example: Fakeout Low Continuation Trend Setup
This setup shows a reversal into uptrend, with the month in a breakout, the week in a breakout, and the day in a fakeout low after breaking down the previous day and now reversing back up. As H8 breaks out to the upside, a long setup zone is triggered, presenting a previous fakeout low continuation, low-hanging fruit trade. This is a medium-quality trend trade.
Example: Reversal Setup - Mixed Trend
This setup shows a reversal setup in line with the weekly trend, with the month in a fakeout low, the week in a fakeout high, and the day in a fakeout high after breaking out earlier in the day and now reversing back down. As H8 loses the previous breakout level after 3 breakouts (with H8 3L), a short setup zone is triggered, presenting a fakeout high continuation at the high of the day. This is a high-quality trade in a mixed trend situation.
Setup Alerts:
Alerts can be activated for setups freshly triggered on the chart within your trading window.
Detailed filter logic for setup alerts:
- Setup quality: 1-3 star
- Setup type: Counter, Mixed and Trend
- Setup category: e.g. Reversal Bearish, Breakout, Previous Fakeout High
- 1D BO and First signals: 3DS, 3DL, FRD, FGD, ID
Options:
- Alerts on/ off
- Alert time window (from/ to)
- Alert filter customization
Note: To activate alerts from a script in TradingView, some settings need to be adjusted. Open the "Create Alert" dialog and select the option "Any alert() function call" in the "Condition" section. Choose "TrendPredator PRO" to ensure that alerts trigger properly from the code. Alerts can be activated for entire watchlists or individual pairs. Once activated, the alerts run in the background and notify the user whenever a setup is freshly triggered according to the filter settings.
2. Multi-Timeframe Table
Provides a real-time view of system signals, including:
Current Timeframe (Curr): Bias states.
- Breakout (green BO): Bullish after breaking above the previous high.
- Fakeout High (red FOH): Bearish after breaking above the previous high but pulling back down.
- Breakdown (red BD): Bearish after breaking below the previous low.
- Fakeout Low (green FOL): Bullish after breaking below the previous low but pulling back up.
- Inside (IS): Price trading neutral inside the previous range, taking the previous bias (color indicates the previous bias).
Previous Timeframe (Prev): Tracks last candle bias state and transitions dynamically.
- Bias for last candle: BO, FOH, BD, FOL in respective colors.
- Inside bar (yellow IS): Indicated as standalone signal.
Note: Also previous timeframes get constantly updated in real time to track the bias state in relation to the level that was hit. This means a BO can still lose the level and become a FOH, and vice versa, and a BD can still become a FOL, and vice versa. This is critical to see for example if traders that are trapped in that timeframe with a FOH or FOL are released. An inside bar stays fixed, though, since no level was hit in that timeframe.
Breakouts (BO): Breakout count 3 longs and 3 shorts.
- 3 Longs (red 3L): Bearish after three breakouts without hitting a previous low.
- 3 Shorts (green 3S): Bullish after three breakdowns without hitting a previous high.
First Countertrend Close (First): Tracks First Red or Green Day.
- First Green (G): After two consecutive red closes.
- First Red (R): After two consecutive green closes.
Options: Customizable font size and label colors.
3. Historic Highs and Lows
Displays historic highs and lows per timeframe for added context, enabling users to track sequences over time.
Timeframes: H4, H8, D, W, M
Options: Customize for timeframes shown, number of historic candles per timeframe, colors, formats, and labels.
4. Previous High and Low Extensions
Displays extended previous levels (high, low, and close) for each timeframe to assess how price trades relative to these levels.
H4: P4H, P4L, P4C
H8: P8H, P8L, P8C
Daily: PDH, PDL, PDC
Weekly: PWH, PWL, PWC
Monthly: PMH, PML, PMC
Options: Fully customizable for timeframes shown, colors, formats, and labels.
5. Breach Lines
Tracks live market reactions (e.g., breakouts or fakeouts) per timeframe for the last previous high or low that was hit, highlighting these levels originating at the breached candle to indicate bias (color-coded).
Red: Bearish below
Green: Bullish above
H4: 4FOL, 4FOH, 4BO, 4BD
H8: 8FOL, 8FOH, 8BO, 8BD
D: dFOL, dFOH, dBO, dBD
W: wFOL, wFOH, wBO, wBD
M: mFOL, mFOH, mBO, mBD
Options: Fully customizable for timeframes shown, colors, formats, and labels.
Overall Options:
Toggle single feature groups on/off.
Customize H8 open/close time as an offset to UTC to be provider independent.
Colour settings con be adjusted for dark or bright backgrounds.
Higher Timeframe Use Case Examples
Example Use Case: Weekly Template Analysis
The Weekly Template is a core concept in Stacey Burke’s trading style. The analysis is conducted on the daily timeframe, focusing on the higher timeframe bias and identifying overextended conditions within the week—such as multiple breakouts and peak formations signaling potential reversals.
In this example, the candles are colored by the TrendPredator FO indicator, which highlights the state of individual candles. This allows for precise evaluation of both the trend state and the developing weekly template. It is a valuable tool for thesis generation before a trading session and for backtesting purposes.
Example Use Case: High Timeframe 5-Star Setup Analysis (Stacey Burke "ain't coming back" ACB Template)
This analysis identifies high-probability trade opportunities when daily breakout or breakdown closes occur near key monthly levels mid-week, signaling overextensions and potentially large parabolic moves. The key signal to look for is a breakout or breakdown close on a Wednesday. This is useful for thesis generation before a session and also for backtesting.
In this example, the TrendPredator FO indicator colors the candles to highlight individual candle states, particularly those that close in breakout or breakdown. Additionally, an indicator is shown on the chart shading every Wednesday, making it easier to visually identify the signals.
5 Star Alerts:
Alerts can be activated for this potential 5-Star setup constellation. The alert is triggered when there is a breakout or breakdown close on a Wednesday.
Further recommendations:
- Higher timeframe context: TPO or volume profile indicators can be used to gain an even better overview.
- Late session trading: Entries later in the session, such as during the 3rd hour of the NY session, offer better analysis and follow-through on setups.
- Entry confirmation: Momentum indicators like VWAP, Supertrend, or EMA are helpful for increasing precision. Additionally, tracking lower timeframe fakeouts can provide powerful confluence. To track those the TrendPredator Fakeout Highlighter (FO), that has been specifically developed for this can be of great help:
Limitations:
Data availability using TradingView has its limitations. The indicator leverages only the real-time data available for the specific timeframe being used. This means it cannot access data from timeframes lower than the one displayed on the chart. For example, if you are on a daily chart, it cannot use H8 data. Additionally, on very low timeframes, the historical availability of data might be limited, making higher timeframe signals unreliable.
To address this, the indicator automatically hides the affected columns in these specific situations, preventing false signals.
Disclaimer
This indicator is for educational purposes only and does not guarantee profits.
None of the information provided shall be considered financial advice.
The indicator does not provide final buy or sell signals but highlights zones for potential setups.
Users are fully responsible for their trading decisions and outcomes.
在腳本中搜尋"bear"
Custom RSI & MACD Momentum Entry SignalsIndicator Explanation: Custom RSI & MACD Momentum Entry Signals
Introduction
The "Custom RSI & MACD Momentum Entry Signals" indicator combines the Relative Strength Index (RSI) and the Moving Average Convergence Divergence (MACD) to generate precise long and short entry signals. This indicator offers a powerful combination of overbought/oversold zones, momentum analysis, and RSI-EMA crossovers to assist traders in making better decisions.
How the Indicator Works
1. RSI Calculation and EMA
The RSI is calculated based on the closing price with an adjustable period (default: 14).
An Exponential Moving Average (EMA) of the RSI (default: 9) is plotted to identify RSI trend changes.
When the RSI crosses its EMA upwards, it signals a bullish impulse. Conversely, a downward cross indicates a bearish impulse.
2. MACD Calculation and Momentum Shifts
The MACD line is derived from the difference between a fast EMA (default: 12) and a slow EMA (default: 26).
The Signal line is the EMA of the MACD line (default: 9).
The MACD histogram represents the difference between the MACD line and the Signal line.
Momentum shifts are detected as follows:
Weakening Bearish: Histogram is negative but increasing (less bearish pressure).
Strengthening Bullish: Histogram is positive and rising.
Weakening Bullish: Histogram is positive but decreasing.
Strengthening Bearish: Histogram is negative and falling.
Signal Generation
Long Signals
A Long signal is triggered when all of the following conditions are met:
The RSI was previously below 30 (oversold condition).
MACD momentum shifts from "strengthening bearish" to "weakening bearish" or turns bullish.
The RSI crosses its EMA upwards.
A green upward arrow is displayed below the bar, and the background is lightly shaded green for additional visualization.
Short Signals
A Short signal is triggered when all of the following conditions are met:
The RSI was previously above 70 (overbought condition).
MACD momentum shifts from "strengthening bullish" to "weakening bullish" or turns bearish.
The RSI crosses its EMA downwards.
A red downward arrow is displayed above the bar, and the background is lightly shaded red for additional visualization.
Visual Elements
RSI and EMA:
The RSI is shown in purple.
The RSI EMA is shown in blue.
Horizontal lines at 30 (oversold) and 70 (overbought) provide additional context.
MACD:
The MACD line is displayed in blue.
The Signal line is displayed in orange.
The zero line is added for easier interpretation.
Signals:
Green arrows: Long signals.
Red arrows: Short signals.
Background color: Light green for long conditions, light red for short conditions.
Use Cases
This indicator is ideal for:
Trend Followers: Combining RSI and MACD allows traders to identify entry points during impulsive trend shifts.
Swing Traders: Long and short signals can be used at reversal points to capture short-term price movements.
Momentum Traders: By considering MACD momentum, the indicator provides additional confidence in signal generation.
Customizable Settings
The indicator provides flexible input options:
RSI Period (default: 14)
RSI EMA Period (default: 9)
MACD Parameters: Fast, slow, and signal EMAs can be adjusted.
Conclusion
The Custom RSI & MACD Momentum Entry Signals indicator is a powerful tool for traders looking to combine RSI and MACD to identify high-probability entry signals. With clear visualization and precise signal generation, traders can make decisions more efficiently and capitalize on market movements.
SMCL - Trend Change StructuresSMCL Indicator - Detailed Functionality
The SMCL (Structure Market Change Levels) indicator is designed to help traders visually detect and analyze changes in market structure. It focuses on identifying key pivot points and possible trend reversals by marking Change of Character (CHoCH) signals and calculating important levels like Premium and Discount zones.
Key Features:
Bullish and Bearish Structure Detection: Marks key trend changes on the chart using price pivots, with options to display only bullish or bearish structures.
Premium and Discount Zones Visualization: Identifies areas where the price may be in an overbought (Premium) or oversold (Discount) zone.
Win Rate Calculation: Calculates and displays the win rate on the chart to help you assess the indicator's effectiveness in real-time.
Full Customization: Adjust the colors of the structures and Premium/Discount zones to match your analysis style.
How to Use:
Bullish Structures: Look for CHoCH labels above recent highs indicating a potential shift to an uptrend.
Bearish Structures: Watch for CHoCH labels below recent lows indicating a potential shift to a downtrend.
Premium/Discount Levels: Use these zones to identify potential overbought or oversold conditions, ideal for planning entries or exits.
Win Rate: Monitor the win rate to gauge the reliability of the indicator over time.
This indicator is ideal for both intraday traders and swing traders looking for a simple yet powerful tool to identify market trend changes. Try it out and improve your trading decisions!
Technical Details:
1. Inputs:
Structure Period (prd): Defines the lookback period for detecting significant highs and lows (pivots). A higher period will consider a broader price range, identifying more prominent structures.
Response Period (resp): Determines how reactive the indicator is to recent price movements, affecting how quickly new structures are identified.
Show Bullish Structure (bull): A toggle to display bullish (uptrend) market structures on the chart.
Show Bearish Structure (bear): A toggle to display bearish (downtrend) market structures on the chart.
Show Premium & Discount (showPD): When enabled, the indicator will draw Premium (overbought) and Discount (oversold) levels on the chart.
2. Colors:
Bullish Color (bullColor): The color used to highlight bullish market structures.
Bearish Color (bearColor): The color used to highlight bearish market structures.
Premium Color (premColor): The color used to display the Premium (overbought) level.
Discount Color (discColor): The color used to display the Discount (oversold) level.
3. Structure Detection:
High and Low Pivot Points (Up, Dn): The indicator continuously tracks the highest and lowest prices over the specified structure period (prd). These pivot points are used to identify potential trend changes.
Change of Character (CHoCH) Detection:
When a new high is detected (Up > previous Up), it signifies a potential bullish trend change. A label with "CHoCH" is placed on the chart, if bullish structures are enabled.
Similarly, when a new low is detected (Dn < previous Dn), it signifies a potential bearish trend change. A "CHoCH" label is placed if bearish structures are enabled.
4. Premium & Discount Levels:
Premium Level (PremiumTop): Calculated as 10% below the detected high pivot. It represents a zone where the price may be considered overbought, suggesting a possible reversal or pullback.
Discount Level (DiscountTop): Calculated as 10% above the detected low pivot. It represents a zone where the price may be considered oversold, suggesting a possible buying opportunity.
These levels are drawn on the chart if the showPD option is enabled, helping traders visually assess the market's condition.
5. Probability Calculation:
Win Rate Calculation (WinRate): The indicator tracks the number of times the market structure changes from bullish to bearish and vice versa. It calculates the win rate as the ratio of bullish to bearish changes, providing insight into the strength of the detected structures.
This win rate is displayed on the chart in the latest bar, giving a real-time assessment of the indicator's performance.
6. Display Options:
The indicator offers full customization of colors and visibility for different components, allowing traders to tailor the visuals to their preferences.
Labels and lines are drawn with a 50% opacity by default, making them less intrusive while still visible on the chart.
Three Anchored Moving Averages (VWAP / SMA / EMA)
This indicator allows users to anchor three types of moving averages (Simple Moving Average (SMA), Exponential Moving Average (EMA), and Volume Weighted Average Price (VWAP)) to specific points in time (anchor points)
Key Features:
Select from three Moving Average Types:
Simple Moving Average (SMA): Averages the closing prices over a specified period.
Exponential Moving Average (EMA): Gives more weight to recent prices, making it more responsive to new information.
Volume Weighted Average Price (VWAP): Averages the price weighted by volume, useful for understanding the average price at which the asset has traded over a period.
Up to Three Anchor Points:
Users can set up to three different anchor points to calculate the moving averages from specific dates and times. This allows for analysis of price action starting from significant points or specific events. For example, you can anchor to the low and high of a move to identify key levels or to points where the price takes off from a previous anchored MA.
Customisable Sentiment Options:
Each anchor point can be associated with a sentiment input (Auto, Bull, Bear, None), which influences if the MAs are displayed as lines or zones/bands:
Auto: Automatically determines the sentiment based on whether anchor points are on pivot highs and lows. If anchored to a pivot high, the system will assume a bearish sentiment and display a red band or zone between the MA OHLC4 and High. Anchoring to a pivot low will display a green band (OHLC4 - Low).
Bull: Forces a bullish sentiment (Green Band - OHLC4 to Low)
Bear: Forces a bearish sentiment (Red Band - OHLC4 to High)
None: Ignores sentiment and displays a single line (OHLC4)
Chart Matching:
The indicator includes an option to display the moving averages only if the chart symbol matches a specified ticker. This feature ensures that the indicator is relevant to the specific asset being analysed.
How to Use the Indicator:
1. Set Anchor Points: When added to your chart, select three anchor points by point and click. If you only wish to anchor to a single point, click on that point three times and disable the other two in settings once the indicator is applied.
2. Select Moving Average Type: Choose between SMA, EMA, or VWAP using the dropdown menu. EMAs are the most responsive.
3. Enable/Disable Anchor Points: Use the checkboxes to enable or disable each anchor point.
4. Select Sentiment Type: Choose between Auto, Bull, Bear, or None.
5. Chart Matching: Optionally, specify a chart symbol to restrict the indicator's display to that particular asset.
6. Interpret the Plots: The indicator plots the high, mid, and low values of the selected moving average type from each anchor point. The fills between these plots help identify potential support and resistance zones. These should be used as points of interest for pullback reversals or potential continuation if the price breaks through.
Practical Applications:
Trend Analysis: Identify the overall trend direction from specific historical points.
Support and Resistance: Determine key dynamic support and resistance levels based on anchored moving averages.
Event-Based Analysis: Anchor the moving averages to significant events (e.g., earnings releases, economic data) to study their impact on price trends.
Multi Timeframe Analysis: Higher Timeframe Anchors can be used to identify longer term trend analysis. Switching to a lower timeframe for execution triggers at these points wont distort the MA levels as they are anchored to a specific point in time
Intraday or Swing Trading: trend analysis using anchor points can be used for any style of trading (Intraday / Swing / Invest). Use anchored levels as points of interest and wait for hints in price action to try and catch the next move.
Fibo Level DailyOverview
The "Fibo Level Daily" strategy is designed for trading Bitcoin (BTC) using the 1-hour timeframe. This strategy relies on Fibonacci levels calculated from the previous day's range and determines entry and exit points based on whether the previous daily candle was bullish or bearish.
How It Works
Fibonacci Levels Calculation:
The indicator calculates Fibonacci levels (0.8, 0.5, and 0.2) based on the high and low of the previous day.
The levels are calculated as follows:
0.8: This level is calculated by multiplying the difference between the previous day's high and low by 0.8 and adding the result to the previous day's low.
0.5: This is the midpoint of the previous day's range.
0.2: This level is calculated by multiplying the difference between the previous day's high and low by 0.2 and adding the result to the previous day's low.
Identifying the Previous Day's Trend:
The indicator checks if the previous daily candle closed bullish (close greater than open) or bearish (close less than open).
Setting Entry and Take Profit Levels:
If the previous daily candle was bearish:
Sell Entry: Wait for the price to rise to the 0.5 level (midpoint of the previous day's range) to enter a sell position.
Take Profit: The profit target is set at the 0.2 level.
If the previous daily candle was bullish:
Buy Entry: Wait for the price to drop to the 0.5 level (midpoint of the previous day's range) to enter a buy position.
Take Profit: The profit target is set at the 0.8 level.
Visual Representation on the Chart:
The indicator draws horizontal lines on the chart representing the Fibonacci levels (0.8, 0.5, and 0.2) from the previous day. These lines help visualize entry and exit points clearly.
Additionally, the last 15 minutes of the daily session are highlighted with a light red background to indicate the session's end.
Conditions of Use:
Timeframe: This indicator is specifically designed for use on the 1-hour timeframe.
Assets: While it can be used on any asset, it is optimized for trading Bitcoin (BTC).
Steps to Use the Indicator
Add the Indicator:
Insert the "Fibo Level Daily" indicator script into your trading platform (such as TradingView).
Select Timeframe:
Change the chart timeframe to 1 hour.
Interpret the Levels:
Observe the horizontal lines drawn on the chart representing the Fibonacci levels.
Identify whether the previous daily candle was bullish or bearish.
Wait for the Entry Price:
For a bearish previous daily candle: Wait for the price to rise to the 0.5 level to enter a sell position.
For a bullish previous daily candle: Wait for the price to drop to the 0.5 level to enter a buy position.
Set the Profit Target:
For a sell: Set your profit target at the 0.2 level.
For a buy: Set your profit target at the 0.8 level.
Execute the Trade:
Initiate the trade once the price reaches the entry level and set your take profit according to the identified trend from the previous day.
Conclusion
The "Fibo Level Daily" strategy provides a clear and precise methodology for identifying entry and exit points in Bitcoin using Fibonacci levels. By following this step-by-step guide, any trader can take advantage of market movements based on the previous day's price action, optimizing their trading opportunities on the 1-hour timeframe.
MTF Market Structure - SMC IndicatorsThe Multi Timeframe Market Structure helps understand and identify bullish or bearish Market Structure by highlighting “KEY” Highs and Lows. It also identifies changes in market direction by identifying a “Shift in Market Structure” (See Point 2 below) or “Break in Market Structure” (See Point 3 Below).
What are Key Highs and Lows?
Not every high or low is a “Key” high or low. “Key” highs and lows are specific highs and lows that form the structure of the market and have significance in understanding the current trend in the market (see point 1 below).
The indicator identifies these “Key” highs and lows on multiple time frames, allowing the trader to keep a perspective of the Market Structure with multiple timeframes simultaneously (see point 5 below).
The key highs and lows identified by the indicator are as follows:
Key Lows : Identify significant Swing Lows, Short-term lows “STL”, Intermediate-Term Lows “ITL”, and Long-Term Lows “LTL”.
Key Highs : Identify significant Swing Highs, Short-term highs “STH”, Intermediate-Term Highs “ITH”, and Long-Term Highs “LTH”.
Significant Swing High : This is a price swing with one lower candle to the right and one lower candle to the left of it.
Significant Swing Low : This is a price swing with one higher candle to the right and one higher candle to the left of it.
Short-Term High “STH” is a price swing with one lower Significant Swing High to the right and one lower Significant Swing High to the left of it.
Short-Term Low “STL” is a price swing with one higher Significant Swing Low to the right and one higher Significant Swing Low to the left of it.
Intermediate-Term High “ITH” is a price swing with one lower STH to the right and one lower STH to the left of it.
Intermediate-Term Low “ITL” is a price swing with one higher STL to the right and one higher STL to the left of it.
Long-Term High “LTH” is a price swing with one lower ITH to the right and one lower ITH to the left of it.
Long-Term Low “ITL” is a price swing with one higher ITL to the right and one higher ITL to the left of it.
By identifying key highs and lows using the Market Structure Indicator, it can be used in multiple ways by using those reference points as follows:
1. Identifying Market Trends by Connecting Key Highs and Lows.
Bullish trend identification is when the indicator is making higher ITLs and ITHs.
Bearish Trend identification when the indicator is making lower ITLs and ITHs.
PS: it’s essential to understand the underlying market trend on multiple timeframes to use the next features correctly. Always use the Shifts and Breaks in Market Structures in line with the 1H or higher timeframes Market Trend for higher probability trade opportunities. This is because, generally, higher timeframes have more importance than lower timeframes.
2. Shift In Market Structure - SMS for Entries
A Shift in Market Structure “SMS” identifies potential reversal in short-term market trend relative to the timeframe where the SMS is identified.
This occurs after a run of any Significant Swing High or Low and then reversing, creating a Fair Value Gap “FVG”.
There can be Bullish and Bearish Market Structure Shifts.
When a Bullish Shift in Market Structure occurs, the indicator identifies an opportunity for the price to change from Bearish to Bullish, as seen in the image below.
When a Bearish Shift in Market Structure occurs, the indicator identifies an opportunity for the price to change from Bullish to Bearish.
3. Break In Market Structure - BMS for Entries
A Break in Market Structure “BMS” has a similar function to the Shift in Market Structure “SMS”; however, when it occurs, it identifies a potential longer-term trend reversal (compared to the SMS) relative to the timeframe where the BMS is identified.
Unlike “SMS”, the BMS occurs after a run only after a run on Key Highs or Lows.
Similar to the SMS, there can be Bullish and Bearish Breaks in Market Structure.
When a Bullish Break in Market Structure occurs, the indicator identifies an opportunity for a longer-term trend change from Bearish to Bullish, as seen in the image below.
The FVG must occur in the lower 50% of the impulse price leg (at Discount).
When a Bearish Break in Market Structure occurs, the indicator identifies an opportunity for a longer-term trend change from Bullish to Bearish.
The FVG must occur in the upper 50% of the impulse price leg (at Premium).
4. Inversion Break and Shift in Market Structure for Early Entries
Inversion “BMS” and “SMS” are similar to the normal SMS and BMS, but they occur:
Bullish: When the FVG of the Bearish BMS/SMS forms in the lower 50% of the impulse price leg (at Discount).
We use the FVG that forms from the Bearish SMS/BMS as an inversion FVG for potential entry after market trend change from Bearish to Bullish.
Bearish: When the FVG of the Bullish BMS/SMS forms in the upper 50% of the impulse price leg (at Premium).
We use the FVG that forms from the Bullish SMS/BMS as an inversion FVG for potential entry after market trend change from Bullish to Bearish.
5. Multi Time Frame analysis
The indicator allows multiple timeframe perspectives to be considered when using it.
The key Highs and Lows have significance not only on the current timeframe they are identified but also on lower or higher timeframes simultaneously.
This is because a ITL/ITH on the 1H means
It’s a LTL/LTH on one or more timeframes lower (15Min, 5M, and 1Min).
And at the same time, it’s a STL/STH on one timeframe higher (4H)
Also, it’s a Significant Low/High (marked with a dot) on two timeframes higher (Daily).
The same logic applies to all other Key Highs and Lows.
Another example is a Significant Low/High (swing marked with a dot below or above it) on the current timeframe (1D) means it’s a STL/STH on one timeframe lower (4H) and an ITL/ITH on two timeframes lower (1H) and a LTH/LTH on three timeframes lower or more (15M, 5M, 1Min, 30 Seconds, etc…).
This Multi-time frame analysis is a great way to help traders understand Market Structure and Market trend on multiple timeframes simultaneously, and it also assists in Top-down analysis.
PS: Note that this multi-timeframe analysis approach and logic can be applied to any timeframe and for any type of trading (swing trading, day trading, scalping, or short-term trading) because the price is fractal.
For example, if a trader is a swing trader, then it’s best to identify trader opportunities on the 1H or higher; however, lower timeframes Market Structure can still be used to help the traders refine their entries and target key highs and lows in the opposite direction.
If a trader is a day trader or a scalper, the trader could use Market Structure on 15M or lower to identify trader opportunities and target key highs and lows in the opposite direction.
6. Setting Targets
The indicator can also be used to identify potential targets after the SMS or BMS occurs. Targets can be chosen above Key Highs or Lows depending on the trade objective and timeframe where the trade idea is identified.
Bonus Features
Highlight Market Structure Trend
This feature is an excellent backtesting visual tool to look at changes in market trends highlighted in colours. These changes are based on the Shift or Break in of Market Structure depending on the selection option.
When "Shift/Break" in Market Structure" is selected, a Bullish trend is highlighted in blue when a Bullish Shift/Break in Market Structure Occurs and in Red when a Bearish Shift/Break in Market Structure Occurs.
Notifications
Sends notifications when there is a Shift or Break in Market Structure on the current timeframe of choice.
Multi Timeframe Trend StrengthThis code is an advancement of my previous percentile-based trend strength. It follows the same concept, except this code display the trend and trend strength in multiple timeframe (1 min, 5 min, 15 min, 1hr and 4hr).
This gives an indication of the trend is evolving and allows to see how short-term trend matches with the long-term trend.
How it works:
The script assesses trend strength through percentile values derived from high and low prices across various time periods. It categorizes the current trend as either Bullish, Bearish, or N/A (No Trend) with the following steps:
Percentile Calculations: The code calculates the 75th percentile of high prices (e.g., percentile_13H) and the 25th percentile of low prices (e.g., percentile_13L) for specified Fibonacci-based periods (13, 21, 34, 55, 89, and 144). These percentiles serve as thresholds for identifying strong trends.
Calculate Highest High and Lowest Low: It computes the highest high (75th percentile high price of the longest period) and lowest low (25th percentile low price of the longest period), referred to as highest_high and lowest_low. These values establish critical price levels.
Trend Strength Conditions: For each percentile and period, the code checks if the percentile exceeds the highest high (trendBull) or falls below the lowest low (trendBear). These conditions gauge the strength of bullish and bearish trends.
Count Bull and Count Bear: Variables countBull and countBear tally the number of bullish and bearish conditions met, helping assess trend strength.
Weak Bull and Weak Bear Count: The code calculates weak bullish and bearish conditions, occurring when percentiles fall within the range defined by highest_high and lowest_low but don't meet strong trend criteria.
Bull Strength and Bear Strength: bullStrength and bearStrength are calculated based on counts of bullish, bearish, weak bullish, and weak bearish conditions, representing overall trend strength.
Strong Bull and Bear Conditions: These conditions arise when the 75th percentile of high prices (bull conditions) or the 25th percentile of low prices (bear conditions) surpass or dip below the highest high or lowest low, respectively, for the specified period. Strong conditions indicate robust trends with significant price movements.
Weak Bull and Bear Conditions: Weak conditions occur when percentiles fall within the range between highest_high and lowest_low, suggesting some bullish or bearish tendencies without reaching extreme levels. These imply less decisive trends.
Current Trend Identification: The current trend is determined by comparing bullStrength and bearStrength. A greater bullStrength indicates a Bull trend, greater bearStrength implies a Bear trend, and equal values denote No Trend (N/A).
Adaptive Candlestick Pattern Recognition System█ INTRODUCTION
Nearly three years in the making, intermittently worked on in the few spare hours of weekends and time off, this is a passion project I undertook to flesh out my skills as a computer programmer. This script currently recognizes 85 different candlestick patterns ranging from one to five candles in length. It also performs statistical analysis on those patterns to determine prior performance and changes the coloration of those patterns based on that performance. In searching TradingView's script library for scripts similar to this one, I had found a handful. However, when I reviewed the ones which were open source, I did not see many that truly captured the power of PineScrypt or leveraged the way it works to create efficient and reliable code; one of the main driving factors for releasing this 5,000+ line behemoth open sourced.
Please take the time to review this description and source code to utilize this script to its fullest potential.
█ CONCEPTS
This script covers the following topics: Candlestick Theory, Trend Direction, Higher Timeframes, Price Analysis, Statistic Analysis, and Code Design.
Candlestick Theory - This script focuses solely on the concept of Candlestick Theory: arrangements of candlesticks may form certain patterns that can potentially influence the future price action of assets which experience those patterns. A full list of patterns (grouped by pattern length) will be in its own section of this description. This script contains two modes of operation for identifying candlestick patterns, 'CLASSIC' and 'BREAKOUT'.
CLASSIC: In this mode, candlestick patterns will be identified whenever they appear. The user has a wide variety of inputs to manipulate that can change how certain patterns are identified and even enable alerts to notify themselves when these patterns appear. Each pattern selected to appear will have their Profit or Loss (P/L) calculated starting from the first candle open succeeding the pattern to a candle close specified some number of candles ahead. These P/L calculations are then collected for each pattern, and split among partitions of prior price action of the asset the script is currently applied to (more on that in Higher Timeframes ).
BREAKOUT: In this mode, P/L calculations are held off until a breakout direction has been confirmed. The user may specify the number of candles ahead of a pattern's appearance (from one to five) that a pattern has to confirm a breakout in either an upward or downward direction. A breakout is constituted when there is a candle following the appearance of the pattern that closes above/at the highest high of the pattern, or below/at its lowest low. Only then will percent return calculations be performed for the pattern that's been identified, and these percent returns are broken up not only by the partition they had appeared in but also by the breakout direction itself. Patterns which do not breakout in either direction will be ignored, along with having their labels deleted.
In both of these modes, patterns may be overridden. Overrides occur when a smaller pattern has been detected and ends up becoming one (or more) of the candles of a larger pattern. A key example of this would be the Bearish Engulfing and the Three Outside Down patterns. A Three Outside Down necessitates a Bearish Engulfing as the first two candles in it, while the third candle closes lower. When a pattern is overridden, the return for that pattern will no longer be tracked. Overrides will not occur if the tail end of a larger pattern occurs at the beginning of a smaller pattern (Ex: a Bullish Engulfing occurs on the third candle of a Three Outside Down and the candle immediately following that pattern, the Three Outside Down pattern will not be overridden).
Important Functionality Note: These patterns are only searched for at the most recently closed candle, not on the currently closing candle, which creates an offset of one for this script's execution. (SEE LIMITATIONS)
Trend Direction - Many of the patterns require a trend direction prior to their appearance. Noting TradingView's own publication of candlestick patterns, I utilize a similar method for determining trend direction. Moving Averages are used to determine which trend is currently taking place for candlestick patterns to be sought out. The user has access to two Moving Averages which they may individually modify the following for each: Moving Average type (list of 9), their length, width, source values, and all variables associated with two special Moving Averages (Least Squares and Arnaud Legoux).
There are 3 settings for these Moving Averages, the first two switch between the two Moving Averages, and the third uses both. When using individual Moving Averages, the user may select a 'price point' to compare against the Moving Average (default is close). This price point is compared to the Moving Average at the candles prior to the appearance of candle patterns. Meaning: The close compared to the Moving Average two candles behind determines the trend direction used for Candlestick Analysis of one candle patterns; three candles behind for two candle patterns and so on. If the selected price point is above the Moving Average, then the current trend is an 'uptrend', 'downtrend' otherwise.
The third setting using both Moving Averages will compare the lengths of each, and trend direction is determined by the shorter Moving Average compared to the longer one. If the shorter Moving Average is above the longer, then the current trend is an 'uptrend', 'downtrend' otherwise. If the lengths of the Moving Averages are the same, or both Moving Averages are Symmetrical, then MA1 will be used by default. (SEE LIMITATIONS)
Higher Timeframes - This script employs the use of Higher Timeframes with a few request.security calls. The purpose of these calls is strictly for the partitioning of an asset's chart, splitting the returns of patterns into three separate groups. The four inputs in control of this partitioning split the chart based on: A given resolution to grab values from, the length of time in that resolution, and 'Upper' and 'Lower Limits' which split the trading range provided by that length of time in that resolution that forms three separate groups. The default values for these four inputs will partition the current chart by the yearly high-low range where: the 'Upper' partition is the top 20% of that trading range, the 'Middle' partition is 80% to 33% of the trading range, and the 'Lower' partition covers the trading range within 33% of the yearly low.
Patterns which are identified by this script will have their returns grouped together based on which partition they had appeared in. For example, a Bullish Engulfing which occurs within a third of the yearly low will have its return placed separately from a Bullish Engulfing that occurred within 20% of the yearly high. The idea is that certain patterns may perform better or worse depending on when they had occurred during an asset's trading range.
Price Analysis - Price Analysis is a major part of this script's functionality as it can fundamentally change how patterns are shown to the user. The settings related to Price Analysis include setting the number of candles ahead of a pattern's appearance to determine the return of that pattern. In 'BREAKOUT' mode, an additional setting allows the user to specify where the P/L calculation will begin for a pattern that had appeared and confirmed. (SEE LIMITATIONS)
The calculation for percent returns of patterns is illustrated with the following pseudo-code (CLASSIC mode, this is a simplified version of the actual code):
type patternObj
int ID
int partition
type returnsArray
float returns
// No pattern found = na returned
patternObj TEST_VAL = f_FindPattern()
priorTestVal = TEST_VAL
if not na( priorTestVal )
pnlMatrixRow = priorTestVal.ID
pnlMatrixCol = priorTestVal.partition
matrixReturn = matrix.get(PERCENT_RETURNS, pnlMatrixRow, pnlMatrixCol)
percentReturn = ( (close - open ) / open ) * 100%
array.push(matrixReturn.returns, percentReturn)
Statistic Analysis - This script uses Pine's built-in array functions to conduct the Statistic Analysis for patterns. When a pattern is found and its P/L calculation is complete, its return is added to a 'Return Array' User-Defined-Type that contains numerous fields which retain information on a pattern's prior performance. The actual UDT is as follows:
type returnArray
float returns = na
int size = 0
float avg = 0
float median = 0
float stdDev = 0
int polarities = na
All values within this UDT will be updated when a return is added to it (some based on user input). The array.avg , array.median and array.stdev will be ran and saved into their respective fields after a return is placed in the 'returns' array. The 'polarities' integer array is what will be changed based on user input. The user specifies two different percentages that declare 'Positive' and 'Negative' returns for patterns. When a pattern returns above, below, or in between these two values, different indices of this array will be incremented to reflect the kind of return that pattern had just experienced.
These values (plus the full name, partition the pattern occurred in, and a 95% confidence interval of expected returns) will be displayed to the user on the tooltip of the labels that identify patterns. Simply scroll over the pattern label to view each of these values.
Code Design - Overall this script is as much of an art piece as it is functional. Its design features numerous depictions of ASCII Art that illustrate what is being attempted by the functions that identify patterns, and an incalculable amount of time was spent rewriting portions of code to improve its efficiency. Admittedly, this final version is nearly 1,000 lines shorter than a previous version (one which took nearly 30 seconds after compilation to run, and didn't do nearly half of what this version does). The use of UDTs, especially the 'patternObj' one crafted and redesigned from the Hikkake Hunter 2.0 I published last month, played a significant role in making this script run efficiently. There is a slight rigidity in some of this code mainly around pattern IDs which are responsible for displaying the abbreviation for patterns (as well as the full names under the tooltips, and the matrix row position for holding returns), as each is hard-coded to correspond to that pattern.
However, one thing I would like to mention is the extensive use of global variables for pattern detection. Many scripts I had looked over for ideas on how to identify candlestick patterns had the same idea; break the pattern into a set of logical 'true/false' statements derived from historically referencing candle OHLC values. Some scripts which identified upwards of 20 to 30 patterns would reference Pine's built-in OHLC values for each pattern individually, potentially requesting information from TradingView's servers numerous times that could easily be saved into a variable for re-use and only requested once per candle (what this script does).
█ FEATURES
This script features a massive amount of switches, options, floating point values, detection settings, and methods for identifying/tailoring pattern appearances. All modifiable inputs for patterns are grouped together based on the number of candles they contain. Other inputs (like those for statistics settings and coloration) are grouped separately and presented in a way I believe makes the most sense.
Not mentioned above is the coloration settings. One of the aims of this script was to make patterns visually signify their behavior to the user when they are identified. Each pattern has its own collection of returns which are analyzed and compared to the inputs of the user. The user may choose the colors for bullish, neutral, and bearish patterns. They may also choose the minimum number of patterns needed to occur before assigning a color to that pattern based on its behavior; a color for patterns that have not met this minimum number of occurrences yet, and a color for patterns that are still processing in BREAKOUT mode.
There are also an additional three settings which alter the color scheme for patterns: Statistic Point-of-Reference, Adaptive coloring, and Hard Limiting. The Statistic Point-of-Reference decides which value (average or median) will be compared against the 'Negative' and 'Positive Return Tolerance'(s) to guide the coloration of the patterns (or for Adaptive Coloring, the generation of a color gradient).
Adaptive Coloring will have this script produce a gradient that patterns will be colored along. The more bullish or bearish a pattern is, the further along the gradient those patterns will be colored starting from the 'Neutral' color (hard lined at the value of 0%: values above this will be colored bullish, bearish otherwise). When Adaptive Coloring is enabled, this script will request the highest and lowest values (these being the Statistic Point-of-Reference) from the matrix containing all returns and rewrite global variables tied to the negative and positive return tolerances. This means that all patterns identified will be compared with each other to determine bullish/bearishness in Adaptive Coloring.
Hard Limiting will prevent these global variables from being rewritten, so patterns whose Statistic Point-of-Reference exceed the return tolerances will be fully colored the bullish or bearish colors instead of a generated gradient color. (SEE LIMITATIONS)
Apart from the Candle Detection Modes (CLASSIC and BREAKOUT), there's an additional two inputs which modify how this script behaves grouped under a "MASTER DETECTION SETTINGS" tab. These two "Pattern Detection Settings" are 'SWITCHBOARD' and 'TARGET MODE'.
SWITCHBOARD: Every single pattern has a switch that is associated with its detection. When a switch is enabled, the code which searches for that pattern will be run. With the Pattern Detection Setting set to this, all patterns that have their switches enabled will be sought out and shown.
TARGET MODE: There is an additional setting which operates on top of 'SWITCHBOARD' that singles out an individual pattern the user specifies through a drop down list. The names of every pattern recognized by this script will be present along with an identifier that shows the number of candles in that pattern (Ex: " (# candles)"). All patterns enabled in the switchboard will still have their returns measured, but only the pattern selected from the "Target Pattern" list will be shown. (SEE LIMITATIONS)
The vast majority of other features are held in the one, two, and three candle pattern sections.
For one-candle patterns, there are:
3 — Settings related to defining 'Tall' candles:
The number of candles to sample for previous candle-size averages.
The type of comparison done for 'Tall' Candles: Settings are 'RANGE' and 'BODY'.
The 'Tolerance' for tall candles, specifying what percent of the 'average' size candles must exceed to be considered 'Tall'.
When 'Tall Candle Setting' is set to RANGE, the high-low ranges are what the current candle range will be compared against to determine if a candle is 'Tall'. Otherwise the candle bodies (absolute value of the close - open) will be compared instead. (SEE LIMITATIONS)
Hammer Tolerance - How large a 'discarded wick' may be before it disqualifies a candle from being a 'Hammer'.
Discarded wicks are compared to the size of the Hammer's candle body and are dependent upon the body's center position. Hammer bodies closer to the high of the candle will have the upper wick used as its 'discarded wick', otherwise the lower wick is used.
9 — Doji Settings, some pulled from an old Doji Hunter I made a while back:
Doji Tolerance - How large the body of a candle may be compared to the range to be considered a 'Doji'.
Ignore N/S Dojis - Turns off Trend Direction for non-special Dojis.
GS/DF Doji Settings - 2 Inputs that enable and specify how large wicks that typically disqualify Dojis from being 'Gravestone' or 'Dragonfly' Dojis may be.
4 Settings related to 'Long Wick Doji' candles detailed below.
A Tolerance for 'Rickshaw Man' Dojis specifying how close the center of the body must be to the range to be valid.
The 4 settings the user may modify for 'Long Legged' Dojis are: A Sample Base for determining the previous average of wicks, a Sample Length specifying how far back to look for these averages, a Behavior Setting to define how 'Long Legged' Dojis are recognized, and a tolerance to specify how large in comparison to the prior wicks a Doji's wicks must be to be considered 'Long Legged'.
The 'Sample Base' list has two settings:
RANGE: The wicks of prior candles are compared to their candle ranges and the 'wick averages' will be what the average percent of ranges were in the sample.
WICKS: The size of the wicks themselves are averaged and returned for comparing against the current wicks of a Doji.
The 'Behavior' list has three settings:
ONE: Only one wick length needs to exceed the average by the tolerance for a Doji to be considered 'Long Legged'.
BOTH: Both wick lengths need to exceed the average of the tolerance of their respective wicks (upper wicks are compared to upper wicks, lower wicks compared to lower) to be considered 'Long Legged'.
AVG: Both wicks and the averages of the previous wicks are added together, divided by two, and compared. If the 'average' of the current wicks exceeds this combined average of prior wicks by the tolerance, then this would constitute a valid 'Long Legged' Doji. (For Dojis in general - SEE LIMITATIONS)
The final input is one related to candle patterns which require a Marubozu candle in them. The two settings for this input are 'INCLUSIVE' and 'EXCLUSIVE'. If INCLUSIVE is selected, any opening/closing variant of Marubozu candles will be allowed in the patterns that require them.
For two-candle patterns, there are:
2 — Settings which define 'Engulfing' parameters:
Engulfing Setting - Two options, RANGE or BODY which sets up how one candle may 'engulf' the previous.
Inclusive Engulfing - Boolean which enables if 'engulfing' candles can be equal to the values needed to 'engulf' the prior candle.
For the 'Engulfing Setting':
RANGE: If the second candle's high-low range completely covers the high-low range of the prior candle, this is recognized as 'engulfing'.
BODY: If the second candle's open-close completely covers the open-close of the previous candle, this is recognized as 'engulfing'. (SEE LIMITATIONS)
4 — Booleans specifying different settings for a few patterns:
One which allows for 'opens within body' patterns to let the second candle's open/close values match the prior candles' open/close.
One which forces 'Kicking' patterns to have a gap if the Marubozu setting is set to 'INCLUSIVE'.
And Two which dictate if the individual candles in 'Stomach' patterns need to be 'Tall'.
8 — Floating point values which affect 11 different patterns:
One which determines the distance the close of the first candle in a 'Hammer Inverted' pattern must be to the low to be considered valid.
One which affects how close the opens/closes need to be for all 'Lines' patterns (Bull/Bear Meeting/Separating Lines).
One that allows some leeway with the 'Matching Low' pattern (gives a small range the second candle close may be within instead of needing to match the previous close).
Three tolerances for On Neck/In Neck patterns (2 and 1 respectively).
A tolerance for the Thrusting pattern which give a range the close the second candle may be between the midpoint and close of the first to be considered 'valid'.
A tolerance for the two Tweezers patterns that specifies how close the highs and lows of the patterns need to be to each other to be 'valid'.
The first On Neck tolerance specifies how large the lower wick of the first candle may be (as a % of that candle's range) before the pattern is invalidated. The second tolerance specifies how far up the lower wick to the close the second candle's close may be for this pattern. The third tolerance for the In Neck pattern determines how far into the body of the first candle the second may close to be 'valid'.
For the remaining patterns (3, 4, and 5 candles), there are:
3 — Settings for the Deliberation pattern:
A boolean which forces the open of the third candle to gap above the close of the second.
A tolerance which changes the proximity of the third candle's open to the second candle's close in this pattern.
A tolerance that sets the maximum size the third candle may be compared to the average of the first two candles.
One boolean value for the Two Crows patterns (standard and Upside Gapping) that forces the first two candles in the patterns to completely gap if disabled (candle 1's close < candle 2's low).
10 — Floating point values for the remaining patterns:
One tolerance for defining how much the size of each candle in the Identical Black Crows pattern may deviate from the average of themselves to be considered valid.
One tolerance for setting how close the opens/closes of certain three candle patterns may be to each other's opens/closes.*
Three floating point values that affect the Three Stars in the South pattern.
One tolerance for the Side-by-Side patterns - looks at the second and third candle closes.
One tolerance for the Stick Sandwich pattern - looks at the first and third candle closes.
A floating value that sizes the Concealing Baby Swallow pattern's 3rd candle wick.
Two values for the Ladder Bottom pattern which define a range that the third candle's wick size may be.
* This affects the Three Black Crows (non-identical) and Three White Soldiers patterns, each require the opens and closes of every candle to be near each other.
The first tolerance of the Three Stars in the South pattern affects the first candle body's center position, and defines where it must be above to be considered valid. The second tolerance specifies how close the second candle must be to this same position, as well as the deviation the ratio the candle body to its range may be in comparison to the first candle. The third restricts how large the second candle range may be in comparison to the first (prevents this pattern from being recognized if the second candle is similar to the first but larger).
The last two floating point values define upper and lower limits to the wick size of a Ladder Bottom's fourth candle to be considered valid.
█ HOW TO USE
While there are many moving parts to this script, I attempted to set the default values with what I believed may help identify the most patterns within reasonable definitions. When this script is applied to a chart, the Candle Detection Mode (along with the BREAKOUT settings) and all candle switches must be confirmed before patterns are displayed. All switches are on by default, so this gives the user an opportunity to pick which patterns to identify first before playing around in the settings.
All of the settings/inputs described above are meant for experimentation. I encourage the user to tweak these values at will to find which set ups work best for whichever charts they decide to apply these patterns to.
Refer to the patterns themselves during experimentation. The statistic information provided on the tooltips of the patterns are meant to help guide input decisions. The breadth of candlestick theory is deep, and this was an attempt at capturing what I could in its sea of information.
█ LIMITATIONS
DISCLAIMER: While it may seem a bit paradoxical that this script aims to use past performance to potentially measure future results, past performance is not indicative of future results . Markets are highly adaptive and often unpredictable. This script is meant as an informational tool to show how patterns may behave. There is no guarantee that confidence intervals (or any other metric measured with this script) are accurate to the performance of patterns; caution must be exercised with all patterns identified regardless of how much information regarding prior performance is available.
Candlestick Theory - In the name, Candlestick Theory is a theory , and all theories come with their own limits. Some patterns identified by this script may be completely useless/unprofitable/unpredictable regardless of whatever combination of settings are used to identify them. However, if I truly believed this theory had no merit, this script would not exist. It is important to understand that this is a tool meant to be utilized with an array of others to procure positive (or negative, looking at you, short sellers ) results when navigating the complex world of finance.
To address the functionality note however, this script has an offset of 1 by default. Patterns will not be identified on the currently closing candle, only on the candle which has most recently closed. Attempting to have this script do both (offset by one or identify on close) lead to more trouble than it was worth. I personally just want users to be aware that patterns will not be identified immediately when they appear.
Trend Direction - Moving Averages - There is a small quirk with how MA settings will be adjusted if the user inputs two moving averages of the same length when the "MA Setting" is set to 'BOTH'. If Moving Averages have the same length, this script will default to only using MA 1 regardless of if the types of Moving Averages are different . I will experiment in the future to alleviate/reduce this restriction.
Price Analysis - BREAKOUT mode - With how identifying patterns with a look-ahead confirmation works, the percent returns for patterns that break out in either direction will be calculated on the same candle regardless of if P/L Offset is set to 'FROM CONFIRMATION' or 'FROM APPEARANCE'. This same issue is present in the Hikkake Hunter script mentioned earlier. This does not mean the P/L calculations are incorrect , the offset for the calculation is set by the number of candles required to confirm the pattern if 'FROM APPEARANCE' is selected. It just means that these two different P/L calculations will complete at the same time independent of the setting that's been selected.
Adaptive Coloring/Hard Limiting - Hard Limiting is only used with Adaptive Coloring and has no effect outside of it. If Hard Limiting is used, it is recommended to increase the 'Positive' and 'Negative' return tolerance values as a pattern's bullish/bearishness may be disproportionately represented with the gradient generated under a hard limit.
TARGET MODE - This mode will break rules regarding patterns that are overridden on purpose. If a pattern selected in TARGET mode would have otherwise been absorbed by a larger pattern, it will have that pattern's percent return calculated; potentially leading to duplicate returns being included in the matrix of all returns recognized by this script.
'Tall' Candle Setting - This is a wide-reaching setting, as approximately 30 different patterns or so rely on defining 'Tall' candles. Changing how 'Tall' candles are defined whether by the tolerance value those candles need to exceed or by the values of the candle used for the baseline comparison (RANGE/BODY) can wildly affect how this script functions under certain conditions. Refer to the tooltip of these settings for more information on which specific patterns are affected by this.
Doji Settings - There are roughly 10 or so two to three candle patterns which have Dojis as a part of them. If all Dojis are disabled, it will prevent some of these larger patterns from being recognized. This is a dependency issue that I may address in the future.
'Engulfing' Setting - Functionally, the two 'Engulfing' settings are quite different. Because of this, the 'RANGE' setting may cause certain patterns that would otherwise be valid under textbook and online references/definitions to not be recognized as such (like the Upside Gap Two Crows or Three Outside down).
█ PATTERN LIST
This script recognizes 85 patterns upon initial release. I am open to adding additional patterns to it in the future and any comments/suggestions are appreciated. It recognizes:
15 — 1 Candle Patterns
4 Hammer type patterns: Regular Hammer, Takuri Line, Shooting Star, and Hanging Man
9 Doji Candles: Regular Dojis, Northern/Southern Dojis, Gravestone/Dragonfly Dojis, Gapping Up/Down Dojis, and Long-Legged/Rickshaw Man Dojis
White/Black Long Days
32 — 2 Candle Patterns
4 Engulfing type patterns: Bullish/Bearish Engulfing and Last Engulfing Top/Bottom
Dark Cloud Cover
Bullish/Bearish Doji Star patterns
Hammer Inverted
Bullish/Bearish Haramis + Cross variants
Homing Pigeon
Bullish/Bearish Kicking
4 Lines type patterns: Bullish/Bearish Meeting/Separating Lines
Matching Low
On/In Neck patterns
Piercing pattern
Shooting Star (2 Lines)
Above/Below Stomach patterns
Thrusting
Tweezers Top/Bottom patterns
Two Black Gapping
Rising/Falling Window patterns
29 — 3 Candle Patterns
Bullish/Bearish Abandoned Baby patterns
Advance Block
Collapsing Doji Star
Deliberation
Upside/Downside Gap Three Methods patterns
Three Inside/Outside Up/Down patterns (4 total)
Bullish/Bearish Side-by-Side patterns
Morning/Evening Star patterns + Doji variants
Stick Sandwich
Downside/Upside Tasuki Gap patterns
Three Black Crows + Identical variation
Three White Soldiers
Three Stars in the South
Bullish/Bearish Tri-Star patterns
Two Crows + Upside Gap variant
Unique Three River Bottom
3 — 4 Candle Patterns
Concealing Baby Swallow
Bullish/Bearish Three Line Strike patterns
6 — 5 Candle Patterns
Bullish/Bearish Breakaway patterns
Ladder Bottom
Mat Hold
Rising/Falling Three Methods patterns
█ WORKS CITED
Because of the amount of time needed to complete this script, I am unable to provide exact dates for when some of these references were used. I will also not provide every single reference, as citing a reference for each individual pattern and the place it was reviewed would lead to a bibliography larger than this script and its description combined. There were five major resources I used when building this script, one book, two websites (for various different reasons including patterns, moving averages, and various other articles of information), various scripts from TradingView's public library (including TradingView's own source code for *all* candle patterns ), and PineScrypt's reference manual.
Bulkowski, Thomas N. Encyclopedia of Candlestick Patterns . Hoboken, New Jersey: John Wiley & Sons Inc., 2008. E-book (google books).
Various. Numerous webpages. CandleScanner . 2023. online. Accessed 2020 - 2023.
Various. Numerous webpages. Investopedia . 2023. online. Accessed 2020 - 2023.
█ AKNOWLEDGEMENTS
I want to take the time here to thank all of my friends and family, both online and in real life, for the support they've given me over the last few years in this endeavor. My pets who tried their hardest to keep me from completing it. And work for the grit to continue pushing through until this script's completion.
This belongs to me just as much as it does anyone else. Whether you are an institutional trader, gold bug hedging against the dollar, retail ape who got in on a squeeze, or just parents trying to grow their retirement/save for the kids. This belongs to everyone.
Private Beta for new features to be tested can be found here .
Vires In Numeris
Trend Oscillatorwhat is "Trend Oscillator"?
it is an indicator for determining the trend.
what it does?
analyzes the price action by reducing it to 4 different situations. Red means strong bear, orange means bearish, yellow means weak bull and green means strong bull. It was developed to help traders who trade in the direction of the trend and its biggest promise is to simplify price action.
how it does it?
He defines 4 different situations as follows. If the velocity of the price is positive and the acceleration is positive, it is a strong bull, if the velocity is positive and the acceleration is negative, it is a weak bull, if the velocity is negative and the acceleration is positive, it is a weak bear, if both velocity and acceleration are negative, it is a strong bear.
2 for strong bull
1 for the weak bull
-1 for weak bear
Creates a function that takes values of -2 for the strong bear. this function is the velocity of the principal indicator, and then the integral of this function forms the principal indicator.
how to use it?
"source" is used to change the source of the indicator,
"length" makes the indicator give a later but less signal.
you can use it to follow or analyze the trend. colors make it easy to use. learns about current or past trends by looking at colors. Like any trend indicator, it can give unsuccessful signals in a horizontal trend.
Probability Weighted Moving AverageThe Probability Weighted Moving Average uses a log-normal (continuous) distribution to calculate the probabilities of a range of lengths MAs to assess their performances, and respectively assign weights to a mean of this range. This assumes that the values of the MAs (call it A) aren't normally distributed, but instead log(A) is normally distributed, which can be a fair assumption. In P(t, t+X) where X is the number of trades assessed, it assumes the probability is not dependent on t and independent of previous price.
For P(t, t+X), the higher the value of X, the more trades are assessed.
Range of lengths comes in slow (default) or fast. Faster MAs are not preferable and should be limited to HTFs.
The color code can be either weighted (where lighter shades of blue suggests faster values have more weight, and darker shades suggest slower values have more weight) or coded for bull/bear: green when bullish, red when bearish.
SUPERTREND MIXED ICHI-DMI-DONCHIAN-VOL-GAP-HLBox@RLSUPERTREND MIXED ICHI-DMI-VOL-GAP-HLBox@RL
by RegisL76
This script is based on several trend indicators.
* ICHIMOKU (KINKO HYO)
* DMI (Directional Movement Index)
* SUPERTREND ICHIMOKU + SUPERTREND DMI
* DONCHIAN CANAL Optimized with Colored Bars
* HMA Hull
* Fair Value GAP
* VOLUME/ MA Volume
* PRICE / MA Price
* HHLL BOXES
All these indications are visible simultaneously on a single graph. A data table summarizes all the important information to make a good trade decision.
ICHIMOKU Indicator:
The ICHIMOKU indicator is visualized in the traditional way.
ICHIMOKU standard setting values are respected but modifiable. (Traditional defaults = .
An oriented visual symbol, near the last value, indicates the progression (Ascending, Descending or neutral) of the TENKAN-SEN and the KIJUN-SEN as well as the period used.
The CLOUD (KUMO) and the CHIKOU-SPAN are present and are essential for the complete analysis of the ICHIMOKU.
At the top of the graph are visually represented the crossings of the TENKAN and the KIJUN.
Vertical lines, accompanied by labels, make it possible to quickly visualize the particularities of the ICHIMOKU.
A line displays the current bar.
A line visualizes the end of the CLOUD (KUMO) which is shifted 25 bars into the future.
A line visualizes the end of the chikou-span, which is shifted 25 bars in the past.
DIRECTIONAL MOVEMENT INDEX (DMI) : Treated conventionally : DI+, DI-, ADX and associated with a SUPERTREND DMI.
A visual symbol at the bottom of the graph indicates DI+ and DI- crossings
A line of oriented and colored symbols (DMI Line) at the top of the chart indicates the direction and strength of the trend.
SUPERTREND ICHIMOKU + SUPERTREND DMI :
Trend following by SUPERTREND calculation.
DONCHIAN CHANNEL: Treated conventionally. (And optimized by colored bars when overshooting either up or down.
The lines, high and low of the last values of the channel are represented to quickly visualize the level of the RANGE.
SUPERTREND HMA (HULL) Treated conventionally.
The HMA line visually indicates, according to color and direction, the market trend.
A visual symbol at the bottom of the chart indicates opportunities to sell and buy.
VOLUME:
Calculation of the MOBILE AVERAGE of the volume with comparison of the volume compared to the moving average of the volume.
The indications are colored and commented according to the comparison.
PRICE: Calculation of the MOBILE AVERAGE of the price with comparison of the price compared to the moving average of the price.
The indications are colored and commented according to the comparison.
HHLL BOXES:
Visualizes in the form of a box, for a given period, the max high and min low values of the price.
The configuration allows taking into account the high and low wicks of the price or the opening and closing values.
FAIR VALUE GAP :
This indicator displays 'GAP' levels over the current time period and an optional higher time period.
The script takes into account the high/low values of the current bar and compares with the 2 previous bars.
The "gap" is generated from the lack of overlap between these bars. Bearish or bullish gaps are determined by whether the gap is above or below HmaPrice, as they tend to fill, and can be used as targets.
NOTE: FAIR VALUE GAP has no values displayed in the table and/or label.
Important information (DATA) relating to each indicator is displayed in real time in a table and/or a label.
Each information is commented and colored according to direction, value, comparison etc.
Each piece of information indicates the values of the current bar and the previous value (in "FULL" mode).
The other possible modes for viewing the table and/or the label allow a more synthetic view of the information ("CONDENSED" and "MINIMAL" modes).
In order not to overload the vision of the chart too much, the visualization box of the RANGE DONCHIAN, the vertical lines of the shifted marks of the ICHIMOKU, as well as the boxes of the HHLL Boxes indicator are only visualized intermittently (managed by an adjustable time delay ).
The "HISTORICAL INFO READING" configuration parameter set to zero (by default) makes it possible to read all the information of the current bar in progress (Bar #0). All other values allow to read the information of a historical bar. The value 1 reads the information of the bar preceding the current bar (-1). The value 10 makes it possible to read the information of the tenth bar behind (-10) compared to the current bar, etc.
At the bottom of the DATAS table and label, lights, red, green or white indicate quickly summarize the trend from the various indicators.
Each light represents the number of indicators with the same trend at a given time.
Green for a bullish trend, red for a bearish trend and white for a neutral trend.
The conditions for determining a trend are for each indicator:
SUPERTREND ICHIMOHU + DMI: the 2 Super trends together are either bullish or bearish.
Otherwise the signal is neutral.
DMI: 2 main conditions:
BULLISH if DI+ >= DI- and ADX >25.
BEARISH if DI+ < DI- and ADX >25.
NEUTRAL if the 2 conditions are not met.
ICHIMOKU: 3 main conditions:
BULLISH if PRICE above the cloud and TENKAN > KIJUN and GREEN CLOUD AHEAD.
BEARISH if PRICE below the cloud and TENKAN < KIJUN and RED CLOUD AHEAD.
The other additional conditions (Data) complete the analysis and are present for informational purposes of the trend and depend on the context.
DONCHIAN CHANNEL: 1 main condition:
BULLISH: the price has crossed above the HIGH DC line.
BEARISH: the price has gone below the LOW DC line.
NEUTRAL if the price is between the HIGH DC and LOW DC lines
The 2 other complementary conditions (Datas) complete the analysis:
HIGH DC and LOW DC are increasing, falling or stable.
SUPERTREND HMA HULL: The script determines several trend levels:
STRONG BUY, BUY, STRONG SELL, SELL AND NEUTRAL.
VOLUME: 3 trend levels:
VOLUME > MOVING AVERAGE,
VOLUME < MOVING AVERAGE,
VOLUME = MOVING AVERAGE.
PRICE: 3 trend levels:
PRICE > MOVING AVERAGE,
PRICE < MOVING AVERAGE,
PRICE = MOVING AVERAGE.
If you are using this indicator/strategy and you are satisfied with the results, you can possibly make a donation (a coffee, a pizza or more...) via paypal to: lebourg.regis@free.fr.
Thanks in advance !!!
Have good winning Trades.
**************************************************************************************************************************
SUPERTREND MIXED ICHI-DMI-VOL-GAP-HLBox@RL
by RegisL76
Ce script est basé sur plusieurs indicateurs de tendance.
* ICHIMOKU (KINKO HYO)
* DMI (Directional Movement Index)
* SUPERTREND ICHIMOKU + SUPERTREND DMI
* DONCHIAN CANAL Optimized with Colored Bars
* HMA Hull
* Fair Value GAP
* VOLUME/ MA Volume
* PRIX / MA Prix
* HHLL BOXES
Toutes ces indications sont visibles simultanément sur un seul et même graphique.
Un tableau de données récapitule toutes les informations importantes pour prendre une bonne décision de Trade.
I- Indicateur ICHIMOKU :
L’indicateur ICHIMOKU est visualisé de manière traditionnelle
Les valeurs de réglage standard ICHIMOKU sont respectées mais modifiables. (Valeurs traditionnelles par défaut =
Un symbole visuel orienté, à proximité de la dernière valeur, indique la progression (Montant, Descendant ou neutre) de la TENKAN-SEN et de la KIJUN-SEN ainsi que la période utilisée.
Le NUAGE (KUMO) et la CHIKOU-SPAN sont bien présents et sont primordiaux pour l'analyse complète de l'ICHIMOKU.
En haut du graphique sont représentés visuellement les croisements de la TENKAN et de la KIJUN.
Des lignes verticales, accompagnées d'étiquettes, permettent de visualiser rapidement les particularités de l'ICHIMOKU.
Une ligne visualise la barre en cours.
Une ligne visualise l'extrémité du NUAGE (KUMO) qui est décalé de 25 barres dans le futur.
Une ligne visualise l'extrémité de la chikou-span, qui est décalée de 25 barres dans le passé.
II-DIRECTIONAL MOVEMENT INDEX (DMI)
Traité de manière conventionnelle : DI+, DI-, ADX et associé à un SUPERTREND DMI
Un symbole visuel en bas du graphique indique les croisements DI+ et DI-
Une ligne de symboles orientés et colorés (DMI Line) en haut du graphique, indique la direction et la puissance de la tendance.
III SUPERTREND ICHIMOKU + SUPERTREND DMI
Suivi de tendance par calcul SUPERTREND
IV- DONCHIAN CANAL :
Traité de manière conventionnelle.
(Et optimisé par des barres colorées en cas de dépassement soit vers le haut, soit vers le bas.
Les lignes, haute et basse des dernières valeurs du canal sont représentées pour visualiser rapidement la fourchette du RANGE.
V- SUPERTREND HMA (HULL)
Traité de manière conventionnelle.
La ligne HMA indique visuellement, selon la couleur et l'orientation, la tendance du marché.
Un symbole visuel en bas du graphique indique les opportunités de vente et d'achat.
*VI VOLUME :
Calcul de la MOYENNE MOBILE du volume avec comparaison du volume par rapport à la moyenne mobile du volume.
Les indications sont colorées et commentées en fonction de la comparaison.
*VII PRIX :
Calcul de la MOYENNE MOBILE du prix avec comparaison du prix par rapport à la moyenne mobile du prix.
Les indications sont colorées et commentées en fonction de la comparaison.
*VIII HHLL BOXES :
Visualise sous forme de boite, pour une période donnée, les valeurs max hautes et min basses du prix.
La configuration permet de prendre en compte les mèches hautes et basses du prix ou bien les valeurs d'ouverture et de fermeture.
IX - FAIR VALUE GAP
Cet indicateur affiche les niveaux de 'GAP' sur la période temporelle actuelle ET une période temporelle facultative supérieure.
Le script prend en compte les valeurs haut/bas de la barre actuelle et compare avec les 2 barres précédentes.
Le "gap" est généré à partir du manque de recouvrement entre ces barres.
Les écarts baissiers ou haussiers sont déterminés selon que l'écart est supérieurs ou inférieur à HmaPrice, car ils ont tendance à être comblés, et peuvent être utilisés comme cibles.
NOTA : FAIR VALUE GAP n'a pas de valeurs affichées dans la table et/ou l'étiquette.
Les informations importantes (DATAS) relatives à chaque indicateur sont visualisées en temps réel dans une table et/ou une étiquette.
Chaque information est commentée et colorée en fonction de la direction, de la valeur, de la comparaison etc.
Chaque information indique la valeurs de la barre en cours et la valeur précédente ( en mode "COMPLET").
Les autres modes possibles pour visualiser la table et/ou l'étiquette, permettent une vue plus synthétique des informations (modes "CONDENSÉ" et "MINIMAL").
Afin de ne pas trop surcharger la vision du graphique, la boite de visualisation du RANGE DONCHIAN, les lignes verticales des marques décalées de l'ICHIMOKU, ainsi que les boites de l'indicateur HHLL Boxes ne sont visualisées que de manière intermittente (géré par une temporisation réglable ).
Le paramètre de configuration "HISTORICAL INFO READING" réglé sur zéro (par défaut) permet de lire toutes les informations de la barre actuelle en cours (Barre #0).
Toutes autres valeurs permet de lire les informations d'une barre historique. La valeur 1 permet de lire les informations de la barre précédant la barre en cours (-1).
La valeur 10 permet de lire les information de la dixième barre en arrière (-10) par rapport à la barre en cours, etc.
Dans le bas de la table et de l'étiquette de DATAS, des voyants, rouge, vert ou blanc indique de manière rapide la synthèse de la tendance issue des différents indicateurs.
Chaque voyant représente le nombre d'indicateur ayant la même tendance à un instant donné. Vert pour une tendance Bullish, rouge pour une tendance Bearish et blanc pour une tendance neutre.
Les conditions pour déterminer une tendance sont pour chaque indicateur :
SUPERTREND ICHIMOHU + DMI : les 2 Super trends sont ensemble soit bullish soit Bearish. Sinon le signal est neutre.
DMI : 2 conditions principales :
BULLISH si DI+ >= DI- et ADX >25.
BEARISH si DI+ < DI- et ADX >25.
NEUTRE si les 2 conditions ne sont pas remplies.
ICHIMOKU : 3 conditions principales :
BULLISH si PRIX au dessus du nuage et TENKAN > KIJUN et NUAGE VERT DEVANT.
BEARISH si PRIX en dessous du nuage et TENKAN < KIJUN et NUAGE ROUGE DEVANT.
Les autres conditions complémentaires (Datas) complètent l'analyse et sont présents à titre informatif de la tendance et dépendent du contexte.
CANAL DONCHIAN : 1 condition principale :
BULLISH : le prix est passé au dessus de la ligne HIGH DC.
BEARISH : le prix est passé au dessous de la ligne LOW DC.
NEUTRE si le prix se situe entre les lignes HIGH DC et LOW DC
Les 2 autres conditions complémentaires (Datas) complètent l'analyse : HIGH DC et LOW DC sont croissants, descendants ou stables.
SUPERTREND HMA HULL :
Le script détermine plusieurs niveaux de tendance :
STRONG BUY, BUY, STRONG SELL, SELL ET NEUTRE.
VOLUME : 3 niveaux de tendance :
VOLUME > MOYENNE MOBILE, VOLUME < MOYENNE MOBILE, VOLUME = MOYENNE MOBILE.
PRIX : 3 niveaux de tendance :
PRIX > MOYENNE MOBILE, PRIX < MOYENNE MOBILE, PRIX = MOYENNE MOBILE.
Si vous utilisez cet indicateur/ stratégie et que vous êtes satisfait des résultats,
vous pouvez éventuellement me faire un don (un café, une pizza ou plus ...) via paypal à : lebourg.regis@free.fr.
Merci d'avance !!!
Ayez de bons Trades gagnants.
Ichimoku [xdecow]The Ichimoku Kinko Hyo (Ichimoku Cloud) is a popular indicator / system.
In this version you will have a panel that shows the main signs of this system.
Each signal can have its status as bullish (weak, neutral or strong), consolidation and bearish (weak, neutral or strong).
Signals
Kijun-Sen Cross
Occurs when the price closes above/below the Kijun-sen.
Weak Bullish: Occurs below the Kumo.
Weak Bearish: Occurs above the Kumo.
Bullish/Bearish Neutral: Occurs inside the Kumo.
Strong Bullish: Occurs above the Kumo.
Strong Bearish: Occurs below the Kumo.
TK Cross
Occurs when the Tenkan-sen crosses the Kijun-sen.
Weak Bullish: Occurs when the crossing is below the Kumo.
Weak Bearish: Occurs when the crossing is above the Kumo.
Bullish/Bearish Neutral: Occurs when the crossing is inside the Kumo.
Strong Bullish: Occurs when the crossing is above the Kumo.
Strong Bearish: Occurs when the crossing is below the Kumo.
Chikou Span Cross
Occurs when the Chikou Span crosses the price.
Weak Bullish: Occurs when current price is below the Kumo.
Weak Bearish: Occurs when current price is above the Kumo.
Bullish/Bearish Neutral: Occurs when current price is inside the Kumo.
Strong Bullish: Occurs when current price is above the Kumo.
Strong Bearish: Occurs when current price is below the Kumo.
Kumo Breakout
Occurs when the price closes above/below the Kumo.
Kumo Twist
Occurs when the Senkou Span A crosses the Senkou Span B ahead.
Weak Bullish: Occurs when current price is below the Kumo.
Weak Bearish: Occurs when current price is above the Kumo.
Bullish/Bearish Neutral: Occurs when current price is inside the Kumo.
Strong Bullish: Occurs when current price is above the Kumo.
Strong Bearish: Occurs when current price is below the Kumo.
In addition, Senkou Span B turns golden when it is flat and the cloud is lighter when it is thin (default is half the average of the last 610).
Cyclic Smoothed RSI with Motive-Corrective Wave Indicator
This indicator uses the cyclic smoothed Relative Strength Index (cRSI) instead of the traditional Relative Strength Index (RSI). See below for more info on the benefits to the cRSI.
My key contributions
1) A Weighted Moving Average (WMA) to track the general trend of the cRSI signal. This is very helpful in determining when the equity switches from bullish to bearish, which can be used to determine buy/sell points. This is then is used to color the region between the upper and lower cRSI bands (green above, red below).
2) An attempt to detect the motive (impulse) and corrective and waves. Corrective waves are indicated A, B, C, D, E, F, G. F and G waves are not technically Elliot Waves, but the way I detect waves it is really hard to always get it right. Once and a while you could actually see G and F a second time. Motive waves are identified as s (strong) and w (weak). Strong waves have a peak above the cRSI upper band and weak waves have a peak below the upper band.
3) My own divergence indicator for bull, hidden bull, bear, and hidden bear. I was not able to replicate the TradingView style of drawing a line from peak to peak, but for this indicator I think in the end it makes the chart cleaner.
There is a latency issue with an indicator that is based on moving averages. That means they tend to trigger right after key events. Perfect timing is not possible strictly with these indicators, but they do work very well "on average." However, my implementation has minimal latency as peaks (tops/bottoms) only require one bar to detect.
As a bit of an Easter Egg, this code can be tweaked and run as a strategy to get buy/sell signals. I use this code for both my indicator and for trading strategy. Just copy and past it into a new strategy script and just change it from study to a strategy, something like this:
strategy("cRSI + Waves Strategy with VWMA overlay", overlay=overlay)
The buy/sell code is at the end and just needs to be uncommented. I make no promises or guarantees about how good it is as a strategy, but it gives you some code and ideas to work with.
Tuning
1) Volume Weighted Moving Average (VWMA): This is a “hidden strategy” feature implemented that will display the high-low bands of the VWMA on the price chart if run the code using “overlay = true”.
- If the equity does not have volume, then the VWMA will not show up. Uncheck this box and it will use the regular WMA (no volume).
- defines how far back the WMA averages price.
2) cRSI (Black line in the indicator)
- Increase to length that amount of time a band (upper/lower) stays high/low after a peak. Reduce the value to shorten the time. Just increment it up/down to see the effect.
- defines how far back the SMA averages the cRSI. This affects the purple line in the indicator.
- defines how many bars back the peak detector looks to determine if a peak has occurred. For example, a top is detected like this: current-bar down relative to the 1-bar-back, 1-bar-back up relative to 2-bars-back (look back = 1), c) 2-bars-back up relative to 3-bars-back (lookback = 2), and d) 3-bars-back up relative to 4-bars-back (lookback = 3). I hope that makes sense. There are only 2 options for this setting: 2 or 3 bars. 2 bars will be able to detect small peaks but create more “false” peaks that may not be meaningful. 3 bars will be more robust but can miss short duration peaks.
3) Waves
- The check boxes are self explanatory for which labels they turn on and off on the plot.
4) Divergence Indicators
- The check boxes are self explanatory for which labels they turn on and off on the plot.
Hints
- The most common parameter to change is the . Different stocks will have different levels of strength in their peaks. A setting of 2 may generate too many corrective waves.
- Different times scales will give you different wave counts. This is to be expected. A counter impulse wave inside a corrective wave may actually go above the cRSI WMA on a smaller time frame. You may need to increase it one or two levels to see large waves.
- Just because you see divergence (bear or hidden bear) does not mean a price is going to go down. Often price continues to rise through bears, so take note and that is normal. Bulls are usually pretty good indicators especially if you see them on C,E,G waves.
----------------------------------------------------------------------------------------------------------------------------
cyclic smoothed RSI (cRSI) indicator
----------------------------------------------------------------------------------------------------------------------------
The “core” code for the cyclic smoothed RSI (cRSI) indicator was written by Lars von Theinen and is subject to the terms of the Mozilla Public License 2.0 at mozilla.org Copyright (C) 2017 CC BY, whentotrade / Lars von Thienen. For more details on the cRSI Indicator:
The cyclic smoothed RSI indicator is an enhancement of the classic RSI, adding
1) additional smoothing according to the market vibration,
2) adaptive upper and lower bands according to the cyclic memory and
3) using the current dominant cycle length as input for the indicator.
It is much more responsive to market moves than the basic RSI. The indicator uses the dominant cycle as input to optimize signal, smoothing, and cyclic memory. To get more in-depth information on the cyclic-smoothed RSI indicator, please read Decoding The Hidden Market Rhythm - Part 1: Dynamic Cycles (2017), Chapter 4: "Fine-tuning technical indicators." You need to derive the dominant cycle as input parameter for the cycle length as described in chapter 4.
Hope this helps and good luck.
Bar Balance [LucF]Bar Balance extracts the number of up, down and neutral intrabars contained in each chart bar, revealing information on the strength of price movement. It can display stacked columns representing raw up/down/neutral intrabar counts, or an up/down balance line which can be calculated and visualized in many different ways.
WARNING: This is an analysis tool that works on historical bars only. It does not show any realtime information, and thus cannot be used to issue alerts or for automated trading. When realtime bars elapse, the indicator will require a browser refresh, a change to its Inputs or to the chart's timeframe/symbol to recalculate and display information on those elapsed bars. Once a trader understands this, the indicator can be used advantageously to make discretionary trading decisions.
Traders used to work with my Delta Volume Columns Pro will feel right at home in this indicator's Inputs . It has lots of options, allowing it to be used in many different ways. If you value the bar balance information this indicator mines, I hope you will find the time required to master the use of Bar Balance well worth the investment.
█ OVERVIEW
The indicator has two modes: Columns and Line .
Columns
• In Columns mode you can display stacked Up/Down/Neutral columns.
• The "Up" section represents the count of intrabars where `close > open`, "Down" where `close < open` and "Neutral" where `close = open`.
• The Up section always appears above the centerline, the Down section below. The Neutral section overlaps the centerline, split halfway above and below it.
The Up and Down sections start where the Neutral section ends, when there is one.
• The Up and Down sections can be colored independently using 7 different methods.
• The signal line plotted in Line mode can also be displayed in Columns mode.
Line
• Displays a single balance line using a zero centerline.
• A variable number of independent methods can be used to calculate the line (6), determine its color (5), and color the fill (5).
You can thus evaluate the state of 3 different components with this single line.
• A "Divergence Levels" feature will use the line to automatically draw expanding levels on divergence events.
Features available in both modes
• The color of all components can be selected from 15 base colors, with 16 gradient levels used for each base color in the indicator's gradients.
• A zero line can show a 6-state aggregate value of the three main volume balance modes.
• The background can be colored using any of 5 different methods.
• Chart bars can be colored using 5 different methods.
• Divergence and large neutral count ratio events can be shown in either Columns or Line mode, calculated in one of 4 different methods.
• Markers on 6 different conditions can be displayed.
█ CONCEPTS
Intrabar inspection
Intrabar inspection means the indicator looks at lower timeframe bars ( intrabars ) making up a given chart bar to gather its information. If your chart is on a 1-hour timeframe and the intrabar resolution determined by the indicator is 5 minutes, then 12 intrabars will be analyzed for each chart bar and the count of up/down/neutral intrabars among those will be tallied.
Bar Balances and calculation methods
The indicator uses a variety of methods to evaluate bar balance and to derive other calculations from them:
1. Balance on Bar : Uses the relative importance of instant Up and Down counts on the bar.
2. Balance Averages : Uses the difference between the EMAs of Up and Down counts.
3. Balance Momentum : Starts by calculating, separately for both Up and Down counts, the difference between the same EMAs used in Balance Averages and an SMA of double the period used for the EMAs. These differences are then aggregated and finally, a bounded momentum of that aggregate is calculated using RSI.
4. Markers Bias : It sums the bull/bear occurrences of the four previous markers over a user-defined period (the default is 14).
5. Combined Balances : This is the aggregate of the instant bull/bear bias of the three main bar balances.
6. Dual Up/Down Averages : This is a display mode showing the EMA calculated for each of the Up and Down counts.
Interpretation of neutral intrabars
What do neutral intrabars mean? When price does not change during a bar, it can be because there is simply no interest in the market, or because of a perfect balance between buyers and sellers. The latter being more improbable, Bar Balance assumes that neutral bars reveal a lack of interest, which entails uncertainty. That is the reason why the option is provided to interpret ratios of neutral intrabars greater than 50% as divergences. It is also the rationale behind the option to dampen signal lines on the inverse ratio of neutral intrabars, so that zero intrabars do not affect the signal, and progressively larger proportions of neutral intrabars will reduce the signal's amplitude, as the balance calcs using the up/down counts lose significance. The impact of the dampening will vary with markets. Weaker markets such as cryptos will often contain greater numbers of neutral intrabars, so dampening the Line in that sector will have a greater impact than in more liquid markets.
█ FEATURES
1 — Columns
• While the size of the Up/Down columns always represents their respective importance on the bar, their coloring mode is independent. The default setup uses a standard coloring mode where the Up/Down columns over/under the zero line are always in the bull/bear color with a higher intensity for the winning side. Six other coloring modes allow you to pack more information in the columns. When choosing to color the top columns using a bull/bear gradient on Balance Averages, for example, you will end up with bull/bear colored tops. In order for the color of the bottom columns to continue to show the instant bar balance, you can then choose the "Up/Down Ratio on Bar — Dual Solid Colors" coloring mode to make those bars the color of the winning side for that bar.
• Line mode shows only the line, but Columns mode allows displaying the line along with it. If the scale of the line is different than that of the scale of the columns, the line will often appear flat. Traders may find even a flat line useful as its bull/bear colors will be easily distinguishable.
2 — Line
• The default setup for Line mode uses a calculation on "Balance Momentum", with a fill on the longer-term "Balance Averages" and a line color based on the "Markers Bias". With the background set on "Line vs Divergence Levels" and the zero line on the hard-coded "Combined Bar Balances", you have access to five distinct sources of information at a glance, to which you can add divergences, divergences levels and chart bar coloring. This provides powerful potential in displaying bar balance information.
• When no columns are displayed, Line mode can show the full scale of whichever line you choose to calculate because the columns' scale no longer interferes with the line's scale.
• Note that when "Balance on Bar" is selected, the Neutral count is also displayed as a ratio of the balance line. This is the only instance where the Neutral count is displayed in Line mode.
• The "Dual Up/Down Averages" is an exception as it displays two lines: one average for the Up counts and another for the Down counts. This mode will be most useful when Columns are also displayed, as it provides a reference for the top and bottom columns.
3 — Zero Line
The zero line can be colored using two methods, both based on the Combined Balances, i.e., the aggregate of the instant bull/bear bias of the three main bar balances.
• In "Six-state Dual Color Gradient" mode, a dot appears on every bar. Its color reflects the bull/bear state of the Combined Balances, and the dot's brightness reflects the tally of balance biases.
• In "Dual Solid Colors (All Bull/All Bear Only)" a dot only appears when all three balances are either bullish or bearish. The resulting pattern is identical to that of Marker 1.
4 — Divergences
• Divergences are displayed as a small circle at the top of the scale. Four different types of divergence events can be detected. Divergences occur whenever the bull/bear bias of the method used diverges with the bar's price direction.
• An option allows you to include in divergence events instances where the count of neutral intrabars exceeds 50% of the total intrabar count.
• The divergence levels are dynamic levels that automatically build from the line's values on divergence events. On consecutive divergences, the levels will expand, creating a channel. This implementation of the divergence levels corresponds to my view that divergences indicate anomalies, hesitations, points of uncertainty if you will. It excludes any association of a pre-determined bullish/bearish bias to divergences. Accordingly, the levels merely take note of divergence events and mark those points in time with levels. Traders then have a reference point from which they can evaluate further movement. The bull/bear/neutral colors used to plot the levels are also congruent with this view in that they are determined by price's position relative to the levels, which is how I think divergences can be put to the most effective use.
5 — Background
• The background can show a bull/bear gradient on four different calculations. You can adjust its brightness to make its visual importance proportional to how you use it in your analysis.
6 — Chart bars
• Chart bars can be colored using five different methods.
• You have the option of emptying the body of bars where volume does not increase, as does my TLD indicator, the idea behind this being that movement on bars where volume does not increase is less relevant.
7 — Intrabar Resolution
You can choose between three modes. Two of them are automatic and one is manual:
a) Fast, Longer history, Auto-Steps (~12 intrabars) : Optimized for speed and deeper history. Uses an average minimum of 12 intrabars.
b) More Precise, Shorter History Auto-Steps (~24 intrabars) : Uses finer intrabar resolution. It is slower and provides less history. Uses an average minimum of 24 intrabars.
c) Fixed : Uses the fixed resolution of your choice.
Auto-Steps calculations vary for 24/7 and conventional markets in order to achieve the proper target of minimum intrabars.
You can choose to view the intrabar resolution currently used to calculate delta volume. It is the default.
The proper selection of the intrabar resolution is important. It must achieve maximal granularity to produce precise results while not unduly slowing down calculations, or worse, causing runtime errors.
8 — Markers
Six markers are available:
1. Combined Balances Agreement : All three Bar Balances are either bullish or bearish.
2. Up or Down % Agrees With Bar : An up marker will appear when the percentage of up intrabars in an up chart bar is greater than the specified percentage. Conditions mirror to down bars.
3. Divergence confirmations By Price : One of the four types of balance calculations can be used to detect divergences with price. Confirmations occur when the bar following the divergence confirms the balance bias. Note that the divergence events used here do not include neutral intrabar events.
4. Balance Transitions : Bull/bear transitions of the selected balance.
5. Markers Bias Transitions : Bull/bear transitions of the Markers Bias.
6. Divergence Confirmations By Line : Marks points where the line first breaches a divergence level.
Markers appear when the condition is detected, without delay. Since nothing is plotted in realtime, markers do not appear on the realtime bar.
9 — Settings
• Two modes can be selected to dampen the line on the ratio of neutral intrabars.
• A distinct weight can be attributed to the count of the latter half of intrabars, on the assumption that later intrabars may be more important in determining the outcome of chart bars.
• Allows control over the periods of the different moving averages used in calculations.
• The default periods used for the various calculations define the following hierarchy from slow to fast:
Balance Averages: 50,
Balance Momentum: 20,
Dual Up/Down Averages: 20,
Marker Bias: 10.
█ LIMITATIONS
• This script uses a special characteristic of the `security()` function allowing the inspection of intrabars—which is not officially supported by TradingView.
• The method used does not work on the realtime bar—only on historical bars.
• The indicator only works on some chart resolutions: 3, 5, 10, 15 and 30 minutes, 1, 2, 4, 6, and 12 hours, 1 day, 1 week and 1 month. The script’s code can be modified to run on other resolutions, but chart resolutions must be divisible by the lower resolution used for intrabars and the stepping mechanism could require adaptation.
• When using the "Line vs Divergence Levels — Dual Color Gradient" color mode to fill the line, background or chart bars, keep in mind that a line calculation mode must be defined for it to work, as it determines gradients on the movement of the line relative to divergence levels. If the line is hidden, it will not work.
• When the difference between the chart’s resolution and the intrabar resolution is too great, runtime errors will occur. The Auto-Steps selection mechanisms should avoid this.
• Alerts do not work reliably when `security()` is used at intrabar resolutions. Accordingly, no alerts are configured in the indicator.
• The color model used in the indicator provides for fancy visuals that come at a price; when you change values in Inputs , it can take 20 seconds for the changes to materialize. Luckily, once your color setup is complete, the color model does not have a large performance impact, as in normal operation the `security()` calls will become the most important factor in determining response time. Also, once in a while a runtime error will occur when you change inputs. Just making another change will usually bring the indicator back up.
█ RAMBLINGS
Is this thing useful?
I'll let you decide. Bar Balance acts somewhat like an X-Ray on bars. The intrabars it analyzes are no secret; one can simply change the chart's resolution to see the same intrabars the indicator uses. What the indicator brings to traders is the precise count of up/down/neutral intrabars and, more importantly, the calculations it derives from them to present the information in a way that can make it easier to use in trading decisions.
How reliable is Bar Balance information?
By the same token that an up bar does not guarantee that more up bars will follow, future price movements cannot be inferred from the mere count of up/down/neutral intrabars. Price movement during any chart bar for which, let's say, 12 intrabars are analyzed, could be due to only one of those intrabars. One can thus easily see how only relying on bar balance information could be very misleading. The rationale behind Bar Balance is that when the information mined for multiple chart bars is aggregated, it can provide insight into the history behind chart bars, and thus some bias as to the strength of movements. An up chart bar where 11/12 intrabars are also up is assumed to be stronger than the same up bar where only 2/12 intrabars are up. This logic is not bulletproof, and sometimes Bar Balance will stray. Also, keep in mind that balance lines do not represent price momentum as RSI would. Bar Balance calculations have no idea where price is. Their perspective, like that of any historian, is very limited, constrained that it is to the narrow universe of up/down/neutral intrabar counts. You will thus see instances where price is moving up while Balance Momentum, for example, is moving down. When Bar Balance performs as intended, this indicates that the rally is weakening, which does necessarily imply that price will reverse. Occasionally, price will merrily continue to advance on weakening strength.
Divergences
Most of the divergence detection methods used here rely on a difference between the bias of a calculation involving a multi-bar average and a given bar's price direction. When using "Bar Balance on Bar" however, only the bar's balance and price movement are used. This is the default mode.
As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. I do not share the overwhelming enthusiasm traders have for the purported ability of bullish/bearish divergences to indicate imminent reversals.
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . Bar Balance can display lots of information. While learning to use a new indicator inevitably requires an adaptation period where we put it through its paces and try out all its options, once you have become used to Bar Balance and decide to adopt it, rigorously eliminate the components you don't use and configure the remaining ones so their visual prominence reflects their relative importance in your analysis. I tried to provide flexible options for traders to control this indicator's visuals for that exact reason—not for window dressing.
█ NOTES
For traders
• To avoid misleading traders who don't read script descriptions, the indicator shows nothing in the realtime bar.
• The Data Window shows key values for the indicator.
• All gradients used in this indicator determine their brightness intensities using advances/declines in the signal—not their relative position in a fixed scale.
• Note that because of the way gradients are optimized internally, changing their brightness will sometimes require bringing down the value a few steps before you see an impact.
• Because this indicator does not use volume, it will work on all markets.
For coders
• For those interested in gradients, this script uses an advanced version of the Advance/Decline gradient function from the PineCoders Color Gradient (16 colors) Framework . It allows more precise control over the range, steps and min/max values of the gradients.
• I use the PineCoders Coding Conventions for Pine to write my scripts.
• I used functions modified from the PineCoders MTF Selection Framework for the selection of timeframes.
█ THANKS TO:
— alexgrover who helped me think through the dampening method used to attenuate signal lines on high ratios of neutral intrabars.
— A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator . The technique I use to inspect intrabars is derived from Kuan's code.
— theheirophant , my partner in the exploration of the sometimes weird abysses of `security()`’s behavior at intrabar resolutions.
— midtownsk8rguy , my brilliant companion in mining the depths of Pine graphics. He is also the co-author of the PineCoders Color Gradient Frameworks .
Ichimoku Score by KingThiesiScore, is an Ichimoku-based scoring system, in which individual Ichimoku events are measured by their impact, and then counted towards a greater score, leaning either bullish or bearish. The score tends to be between -3 and 3 for 99% of occurrences. Scores above or below this range are abnormal to say the least.
How the Score is Calculated
Bearish events are negative points. When the score is below zero, bears have control of the given TF. In theory, when the iScore is falling, the market is in downtrend. Note the divergences on reversals. iScore tends to lead price.
Bullish events are positive points. When the score is above zero, bulls have control of the given TF. In theory, when the iScore is rising, the market is in uptrend. Note the divergences on reversals. iScore tends to lead price.
Bullish Events Measured: TK Bull Cross, PK Bull Cross, Lagline Bull Cross, and Leadline Bull Cross
Bearish Events Measured: TK Bear Cross, PK Bear Cross, Lagline Bear Cross & LeadLine Bear Cross
The location of the events are also a factor in the scoring system. Locations include above the kumo, inside the kumo, and below the kumo, and are then prioritized in their own respects, based on the standard rules interpretation of Ichimoku signals, which users can read more into if interested. Links are provided below with further reading.
iScore can be applied to any ticker by any trader, and is not limited to any specific TF. Its programmed in Pine version 4 and uses Heikin Ashi inputs for OHLC, although traders are able to use with any chart type.
Links for Further Reading
Fidelity Ichimoku Summary
Investopedia Intro to Ichimoku Clouds
Cheers!
KT
Delta Volume Columns Pro [LucF]█ OVERVIEW
This indicator displays volume delta information calculated with intrabar inspection on historical bars, and feed updates when running in realtime. It is designed to run in a pane and can display either stacked buy/sell volume columns or a signal line which can be calculated and displayed in many different ways.
Five different models are offered to reveal different characteristics of the calculated volume delta information. Many options are offered to visualize the calculations, giving you much leeway in morphing the indicator's visuals to suit your needs. If you value delta volume information, I hope you will find the time required to master Delta Volume Columns Pro well worth the investment. I am confident that if you combine a proper understanding of the indicator's information with an intimate knowledge of the volume idiosyncrasies on the markets you trade, you can extract useful market intelligence using this tool.
█ WARNINGS
1. The indicator only works on markets where volume information is available,
Please validate that your symbol's feed carries volume information before asking me why the indicator doesn't plot values.
2. When you refresh your chart or re-execute the script on the chart, the indicator will repaint because elapsed realtime bars will then recalculate as historical bars.
3. Because the indicator uses different modes of calculation on historical and realtime bars, it's critical that you understand the differences between them. Details are provided further down.
4. Calculations using intrabar inspection on historical bars can only be done from some chart timeframes. See further down for a list of supported timeframes.
If the chart's timeframe is not supported, no historical volume delta will display.
█ CONCEPTS
Chart bars
Three different types of bars are used in charts:
1. Historical bars are bars that have already closed when the script executes on them.
2. The realtime bar is the current, incomplete bar where a script is running on an open market. There is only one active realtime bar on your chart at any given time.
The realtime bar is where alerts trigger.
3. Elapsed realtime bars are bars that were calculated when they were realtime bars but have since closed.
When a script re-executes on a chart because the browser tab is refreshed or some of its inputs are changed, elapsed realtime bars are recalculated as historical bars.
Why does this indicator use two modes of calculation?
Historical bars on TradingView charts contain OHLCV data only, which is insufficient to calculate volume delta on them with any level of precision. To mine more detailed information from those bars we look at intrabars , i.e., bars from a smaller timeframe (we call it the intrabar timeframe ) that are contained in one chart bar. If your chart Is running at 1D on a 24x7 market for example, most 1D chart bars will contain 24 underlying 1H bars in their dilation. On historical bars, this indicator looks at those intrabars to amass volume delta information. If the intrabar is up, its volume goes in the Buy bin, and inversely for the Sell bin. When price does not move on an intrabar, the polarity of the last known movement is used to determine in which bin its volume goes.
In realtime, we have access to price and volume change for each update of the chart. Because a 1D chart bar can be updated tens of thousands of times during the day, volume delta calculations on those updates is much more precise. This precision, however, comes at a price:
— The script must be running on the chart for it to keep calculating in realtime.
— If you refresh your chart you will lose all accumulated realtime calculations on elapsed realtime bars, and the realtime bar.
Elapsed realtime bars will recalculate as historical bars, i.e., using intrabar inspection, and the realtime bar's calculations will reset.
When the script recalculates elapsed realtime bars as historical bars, the values on those bars will change, which means the script repaints in those conditions.
— When the indicator first calculates on a chart containing an incomplete realtime bar, it will count ALL the existing volume on the bar as Buy or Sell volume,
depending on the polarity of the bar at that point. This will skew calculations for that first bar. Scripts have no access to the history of a realtime bar's previous updates,
and intrabar inspection cannot be used on realtime bars, so this is the only to go about this.
— Even if alerts only trigger upon confirmation of their conditions after the realtime bar closes, they are repainting alerts
because they would perhaps not have calculated the same way using intrabar inspection.
— On markets like stocks that often have different EOD and intraday feeds and volume information,
the volume's scale may not be the same for the realtime bar if your chart is at 1D, for example,
and the indicator is using an intraday timeframe to calculate on historical bars.
— Any chart timeframe can be used in realtime mode, but plots that include moving averages in their calculations may require many elapsed realtime bars before they can calculate.
You might prefer drastically reducing the periods of the moving averages, or using the volume columns mode, which displays instant values, instead of the line.
Volume Delta Balances
This indicator uses a variety of methods to evaluate five volume delta balances and derive other values from those balances. The five balances are:
1 — On Bar Balance : This is the only balance using instant values; it is simply the subtraction of the Sell volume from the Buy volume on the bar.
2 — Average Balance : Calculates a distinct EMA for both the Buy and Sell volumes, and subtracts the Sell EMA from the Buy EMA.
3 — Momentum Balance : Starts by calculating, separately for both Buy and Sell volumes, the difference between the same EMAs used in "Average Balance" and
an SMA of double the period used for the "Average Balance" EMAs. The difference for the Sell side is subtracted from the difference for the Buy side,
and an RSI of that value is calculated and brought over the −50/+50 scale.
4 — Relative Balance : The reference values used in the calculation are the Buy and Sell EMAs used in the "Average Balance".
From those, we calculate two intermediate values using how much the instant Buy and Sell volumes on the bar exceed their respective EMA — but with a twist.
If the bar's Buy volume does not exceed the EMA of Buy volume, a zero value is used. The same goes for the Sell volume with the EMA of Sell volume.
Once we have our two intermediate values for the Buy and Sell volumes exceeding their respective MA, we subtract them. The final "Relative Balance" value is an ALMA of that subtraction.
The rationale behind using zero values when the bar's Buy/Sell volume does not exceed its EMA is to only take into account the more significant volume.
If both instant volume values exceed their MA, then the difference between the two is the signal's value.
The signal is called "relative" because the intermediate values are the difference between the instant Buy/Sell volumes and their respective MA.
This balance flatlines when the bar's Buy/Sell volumes do not exceed their EMAs, which makes it useful to spot areas where trader interest dwindles, such as consolidations.
The smaller the period of the final value's ALMA, the more easily you will see the balance flatline. These flat zones should be considered no-trade zones.
5 — Percent Balance : This balance is the ALMA of the ratio of the "On Bar Balance" value, i.e., the volume delta balance on the bar (which can be positive or negative),
over the total volume for that bar.
From the balances and marker conditions, two more values are calculated:
1 — Marker Bias : It sums the up/down (+1/‒1) occurrences of the markers 1 to 4 over a period you define, so it ranges from −4 to +4, times the period.
Its calculation will depend on the modes used to calculate markers 3 and 4.
2 — Combined Balances : This is the sum of the bull/bear (+1/−1) states of each of the five balances, so it ranges from −5 to +5.
█ FEATURES
The indicator has two main modes of operation: Columns and Line .
Columns
• In Columns mode you can display stacked Buy/Sell volume columns.
• The buy section always appears above the centerline, the sell section below.
• The top and bottom sections can be colored independently using eight different methods.
• The EMAs of the Buy/Sell values can be displayed (these are the same EMAs used to calculate the "Average Balance").
Line
• Displays one of seven signals: the five balances or one of two complementary values, i.e., the "Marker Bias" or the "Combined Balances".
• You can color the line and its fill using independent calculation modes to pack more information in the display.
You can thus appraise the state of 3 different values using the line itself, its color and the color of its fill.
• A "Divergence Levels" feature will use the line to automatically draw expanding levels on divergence events.
Default settings
Using the indicator's default settings, this is the information displayed:
• The line is calculated on the "Average Balance".
• The line's color is determined by the bull/bear state of the "Percent Balance".
• The line's fill gradient is determined by the advances/declines of the "Momentum Balance".
• The orange divergence dots are calculated using discrepancies between the polarity of the "On Bar Balance" and the chart's bar.
• The divergence levels are determined using the line's level when a divergence occurs.
• The background's fill gradient is calculated on advances/declines of the "Marker Bias".
• The chart bars are colored using advances/declines of the "Relative Balance". Divergences are shown in orange.
• The intrabar timeframe is automatically determined from the chart's timeframe so that a minimum of 50 intrabars are used to calculate volume delta on historical bars.
Alerts
The configuration of the marker conditions explained further is what determines the conditions that will trigger alerts created from this script. Note that simply selecting the display of markers does not create alerts. To create an alert on this script, you must use ALT-A from the chart. You can create multiple alerts triggering on different conditions from this same script; simply configure the markers so they define the trigger conditions for each alert before creating the alert. The configuration of the script's inputs is saved with the alert, so from then on you can change them without affecting the alert. Alert messages will mention the marker(s) that triggered the specific alert event. Keep in mind, when creating alerts on small chart timeframes, that discrepancies between alert triggers and markers displayed on your chart are to be expected. This is because the alert and your chart are running two distinct instances of the indicator on different servers and different feeds. Also keep in mind that while alerts only trigger on confirmed conditions, they are calculated using realtime calculation mode, which entails that if you refresh your chart and elapsed realtime bars recalculate as historical bars using intrabar inspection, markers will not appear in the same places they appeared in realtime. So it's important to understand that even though the alert conditions are confirmed when they trigger, these alerts will repaint.
Let's go through the sections of the script's inputs.
Columns
The size of the Buy/Sell columns always represents their respective importance on the bar, but the coloring mode for tops and bottoms is independent. The default setup uses a standard coloring mode where the Buy/Sell columns are always in the bull/bear color with a higher intensity for the winning side. Seven other coloring modes allow you to pack more information in the columns. When choosing to color the top columns using a bull/bear gradient on "Average Balance", for example, you will have bull/bear colored tops. In order for the color of the bottom columns to continue to show the instant bar balance, you can then choose the "On Bar Balance — Dual Solid Colors" coloring mode to make those bars the color of the winning side for that bar. You can display the averages of the Buy and Sell columns. If you do, its coloring is controlled through the "Line" and "Line fill" sections below.
Line and Line fill
You can select the calculation mode and the thickness of the line, and independent calculations to determine the line's color and fill.
Zero Line
The zero line can display dots when all five balances are bull/bear.
Divergences
You first select the detection mode. Divergences occur whenever the up/down direction of the signal does not match the up/down polarity of the bar. Divergences are used in three components of the indicator's visuals: the orange dot, colored chart bars, and to calculate the divergence levels on the line. The divergence levels are dynamic levels that automatically build from the line's values on divergence events. On consecutive divergences, the levels will expand, creating a channel. This implementation of the divergence levels corresponds to my view that divergences indicate anomalies, hesitations, points of uncertainty if you will. It precludes any attempt to identify a directional bias to divergences. Accordingly, the levels merely take note of divergence events and mark those points in time with levels. Traders then have a reference point from which they can evaluate further movement. The bull/bear/neutral colors used to plot the levels are also congruent with this view in that they are determined by the line's position relative to the levels, which is how I think divergences can be put to the most effective use. One of the coloring modes for the line's fill uses advances/declines in the line after divergence events.
Background
The background can show a bull/bear gradient on six different calculations. As with other gradients, you can adjust its brightness to make its importance proportional to how you use it in your analysis.
Chart bars
Chart bars can be colored using seven different methods. You have the option of emptying the body of bars where volume does not increase, as does my TLD indicator, and you can choose whether you want to show divergences.
Intrabar Timeframe
This is the intrabar timeframe that will be used to calculate volume delta using intrabar inspection on historical bars. You can choose between four modes. The three "Auto-steps" modes calculate, from the chart's timeframe, the intrabar timeframe where the said number of intrabars will make up the dilation of chart bars. Adjustments are made for non-24x7 markets. "Fixed" mode allows you to select the intrabar timeframe you want. Checking the "Show TF" box will display in the lower-right corner the intrabar timeframe used at any given moment. The proper selection of the intrabar timeframe is important. It must achieve maximal granularity to produce precise results while not unduly slowing down calculations, or worse, causing runtime errors. Note that historical depth will vary with the intrabar timeframe. The smaller the timeframe, the shallower historical plots you will be.
Markers
Markers appear when the required condition has been confirmed on a closed bar. The configuration of the markers when you create an alert is what determines when the alert will trigger. Five markers are available:
• Balances Agreement : All five balances are either bullish or bearish.
• Double Bumps : A double bump is two consecutive up/down bars with +/‒ volume delta, and rising Buy/Sell volume above its average.
• Divergence confirmations : A divergence is confirmed up/down when the chosen balance is up/down on the previous bar when that bar was down/up, and this bar is up/down.
• Balance Shifts : These are bull/bear transitions of the selected signal.
• Marker Bias Shifts : Marker bias shifts occur when it crosses into bull/bear territory.
Periods
Allows control over the periods of the different moving averages used to calculate the balances.
Volume Discrepancies
Stock exchanges do not report the same volume for intraday and daily (or higher) resolutions. Other variations in how volume information is reported can also occur in other markets, namely Forex, where volume irregularities can even occur between different intraday timeframes. This will cause discrepancies between the total volume on the bar at the chart's timeframe, and the total volume calculated by adding the volume of the intrabars in that bar's dilation. This does not necessarily invalidate the volume delta information calculated from intrabars, but it tells us that we are using partial volume data. A mechanism to detect chart vs intrabar timeframe volume discrepancies is provided. It allows you to define a threshold percentage above which the background will indicate a difference has been detected.
Other Settings
You can control here the display of the gray dot reminder on realtime bars, and the display of error messages if you are using a chart timeframe that is not greater than the fixed intrabar timeframe, when you use that mode. Disabling the message can be useful if you only use realtime mode at chart timeframes that do not support intrabar inspection.
█ RAMBLINGS
On Volume Delta
Volume is arguably the best complement to interpret price action, and I consider volume delta to be the most effective way of processing volume information. In periods of low-volatility price consolidations, volume will typically also be lower than normal, but slight imbalances in the trend of the buy/sell volume balance can sometimes help put early odds on the direction of the break from consolidation. Additionally, the progression of the volume imbalance can help determine the proximity of the breakout. I also find volume delta and the number of divergences very useful to evaluate the strength of trends. In trends, I am looking for "slow and steady", i.e., relatively low volatility and pauses where price action doesn't look like world affairs are being reassessed. In my personal mythology, this type of trend is often more resilient than high-volatility breakouts, especially when volume balance confirms the general agreement of traders signaled by the low-volatility usually accompanying this type of trend. The volume action on pauses will often help me decide between aggressively taking profits, tightening a stop or going for a longer-term movement. As for reversals, they generally occur in high-volatility areas where entering trades is more expensive and riskier. While the identification of counter-trend reversals fascinates many traders to no end, they represent poor opportunities in my view. Volume imbalances often precede reversals, but I prefer to use volume delta information to identify the areas following reversals where I can confirm them and make relatively low-cost entries with better odds.
On "Buy/Sell" Volume
Buying or selling volume are misnomers, as every unit of volume transacted is both bought and sold by two different traders. While this does not keep me from using the terms, there is no such thing as “buy only” or “sell only” volume. Trader lingo is riddled with peculiarities.
Divergences
The divergence detection method used here relies on a difference between the direction of a signal and the polarity (up/down) of a chart bar. When using the default "On Bar Balance" to detect divergences, however, only the bar's volume delta is used. You may wonder how there can be divergences between buying/selling volume information and price movement on one bar. This will sometimes be due to the calculation's shortcomings, but divergences may also occur in instances where because of order book structure, it takes less volume to increase the price of an asset than it takes to decrease it. As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. To your pattern-hungry brain, the divergences displayed by this indicator will — as they do on other indicators — appear to often indicate turnarounds. My opinion is that reality is generally quite sobering and I have no reliable information that would tend to prove otherwise. Exercise caution when using them. Consequently, I do not share the overwhelming enthusiasm of traders in identifying bullish/bearish divergences. For me, the best course of action when a divergence occurs is to wait and see what happens from there. That is the rationale underlying how my divergence levels work; they take note of a signal's level when a divergence occurs, and it's the signal's behavior from that point on that determines if the post-divergence action is bullish/bearish.
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . This indicator can display lots of information. While learning to use a new indicator inevitably requires an adaptation period where we put it through its paces and try out all its options, once you have become used to it and decide to adopt it, rigorously eliminate the components you don't use and configure the remaining ones so their visual prominence reflects their relative importance in your analysis. I tried to provide flexible options for traders to control this indicator's visuals for that exact reason — not for window dressing.
█ LIMITATIONS
• This script uses a special characteristic of the `security()` function allowing the inspection of intrabars — which is not officially supported by TradingView.
It has the advantage of permitting a more robust calculation of volume delta than other methods on historical bars, but also has its limits.
• Intrabar inspection only works on some chart timeframes: 3, 5, 10, 15 and 30 minutes, 1, 2, 3, 4, 6, and 12 hours, 1 day, 1 week and 1 month.
The script’s code can be modified to run on other resolutions.
• When the difference between the chart’s timeframe and the intrabar timeframe is too great, runtime errors will occur. The Auto-Steps selection mechanisms should avoid this.
• All volume is not created equally. Its source, components, quality and reliability will vary considerably with sectors and instruments.
The higher the quality, the more reliably volume delta information can be used to guide your decisions.
You should make it your responsibility to understand the volume information provided in the data feeds you use. It will help you make the most of volume delta.
█ NOTES
For traders
• The Data Window shows key values for the indicator.
• While this indicator displays some of the same information calculated in my Delta Volume Columns ,
I have elected to make it a separate publication so that traders continue to have a simpler alternative available to them. Both code bases will continue to evolve separately.
• All gradients used in this indicator determine their brightness intensities using advances/declines in the signal—not their relative position in a pre-determined scale.
• Volume delta being relative, by nature, it is particularly well-suited to Forex markets, as it filters out quite elegantly the cyclical volume data characterizing the sector.
If you are interested in volume delta, consider having a look at my other "Delta Volume" indicators:
• Delta Volume Realtime Action displays realtime volume delta and tick information on the chart.
• Delta Volume Candles builds volume delta candles on the chart.
• Delta Volume Columns is a simpler version of this indicator.
For coders
• I use the `f_c_gradientRelativePro()` from the PineCoders Color Gradient Framework to build my gradients.
This function has the advantage of allowing begin/end colors for both the bull and bear colors. It also allows us to define the number of steps allowed for each gradient.
I use this to modulate the gradients so they perform optimally on the combination of the signal used to calculate advances/declines,
but also the nature of the visual component the gradient applies to. I use fewer steps for choppy signals and when the gradient is used on discrete visual components
such as volume columns or chart bars.
• I use the PineCoders Coding Conventions for Pine to write my scripts.
• I used functions modified from the PineCoders MTF Selection Framework for the selection of timeframes.
█ THANKS TO:
— The devs from TradingView's Pine and other teams, and the PineCoders who collaborate with them. They are doing amazing work,
and much of what this indicator does could not be done without their recent improvements to Pine.
— A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator using a `for` loop.
This indicator started from the intrabar inspection technique illustrated in Kuan's snippet.
— theheirophant , my partner in the exploration of the sometimes weird abysses of `security()`’s behavior at intrabar timeframes.
— midtownsk8rguy , my brilliant companion in mining the depths of Pine graphics.
9 Seasons Rainbow Indicator PRO [GO8686]Trading on 5 minutes frame can be as reasonable as on 4H frame, use 9 Seasons Rainbow Indicator PRO for both.
5分钟维度的交易可以与4小时维度一样合理,请使用9季彩虹指标 PRO 。
Market is full of life, with seasons.
9 Seasons Rainbow Indicator displays 9 seasons of any trading instrument in multiple time frames, helping traders and investors understand the flow of price.
The combination of seasons in different time dimensions may give perfect trading signals, for instance: overbought in both small time frame and big time frame has high success probability of shorting trade.
Please install the indicator: Demo, PRO or STANDARD Version. Apply the indicator to your favorites trading instruments: indices, stocks, futures , forex or crypto currencies. Find your patterns that make money.
---------- 9 Seasons ----------
Bull(Green), evolves into BullRest, OverBought, Bear, or Neutral
Bull Rest(Light Green): a pullback or retracement, evolves into Bull or Bear
OverBought(Yellow): may have defined a top or resistance, can happen in range, evolves into CrazyBought or Bear
CrazyBought(Lime): going up in a high volatility , evolves into Bear, OverBought, or BullRest
Neutral(White): a wandering season without direction, evolves into Bull or Bear
Bear(Red), evolves into BearRest, OverSold, Bull or Neutral
Bear Rest(Light Red): a bounce, evolves into Bear or Bull
OverSold(Blue): may have defined a bottom or support, can happen in range, evolves into CrazySold or Bull
CrazySold(Fuchsia): going down in a high volatility , evolves into Bull, OverSold, or BearRest
---------- Some important evolutions of seasons ----------
OverBought -> CrazyBought: can happen with a breakout
CrazyBought -> OverBought or Bear: could mean fading of a breakout
CrazyBought -> BullRest: can happen after rising over a new level
OverSold -> CrazySold: can happen with a breakdown
CrazySold -> OverSold or Bear: could mean fading of a breakdown
CrazySold -> BearRest: can happen after dropping to a new level
---------- Rainbow Ribbons for multiple time frames ----------
Each ribbon of the rainbow represents a time frame,
The difference between two frames is 1.4142 fold (square root of 2), if level 1 is 15 M, level 2 is 15 * (square root of 2) M. level 3 is 15*2 M, level 4 is 30 * (square root of 2) M, level 5 is 30 * 2 m etc.
The uppermost ribbon represents the smallest time frame - current time period of the chart.
The lower ribbons represent bigger time frames, which work as context.
Examples for time frame rainbow:
For DEMO in 30M: 30M - 42M - 60M(1H) - 85M - 120M(2H) - 170M - 240M(4H) - 339M
For STANDARD in 15M: 15M - 21M - 30M - 42M - 60M(1H) - 85M - 120M(2H) - 170M
For PRO in 15M: 15M - 21M - 30M - 42M - 60M(1H) - 85M - 120M(2H) - 170M - 240M(4H) - 339M - 480M(8H) - 679M
---------- Versions Description ----------
The features may change later, please refer to latest update.
PRO:
PRO version of 9 Seasons Rainbow Indicator is invite-only, with the following advanced features:
12 Ribbon Rainbow lets you discover trading opportunities hidden in the 1.4142 fold time dimension while monitoring market conditions spanning 45 times.
Advanced alert sets allows you set alerts for Overbought, Crazybought, OverSold, CrazySold on low, medium, and high time frames.
Option to input different trading instrument to compare with the current ticker.
Full time periods access allows you to watch the market on broadest time dimensions.
More new features in updates.
STANDARD:
This is STANDARD version of 9 Seasons Rainbow Indicator, invite-only, with the following advanced features:
8 Ribbon Rainbow lets you discover trading opportunities hidden in the 1.4142 fold time dimension while monitoring market conditions spanning 11 times.
Advanced alert sets allows you set alerts for Overbought, Crazybought, OverSold, CrazySold on upper and lower time frames.
Broad time periods access allows you to watch the market on popular time dimensions from 15M - 1D,2D,3D,4D,5D,6D,1W.
More new features in updates.
DEMO:
A DEMO of Standard version for trial purpose, having most the functions except alert preset conditions.
It is applicable to a list of trading instruments and specific time periods(30m-1D), which may change later. please refer to latest updates.
---List of tickers applicable for Demo version.
Currency Index:AXY, BXY , CXY , DXY , EXY , JXY , SXY , ZXY ,
Stock Index:SPX,TSX, DAX , NI225 ,KOSPI,399001, SHCOMP , HSI , XJO , TAIEX , SX5E ,
Crypto:BTCUSD
Commodity:BCOUSD, GOLD
---------- Access to Indicators ----------
Please use DEMO version to taste the indicator.
Please contact the author for access to PRO or Standard versions.
---------- About Loading Time ----------
It may take up to 2 minutes for your browser to load a new setting, depending on the your computer and network speed.
---------- List of the author's Indicators ----------
tradingview.com/u/go8686/#published-scripts
---------- Disclaim ----------
By using or requesting access to this indicator, you acknowledge that you have read and accepted that this indicator is for study purposes only and it does NOT guarantee you will make money.
I am not financial adviser and I am NOT responsible for any profits or losses you may incur by using this indicator!
Users should make their own decisions, carefully assess risks and be responsible for investment and trading activities.
The latest updates override the previous description. Please check the updates.
9季彩虹指标 PRO
市场充满生机。
9季彩虹指标在多个时间维度上显示任何交易品种的9个季节交替,帮助交易者和投资者了解价格流动。
不同时间维度的季节组合可以给出完美的交易信号,例如:在小时间框架和大时间框架上同时出现超买具有很高的卖空交易成功概率。
请安装指标:DEMO,STANDARD 或者 PRO 版本. 应用指标到您的交易品种:证券,期货,外汇或者加密货币。找到属于您的盈利模式。
---------- 季节的定义 ----------
牛(绿色),可以演变到牛市回调,超买,熊 或者 中性
牛市回调(淡绿色):可以演变到牛或者熊
超买(黄色),可能刚刚定义了一个头部或者阻力区,可以发生在盘整期,可以演变到狂买或者熊
狂买(亮绿色):高波动性上涨,可以演变到熊,超买或者牛市回调
中性(白色): 没有方向的徘徊期,可以演变到牛或者熊
熊(红色),可以演变到熊市反弹,超卖,牛 或者 中性
熊市反弹(淡红色),可以演变到熊或者牛
超卖(蓝色),可能刚刚定义了一个底部或者支撑,可以发生在盘整期,可以演变到狂卖或者牛
狂卖(紫红色),高波动性下跌,可以演变到牛,超卖 或者熊市反弹
一些重要的季节交替
超买 -> 狂买:可能发生在向上突破时
狂买 -> 熊 或者 超买:可能发生在突破失败时
狂买 -> 牛市回调: 可能发生在上平台后
超卖 -> 狂卖:可能发生在向下突破时
狂卖 -> 牛 或者 超卖:可能发生在突破失败时
狂卖 -> 熊市回调: 可能发生在下平台后
---------- 色带彩虹所代表的时间维度 ----------
每条色带代表一个时间维度。
色带间隔1.4142倍(2的开方),如果第一维度是15分钟,第二维度是15*1.4142=21分钟,第三维度是15*2=30分钟,以此类推。
最上面的色带代表最小的时间维度,也就是目前图表的时间维度
最下面的色带代表最大的时间维度。
例子:
演示版: 30m-42m-60m(1H)-85m-120m(2H)-170m-240m(4H)-339m
标准版: 15m-21m-30m-42m-60m(1H)-85m-120m(2H)-170m
专业版: 15m-21m-30m-42m-60m(1H)-85m-120m(2H)-170m-240m(4H)-339m-480m(8H)-679m
---------- 不同版本功能描述 ----------
这些特征及功能可能会发生变化,以更新为准。
---专业版PRO高级特征
12色带彩虹让您发现隐藏在1.4142时间维度的交易机会,同时监控时间跨度达四十五倍的市场状态
高级警报功能:允许您在低,中,高时间帧上设置超买,狂买,超卖,狂卖的警报。
可以输入不同的交易品种用于指标,便于与当前交易品种进行比较。
全时间维度(分钟到日线级别)给您全视角观察市场
更新中的更多新功能。
---标准版STANDARD特征
8色带彩虹让您发现隐藏在1.4142时间维度的交易机会,同时监控时间跨度达十一倍的市场状态
高级警报功能:允许您在低,高时间层级上设置超买,狂买,超卖,狂卖的警报。
宽时间维度(15分钟到日线级别)让您从更宽阔的视角观察市场
更新中的更多新功能。
--演示版DEMO
演示版用于标准版的演示和试用,适用于特定的资产列表和时间维度(30M-1D),后续可能调整.
适用的品种列表
AXY , BXY , CXY , DXY , EXY , JXY , SXY , ZXY ,
SPX ,TSX, DAX , NI225 ,KOSPI,399001, SHCOMP , HSI , XJO , TAIEX , SX5E ,
BTCUSD , BCOUSD , GOLD
---------- 获得使用权 ----------
请使用演示版以初步了解指标的运行机理。
联系指标开发者以取得标准版和专业版的使用权
---------- 开发者的指标列表 ----------
tradingview.com/u/go8686/#published-scripts
---------- 加载时间 ----------
可能需要2分钟,取决于网络和电脑配置。
---------- 免责声明 ----------
在要求获得本指标使用权之前以及在使用本指标之前,用户认可已经完全了解和接受:本指标仅供研究目的, 它不提供任何赢利的可能性。
本指标的开发者并非专业投资顾问,因此不对用户的任何赢亏负责。
用户应独立判断,审慎评估并自负投资和交易风险!
最近的更新会覆盖之前的说明。 请参阅更新来查看指标的新特征和功能。
9 Seasons Rainbow Indicator STANDARD [GO8686]Market is full of life, with seasons.
9 Seasons Rainbow Indicator displays 9 seasons of any trading instrument in multiple time frames, helping traders and investors understand the flow of price.
The combination of seasons in different time dimensions may give perfect trading signals, for instance: overbought in both small time frame and big time frame has high success probability of shorting trade.
Please install the indicator: Demo, PRO or STANDARD Version. Apply the indicator to your favorites trading instruments: indices, stocks, futures , forex or crypto currencies. Find your patterns that make money.
---------- 9 Seasons ----------
Bull(Green), evolves into BullRest, OverBought, Bear, or Neutral
Bull Rest(Light Green): a pullback or retracement, evolves into Bull or Bear
OverBought(Yellow): may have defined a top or resistance, can happen in range, evolves into CrazyBought or Bear
CrazyBought(Lime): going up in a high volatility , evolves into Bear, OverBought, or BullRest
Neutral(White): a wandering season without direction, evolves into Bull or Bear
Bear(Red), evolves into BearRest, OverSold, Bull or Neutral
Bear Rest(Light Red): a bounce, evolves into Bear or Bull
OverSold(Blue): may have defined a bottom or support, can happen in range, evolves into CrazySold or Bull
CrazySold(Fuchsia): going down in a high volatility , evolves into Bull, OverSold, or BearRest
---------- Some important evolutions of seasons ----------
OverBought -> CrazyBought: can happen with a breakout
CrazyBought -> OverBought or Bear: could mean fading of a breakout
CrazyBought -> BullRest: can happen after rising over a new level
OverSold -> CrazySold: can happen with a breakdown
CrazySold -> OverSold or Bear: could mean fading of a breakdown
CrazySold -> BearRest: can happen after dropping to a new level
---------- Rainbow Ribbons for multiple time frames ----------
Each ribbon of the rainbow represents a time frame,
The difference between two frames is 1.4142 fold (square root of 2), if level 1 is 15 M, level 2 is 15 * (square root of 2) M. level 3 is 15*2 M, level 4 is 30 * (square root of 2) M, level 5 is 30 * 2 m etc.
The uppermost ribbon represents the smallest time frame - current time period of the chart.
The lower ribbons represent bigger time frames, which work as context.
Examples for time frame rainbow:
For DEMO in 30M: 30M - 42M - 60M(1H) - 85M - 120M(2H) - 170M - 240M(4H) - 339M
For STANDARD in 15M: 15M - 21M - 30M - 42M - 60M(1H) - 85M - 120M(2H) - 170M
For PRO in 15M: 15M - 21M - 30M - 42M - 60M(1H) - 85M - 120M(2H) - 170M - 240M(4H) - 339M - 480M(8H) - 679M
---------- Versions Description ----------
The features may change later, please refer to latest update.
STANDARD:
This is STANDARD version of 9 Seasons Rainbow Indicator, invite-only, with the following advanced features:
8 Ribbon Rainbow lets you discover trading opportunities hidden in the 1.4142 fold time dimension while monitoring market conditions spanning 11 times.
Advanced alert sets allows you set alerts for Overbought, Crazybought, OverSold, CrazySold on upper and lower time frames.
Broad time periods access allows you to watch the market on popular time dimensions from 15M - 1D,2D,3D,4D,5D,6D,1W.
More new features in updates.
PRO:
PRO version of 9 Seasons Rainbow Indicator is invite-only, with the following advanced features:
12 Ribbon Rainbow lets you discover trading opportunities hidden in the 1.4142 fold time dimension while monitoring market conditions spanning 45 times.
Advanced alert sets allows you set alerts for Overbought, Crazybought, OverSold, CrazySold on low, medium, and high time frames.
Option to input different trading instrument to compare with the current ticker.
Full time periods access allows you to watch the market on broadest time dimensions.
More new features in updates.
DEMO:
A DEMO of Standard version for trial purpose, having most the functions except alert preset conditions.
It is applicable to a list of trading instruments and specific time periods(30m-1D), which may change later. please refer to latest updates.
---List of tickers applicable for Demo version.
Currency Index:AXY, BXY , CXY , DXY , EXY , JXY , SXY , ZXY ,
Stock Index:SPX,TSX, DAX , NI225 ,KOSPI,399001, SHCOMP , HSI , XJO , TAIEX , SX5E ,
Crypto:BTCUSD
Commodity:BCOUSD, GOLD
---------- Access to Indicators ----------
Please contact the author for access to PRO or Standard versions.
---------- About Loading Time ----------
It may take up to 2 minutes for your browser to load a new setting, depending on the your computer and network speed.
---------- List of the author's Indicators ----------
tradingview.com/u/go8686/#published-scripts
---------- Disclaim ----------
By using or requesting access to this indicator, you acknowledge that you have read and accepted that this indicator is for study purposes only and it does NOT guarantee you will make money.
I am not financial adviser and I am NOT responsible for any profits or losses you may incur by using this indicator!
Users should make their own decisions, carefully assess risks and be responsible for investment and trading activities.
The latest updates override the previous description. Please check the updates.
9季彩虹指标 标准版 STANDARD
市场充满生机。
9季彩虹指标在多个时间维度上显示任何交易品种的9个季节交替,帮助交易者和投资者了解价格流动。
不同时间维度的季节组合可以给出完美的交易信号,例如:在小时间框架和大时间框架上同时出现超买具有很高的卖空交易成功概率。
请安装指标:DEMO,STANDARD 或者 PRO 版本. 应用指标到您的交易品种:证券,期货,外汇或者加密货币。找到属于您的盈利模式。
---------- 季节的定义 ----------
牛(绿色),可以演变到牛市回调,超买,熊 或者 中性
牛市回调(淡绿色):可以演变到牛或者熊
超买(黄色),可能刚刚定义了一个头部或者阻力区,可以发生在盘整期,可以演变到狂买或者熊
狂买(亮绿色):高波动性上涨,可以演变到熊,超买或者牛市回调
中性(白色): 没有方向的徘徊期,可以演变到牛或者熊
熊(红色),可以演变到熊市反弹,超卖,牛 或者 中性
熊市反弹(淡红色),可以演变到熊或者牛
超卖(蓝色),可能刚刚定义了一个底部或者支撑,可以发生在盘整期,可以演变到狂卖或者牛
狂卖(紫红色),高波动性下跌,可以演变到牛,超卖 或者熊市反弹
一些重要的季节交替
超买 -> 狂买:可能发生在向上突破时
狂买 -> 熊 或者 超买:可能发生在突破失败时
狂买 -> 牛市回调: 可能发生在上平台后
超卖 -> 狂卖:可能发生在向下突破时
狂卖 -> 牛 或者 超卖:可能发生在突破失败时
狂卖 -> 熊市回调: 可能发生在下平台后
---------- 色带彩虹所代表的时间维度 ----------
每条色带代表一个时间维度。
色带间隔1.4142倍(2的开方),如果第一维度是15分钟,第二维度是15*1.4142=21分钟,第三维度是15*2=30分钟,以此类推。
最上面的色带代表最小的时间维度,也就是目前图表的时间维度
最下面的色带代表最大的时间维度。
例子:
演示版: 30m-42m-60m(1H)-85m-120m(2H)-170m-240m(4H)-339m
标准版: 15m-21m-30m-42m-60m(1H)-85m-120m(2H)-170m
专业版: 15m-21m-30m-42m-60m(1H)-85m-120m(2H)-170m-240m(4H)-339m-480m(8H)-679m
---------- 不同版本功能描述 ----------
这些特征及功能可能会发生变化,以更新为准。
---标准版STANDARD特征
8色带彩虹让您发现隐藏在1.4142时间维度的交易机会,同时监控时间跨度达十一倍的市场状态
高级警报功能:允许您在低,高时间层级上设置超买,狂买,超卖,狂卖的警报。
宽时间维度(15分钟到日线级别)让您从更宽阔的视角观察市场
更新中的更多新功能。
---专业版PRO高级特征
12色带彩虹让您发现隐藏在1.4142时间维度的交易机会,同时监控时间跨度达四十五倍的市场状态
高级警报功能:允许您在低,中,高时间帧上设置超买,狂买,超卖,狂卖的警报。
可以输入不同的交易品种用于指标,便于与当前交易品种进行比较。
全时间维度(分钟到日线级别)给您全视角观察市场
更新中的更多新功能。
--演示版DEMO
演示版用于标准版的演示和试用,适用于特定的资产列表和时间维度(30M-1D),后续可能调整.
适用的品种列表
AXY , BXY , CXY , DXY , EXY , JXY , SXY , ZXY ,
SPX ,TSX, DAX , NI225 ,KOSPI,399001, SHCOMP , HSI , XJO , TAIEX , SX5E ,
BTCUSD , BCOUSD , GOLD
---------- 获得使用权 ----------
联系指标开发者以取得标准版和专业版的使用权
---------- 开发者的指标列表 ----------
tradingview.com/u/go8686/#published-scripts
---------- 加载时间 ----------
可能需要2分钟,取决于网络和电脑配置。
---------- 免责声明 ----------
在要求获得本指标使用权之前以及在使用本指标之前,用户认可已经完全了解和接受:本指标仅供研究目的, 它不提供任何赢利的可能性。
本指标的开发者并非专业投资顾问,因此不对用户的任何赢亏负责。
用户应独立判断,审慎评估并自负投资和交易风险!
最近的更新会覆盖之前的说明。 请参阅更新来查看指标的新特征和功能。
Mig Trade Model - Kill Zones
Key features:
Liquidity Hunt Detection: Spots aggressive moves that "hunt" stops beyond recent swing highs/lows.
Consolidation Filter: Requires 1-3 small-range candles after a hunt before confirming with a strong candle.
Bias Application: Uses daily open/close to auto-detect bias or allows manual override.
Kill Zone Restriction: Limits signals to London (default: 7-10 AM UTC) and NY (default: 12-3 PM UTC) sessions for better relevance in active markets.
This strategy is inspired by smart money concepts (SMC) and ICT (Inner Circle Trader) methodologies, aiming to capture venom-like "stings" in price action where liquidity is grabbed before reversals.
How It Works
ATR Calculation: Uses a user-defined ATR length (default: 14) to measure volatility, which scales candle body and range thresholds.
Bias Determination:
Auto: Compares daily close to open (bullish if close > open).
Manual: User selects "Bullish" or "Bearish."
Strong Candles:
Bullish: Green candle with body > 2x ATR (configurable).
Bearish: Red candle with body > 2x ATR.
Small Range Candles:
Candles where high-low < 0.5x ATR (configurable).
Liquidity Hunt:
Bullish Hunt: Strong bearish candle making a new low below the past swing low (default: 10 bars).
Bearish Hunt: Strong bullish candle making a new high above the past swing high.
Signal Generation:
After a hunt, counts 1-3 small-range candles.
Confirms with a strong candle in the opposite direction (e.g., strong bullish after bearish hunt).
Resets if >3 small candles or an opposing strong candle appears.
Kill Zone Filter:
Checks if the current bar's time (in UTC) falls within London or NY Kill Zones.
Only allows final "Buy" (bullish entry) or "Sell" (bearish entry) if bias matches and in Kill Zone.
Plots:
Yellow circle (below): Bullish liquidity hunt.
Orange circle (above): Bearish liquidity hunt.
Blue diamond (below): Raw bullish signal.
Purple diamond (above): Raw bearish signal.
Green triangle up ("Buy"): Filtered bullish entry.
Red triangle down ("Sell"): Filtered bearish entry.
Inputs
Bias: "Auto" (default), "Bullish", or "Bearish" – Controls signal direction based on daily trend.
ATR Length: 14 (default) – Period for ATR calculation.
Swing Length for Liquidity Hunt: 10 (default) – Bars to look back for swing highs/lows.
Strong Candle Body Multiplier (x ATR): 2.0 (default) – Threshold for strong candle bodies.
Small Range Multiplier (x ATR): 0.5 (default) – Threshold for small-range candles.
London Kill Zone Start/End Hour (UTC): 7/10 (default) – Customize London session hours.
NY Kill Zone Start/End Hour (UTC): 12/15 (default) – Customize New York session hours.
Usage Tips
Timeframe: Best on lower timeframes (e.g., 5-15 min) for intraday trading, especially forex pairs like EURUSD or GBPUSD.
Timezone Adjustment: Inputs are in UTC. If your chart is in a different timezone (e.g., EST = UTC-5), adjust hours accordingly (e.g., London: 2-5 AM EST → 7-10 UTC).
Risk Management: Use with stop-loss (e.g., beyond the hunt low/high) and take-profit based on ATR multiples. Not financial advice—backtest thoroughly.
Customization: Tweak multipliers for different assets; higher for volatile cryptos, lower for stocks.
Limitations: Relies on historical data; may generate false signals in ranging markets. Combine with other indicators like volume or support/resistance.
This indicator is for educational purposes. Always use discretion and proper risk management in live trading. If you find it useful, feel free to share feedback or suggestions!
MSTY-WNTR Rebalancing SignalMSTY-WNTR Rebalancing Signal
## Overview
The **MSTY-WNTR Rebalancing Signal** is a custom TradingView indicator designed to help investors dynamically allocate between two YieldMax ETFs: **MSTY** (YieldMax MSTR Option Income Strategy ETF) and **WNTR** (YieldMax Short MSTR Option Income Strategy ETF). These ETFs are tied to MicroStrategy (MSTR) stock, which is heavily influenced by Bitcoin's price due to MSTR's significant Bitcoin holdings.
MSTY benefits from upward movements in MSTR (and thus Bitcoin) through a covered call strategy that generates income but caps upside potential. WNTR, on the other hand, provides inverse exposure, profiting from MSTR declines but losing in rallies. This indicator uses Bitcoin's momentum and MSTR's relative strength to signal when to hold MSTY (bullish phases), WNTR (bearish phases), or stay neutral, aiming to optimize returns by switching allocations at key turning points.
Inspired by strategies discussed in crypto communities (e.g., X posts analyzing MSTR-linked ETFs), this indicator promotes an active rebalancing approach over a "set and forget" buy-and-hold strategy. In simulated backtests over the past 12 months (as of August 4, 2025), the optimized version has shown potential to outperform holding 100% MSTY or 100% WNTR alone, with an illustrative APY of ~125% vs. ~6% for MSTY and ~-15% for WNTR in one scenario.
**Important Disclaimer**: This is not financial advice. Past performance does not guarantee future results. Always consult a financial advisor. Trading involves risk, and you could lose money. The indicator is for educational and informational purposes only.
## Key Features
- **Momentum-Based Signals**: Uses a Simple Moving Average (SMA) on Bitcoin's price to detect bullish (price > SMA) or bearish (price < SMA) trends.
- **RSI Confirmation**: Incorporates MSTR's Relative Strength Index (RSI) to filter signals, avoiding overbought conditions for MSTY and oversold for WNTR.
- **Visual Cues**:
- Green upward triangle for "Hold MSTY".
- Red downward triangle for "Hold WNTR".
- Yellow cross for "Switch" signals.
- Background color: Green for MSTY, red for WNTR.
- **Information Panel**: A table in the top-right corner displays real-time data: BTC Price, SMA value, MSTR RSI, and current Allocation (MSTY, WNTR, or Neutral).
- **Alerts**: Configurable alerts for holding MSTY, holding WNTR, or switching.
- **Optimized Parameters**: Defaults are tuned (SMA: 10 days, RSI: 15 periods, Overbought: 80, Oversold: 20) based on simulations to reduce whipsaws and capture trends effectively.
## How It Works
The indicator's logic is straightforward yet effective for volatile assets like Bitcoin and MSTR:
1. **Primary Trigger (Bitcoin Momentum)**:
- Calculate the SMA of Bitcoin's closing price (default: 10-day).
- Bullish: Current BTC price > SMA → Potential MSTY hold.
- Bearish: Current BTC price < SMA → Potential WNTR hold.
2. **Secondary Filter (MSTR RSI Confirmation)**:
- Compute RSI on MSTR stock (default: 15-period).
- For bullish signals: If RSI > Overbought (80), signal Neutral (avoid overextended rallies).
- For bearish signals: If RSI < Oversold (20), signal Neutral (avoid capitulation bottoms).
3. **Allocation Rules**:
- Hold 100% MSTY if bullish and not overbought.
- Hold 100% WNTR if bearish and not oversold.
- Neutral otherwise (e.g., during choppy or extreme markets) – consider holding cash or avoiding trades.
4. **Rebalancing**:
- Switch signals trigger when the hold changes (e.g., from MSTY to WNTR).
- Recommended frequency: Weekly reviews or on 5% BTC moves to minimize trading costs (aim for 4-6 trades/year).
This approach leverages Bitcoin's influence on MSTR while mitigating the risks of MSTY's covered call drag during downtrends and WNTR's losses in uptrends.
## Setup and Usage
1. **Chart Requirements**:
- Apply this indicator to a Bitcoin chart (e.g., BTCUSD on Binance or Coinbase, daily timeframe recommended).
- Ensure MSTR stock data is accessible (TradingView supports it natively).
2. **Adding to TradingView**:
- Open the Pine Editor.
- Paste the script code.
- Save and add to your chart.
- Customize inputs if needed (e.g., adjust SMA/RSI lengths for different timeframes).
3. **Interpretation**:
- **Green Background/Triangle**: Allocate 100% to MSTY – Bitcoin is in an uptrend, MSTR not overbought.
- **Red Background/Triangle**: Allocate 100% to WNTR – Bitcoin in downtrend, MSTR not oversold.
- **Yellow Switch Cross**: Rebalance your portfolio immediately.
- **Neutral (No Signal)**: Panel shows "Neutral" – Hold cash or previous position; reassess weekly.
- Monitor the panel for key metrics to validate signals manually.
4. **Backtesting and Strategy Integration**:
- Convert to a strategy script by changing `indicator()` to `strategy()` and adding entry/exit logic for automated testing.
- In simulations (e.g., using Python or TradingView's backtester), it has outperformed buy-and-hold in volatile markets by ~100-200% relative APY, but results vary.
- Factor in fees: ETF expense ratios (~0.99%), trading commissions (~$0.40/trade), and slippage.
5. **Risk Management**:
- Use with a diversified portfolio; never allocate more than you can afford to lose.
- Add stop-losses (e.g., 10% trailing) to protect against extreme moves.
- Rebalance sparingly to avoid over-trading in sideways markets.
- Dividends: Reinvest MSTY/WNTR payouts into the current hold for compounding.
## Performance Insights (Simulated as of August 4, 2025)
Based on synthetic backtests modeling the last 12 months:
- **Optimized Strategy APY**: ~125% (by timing switches effectively).
- **Hold 100% MSTY APY**: ~6% (gains from BTC rallies offset by downtrends).
- **Hold 100% WNTR APY**: ~-15% (losses in bull phases outweigh bear gains).
In one scenario with stronger volatility, the strategy achieved ~4533% APY vs. 10% for MSTY and -34% for WNTR, highlighting its potential in dynamic markets. However, these are illustrative; real results depend on actual BTC/MSTR movements. Test thoroughly on historical data.
## Limitations and Considerations
- **Data Dependency**: Relies on accurate BTC and MSTR data; delays or gaps can affect signals.
- **Market Risks**: Bitcoin's volatility can lead to false signals (whipsaws); the RSI filter helps but isn't perfect.
- **No Guarantees**: This indicator doesn't predict the future. MSTR's correlation to BTC may change (e.g., due to regulatory events).
- **Not for All Users**: Best for intermediate/advanced traders familiar with ETFs and crypto. Beginners should paper trade first.
- **Updates**: As of August 4, 2025, this is version 1.0. Future updates may include volume filters or EMA options.
If you find this indicator useful, consider leaving a like or comment on TradingView. Feedback welcome for improvements!
LTPI Global Liquidity | JeffreyTimmermansLong-Term Probability Indicator (LTPI)
The "Long-Term Probability Indicator (LTPI)" on a generic liquidity ticker is a custom-built analytical tool designed to evaluate market conditions over a long-term horizon, with a strong focus on global liquidity trends. By combining six carefully selected input signals into a single probability score, this indicator helps traders and analysts identify prevailing long-term market states: Bullish, Bearish, or Neutral.
Where short-term systems/timeframes react quickly to price fluctuations, LTPI smooths out noise and focuses on the bigger picture, allowing for informed strategic decision-making rather than short-term speculation.
Key Features
Multi-Input Aggregation:
Uses six independent inputs, each based on long-term liquidity and macro-related data, to generate a composite market probability score.
Long-Term Focus:
Prioritizes medium-to-long-term trends, ignoring smaller fluctuations that often mislead traders in volatile markets.
Simplified Market States:
Classifies the global market into three primary states:
Bullish: Favorable liquidity and conditions for long-term risk-taking.
Bearish: Tightening liquidity and conditions that require caution.
Neutral: Transitional phases or uncertain conditions.
Background Coloring:
Visual cues on the chart help identify which regime is active at a glance.
Global Liquidity Perspective:
Designed for use on a generic liquidity ticker, based on M2 money supply, to track macroeconomic liquidity flows and risk appetite.
Dashboard Display:
A compact on-screen table summarizes all six inputs, their states, and the resulting LTPI score.
Dynamic Alerts:
Real-time alerts signal when the LTPI shifts from one regime to another.
Inputs & Settings
LTPI Inputs:
Input Sources (6): Each input is a carefully chosen trend following indicator.
Weighting: Each input contributes equally to the final score.
Score Calculation:
Bullish = +1
Bearish = -1
Neutral = 0
Color Settings:
Strong Bullish: Bright Green
Weak Bullish: Light Green
Neutral: Gray/Orange
Weak Bearish: Light Red
Strong Bearish: Bright Red
(Colors can be customized.)
Calculation Process
Collect Data:
Six long-term inputs are evaluated at each bar.
Scoring:
Each input’s state contributes +1 (bullish), -1 (bearish), or around 0 (neutral).
Aggregate Probability:
The LTPI Score is calculated as the sum of all six scores divided by 6, resulting in a value between -1 and +1.
Market Classification:
Score > 0.1: Bullish regime
Score < -0.1: Bearish regime
-0.1 ≤ Score ≤ 0.1: Neutral
Background Coloring:
Background colors are applied to highlight the current regime.
How to Use LTPI
Strategic Positioning:
Bullish: Favor holding or adding to long-term positions.
Bearish: Reduce risk, protect capital.
Neutral: Wait for confirmation before making significant moves.
Confirmation Tool:
LTPI works best when combined with shorter-term indicators like MTPI or trend-following tools to confirm alignment across multiple timeframes.
Dynamic Alerts:
Bullish Regime Entry: When the LTPI Score crosses above 0.1.
Bearish Regime Entry: When the LTPI Score crosses below -0.1.
Neutral Zone: When the score moves back between -0.1 and 0.1.
These alerts help identify significant macro-driven shifts in market conditions.
Conclusion
The Long-Term Probability Indicator (LTPI) is an advanced, liquidity-focused tool for identifying macro-driven market phases. By consolidating six inputs into a single probability score and presenting the results visually, LTPI helps long-term investors and analysts stay aligned with global liquidity trends and avoid being distracted by short-term volatility.
Market Energy – Trend vs Retest (with Saturation %)Market Energy – Trend vs Retest Indicator
This indicator measures the bullish and bearish energy in the market based on volume-weighted price changes.
It calculates two smoothed energy waves — bullish energy and bearish energy — using exponential moving averages of volume-adjusted price movements.
The indicator detects trend changes and retests by comparing the relative strength of these waves.
A saturation percentage quantifies the intensity of the current dominant side (bulls or bears) relative to recent highs.
- High saturation (>70%) indicates strong momentum and dominance by bulls or bears.
- Low saturation (<30%) suggests weak momentum and possible market indecision or consolidation.
The background color highlights the current control: green for bulls, red for bears, with transparency indicating the saturation level.
A label shows which side is currently in control along with the saturation percentage for quick interpretation.
Use this tool to identify strong trends, possible retests, and momentum strength to support your trading decisions.
MTPI TOTAL / BTC | JeffreyTimmermansMedium-Term Probability Indicator (MTPI)
The "Medium-Term Probability Indicator (MTPI)" is a multi-factor model designed to evaluate the medium-term state of a market. By aggregating signals from 20 underlying inputs, it generates a composite score that classifies the market as Bullish, Bearish, or Neutral. This helps traders understand the prevailing market regime and adapt strategies accordingly.
Key Features
Multi-Input Scoring: Combines up to 20 individual inputs (indicators, conditions, or models) into a single probability-based score.
Composite Market State: Translates raw input signals into three states: Bullish, Bearish, or Neutral.
Dynamic Background Coloring: Uses color-coded background shading to visually separate bullish, bearish, and neutral phases.
MTPI Score: Calculates a final numeric score (ranging from -1 to +1) to quantify the market’s directional bias.
Dashboard Display: Shows all input signals, their individual states, and the aggregated MTPI score at a glance.
Medium-Term Focus: Helps identify prevailing conditions that last from several weeks to several months.
Inputs & Settings
MTPI Settings:
Input Signals (1 to 20): Default: Predefined conditions. Each input evaluates the market from a unique perspective (trend, momentum, volatility, etc.).
Composite Score Calculation: Default weighting is equal across all inputs.
Color Settings:
Bullish: Bright green background
Neutral: Gray/orange background
Bearish: Bright red background
These colors can be customized as desired.
Calculation Process
Signal Aggregation:
Each input generates a state:
1 to 0.1 = Bullish
0.1 to -0.1 = Neutral
-0.1 to -1 = Bearish
Scoring:
The MTPI aggregates these values and calculates an average score.
Classification:
Bullish: Score > 0
Bearish: Score < 0
Neutral: Score ≈ 0
Visualization:
Background Coloring: Highlights the dominant phase on the chart.
Dashboard: Displays individual input states, the total MTPI score, and the resulting classification.
How to Use the MTPI
Identifying Market Regimes:
Bullish: Majority of inputs align positively. Favor long positions or trend-following strategies.
Bearish: Majority of inputs align negatively. Favor short positions or defensive strategies.
Neutral: Mixed signals. Caution or range-bound strategies may be preferable.
Transition Detection:
Changes in background color or the MTPI dashboard (score flipping from positive to negative, or vice versa) indicate potential regime shifts.
Dynamic Dashboard:
Score: Displays the net sum of all input signals (normalized).
State: Provides the classification (Bullish, Bearish, Neutral).
Trend: Visual cues for each input showing the current contribution to the MTPI.
Conclusion
The Medium-Term Probability Indicator (MTPI) consolidates multiple signals into a single, intuitive visualization that helps traders quickly assess the medium-term market environment. Its combination of a multi-input dashboard, composite scoring, and background coloring makes it a powerful decision-support tool.
This script is developed by Jeffrey Timmermans and is designed to complement other analysis methods.