Innocent Heikin Ashi Ethereum StrategyHello there, im back!
If you are familiar with my previous scripts, this one will seem like the future's nostalgia!
 Functionality: 
As you can see, all candles are randomly colored. This has no deeper meaning, it should remind you to switch to Heikin Ashi. The Strategy works on standard candle stick charts, but should be used with Heikin Ashi to see the actual results. (Regular OHLC calculations are included.)
Same as in my previous scripts we import our PVSRA Data from @TradersReality open source Indicator.
With this data and the help of moving averages, we have got an edge in the market.
 Signal Logic: 
When a "violently green" candle appears (high buy volume + tick speed) above the 50 EMA indicates a change in trend and sudden higher prices. Depending on OHLC of the candle itself and volume, Take Profit and Stop Loss is calculated. (The price margin is the only adjustable setting). Additionally, to make this script as simple and easily useable as possible, all other adjustable variables have been already set to the best suitable value and the chart was kept plain, except for the actual entries and exits.
 Basic Settings and Adjustables: 
 
 Main Input 1: TP and SL combined price range. (Double, Triple R:R equally.)
 Trade Inputs: All standard trade size and contract settings for testing available.
 
 Special Settings: 
 
 Checkbox 1: Calculate Signal in Heikin Ashi chart, including regular candle OHLC („Open, High, Low, Close“)
 Checkbox 2/3: Calculate by order fill or every tick.
 Checkbox 4: Possible to fill orders on bar close.
 
 Timeframe and practical usage: 
Made for the 5 Minute to 1 hour timeframe.
Literally ONLY works on Ethereum and more or less on Bitcoin.
EVERY other asset has absolute 0% profitability.
Have fun and share with your friends!
Thanks for using!
Example Chart:
 
Cari dalam skrip untuk "order"
Entropy Indicator [CHE]Entropy in Technical Analysis Using TradingView 
Slide 1:  Title 
Entropy in Technical Analysis Using TradingView
Introduction to the concept of entropy
Application in technical analysis
Understanding the use of entropy as a market indicator
Slide 2:  What is Entropy? 
Definition and Origins:
Entropy originates from thermodynamics and information theory.
In thermodynamics, entropy describes the degree of disorder or randomness in a system.
In information theory, entropy quantifies the uncertainty or unpredictability of information content.
Mathematical Definition:
Entropy measures the unpredictability of a system.
The basic idea: Higher entropy means more randomness; lower entropy indicates more predictability.
Formula: Entropy is calculated using the probabilities of different outcomes, based on how frequently certain price levels are reached.
Slide 3:  Entropy in Financial Markets 
Why Entropy Matters:
Market Uncertainty: Entropy can measure the level of uncertainty or randomness in financial markets.
Volatility Indicator: High entropy may indicate a volatile, unpredictable market, while low entropy suggests a stable, predictable market.
Applications in Trading:
Trend Analysis: Identifying periods of high entropy can help detect potential trend reversals or periods of market consolidation.
Risk Management: Using entropy to adjust trading strategies based on the perceived level of market uncertainty.
Slide 4:  How Entropy is Calculated in Trading 
Step-by-Step Process:
Data Collection:
The first step is to gather the relevant price data over a specific period, such as 200 closing prices. This data forms the basis of the entropy calculation, representing the market's recent behavior.
Defining Bins:
The price range within the collected data is divided into a fixed number of bins or intervals. These bins represent different price levels. For instance, if you choose 5 bins, the price range will be split into 5 equal segments.
Assigning Data to Bins:
The next step is to assign each price within the data to one of these bins. This step helps in understanding how frequently the price falls within specific ranges, indicating the distribution of prices over the period.
Calculating Probabilities:
After assigning the data to bins, calculate the probability for each bin by dividing the number of data points in each bin by the total number of data points. These probabilities reflect how often prices fall into each range.
Computing Entropy:
Entropy is then calculated based on the distribution of these probabilities. The formula involves summing the products of each probability and the logarithm of that probability. This calculation tells us how evenly the prices are distributed across the bins.
Interpretation for Traders:
High entropy indicates that the prices are spread evenly across the bins, suggesting a highly random and uncertain market. Low entropy, on the other hand, shows that prices are concentrated in fewer bins, indicating more predictable and stable market conditions.
Slide 5:  Implementing and Using Entropy in TradingView 
How It Works in TradingView:
Data Period: Typically, entropy is calculated over a specific number of bars (e.g., 200), representing recent market activity. The longer the period, the broader the market behavior considered.
Bin Division: The price range during this period is divided into a set number of bins. These bins help to categorize price levels and assess how spread out the market’s activity is.
Entropy Calculation: The indicator evaluates the spread of prices across these bins to determine the level of market disorder. This is visualized on the chart as an entropy line, helping traders to see fluctuations in market uncertainty.
Practical Application:
As a trader, you can use the entropy indicator to gauge when the market is in a state of high uncertainty (high entropy) or low uncertainty (low entropy). This insight can inform decisions on when to take riskier trades or when to stay conservative.
Slide 6:  Interpreting the Entropy Indicator 
High Entropy:
Characteristics:
Indicates a high level of market disorder, where price movements are more random and less predictable.
Suggests volatile or unpredictable market conditions.
Implications for Traders:
During periods of high entropy, traders might need to exercise greater caution, reduce position sizes, or employ more defensive trading strategies.
High entropy could signal potential trend reversals or significant market movements, making it a critical period to watch closely.
Low Entropy:
Characteristics:
Suggests that the market is more predictable, with prices showing less variation and more consistent trends.
Typically associated with trending markets where price movement is more orderly.
Implications for Traders:
In a low entropy environment, traders might favor trend-following strategies, as the market shows clearer directional movement.
Low entropy can also suggest more reliable trading opportunities, where the risk of sudden, unpredictable price swings is reduced.
Slide 7:  Use Cases and Strategy Integration 
Practical Use Cases:
Trend Reversals: Use entropy to identify potential points where a market may shift from trending to consolidating, or vice versa. A sudden increase in entropy might indicate the end of a stable trend and the start of a more volatile period.
Volatility Detection: Detect periods of increased market volatility by observing spikes in entropy. These periods can be critical for adjusting your trading strategy, either by scaling back or by taking advantage of the increased movement.
Strategy Integration:
Risk Management: Incorporate entropy into your risk management strategy by adjusting position sizes, leverage, or stop-loss levels based on the current entropy reading. In high entropy conditions, it might be wise to take smaller, more conservative positions.
Combining Indicators: Entropy can be effectively combined with other indicators, such as moving averages or RSI, to provide a more comprehensive view of market conditions. For example, using entropy alongside a trend indicator can help confirm whether a trend is strong and likely to continue, or if it's weakening and at risk of reversal.
Slide 8:  Advantages and Limitations of Entropy 
Advantages:
Unique Perspective: Entropy offers a unique way to measure market uncertainty that complements traditional volatility measures. It provides traders with insights into the randomness and predictability of price movements, which can be crucial for strategic decision-making.
Dynamic Analysis: Entropy adapts to changes in market conditions, offering real-time insights into the level of market disorder. This makes it a valuable tool for traders who need to stay responsive to the market's evolving dynamics.
Limitations:
Complex Interpretation: Unlike more straightforward indicators, entropy requires a deeper understanding to interpret correctly. Traders need to be familiar with how entropy levels relate to market behavior and what actions to take in response.
Sensitivity to Parameters: The results can vary significantly depending on the number of bins and the data period chosen, requiring careful parameter selection. Traders may need to experiment with different settings to find the most informative configuration for their specific market or trading style.
Slide 9:  Conclusion 
Key Takeaways:
Entropy as a Tool: Provides a unique perspective on market dynamics by measuring unpredictability. This can help traders better understand the nature of market conditions and tailor their strategies accordingly.
Practical Application: Can enhance trading strategies, particularly in volatile markets, by helping to identify periods of high uncertainty and adjusting risk management practices.
Further Exploration: Experimenting with different bin sizes and periods can help fine-tune the entropy indicator for specific markets and trading strategies. Traders are encouraged to combine entropy with other indicators to build a more robust trading framework.
Final Thoughts:
Entropy is a powerful concept that, when applied correctly, can offer valuable insights into market behavior. It should be used in conjunction with other tools and indicators to make informed trading decisions, particularly in markets where unpredictability plays a significant role.
This presentation provides a comprehensive overview of entropy, its significance in financial markets, and how it can be practically applied as an indicator in TradingView. The focus is on how traders can use entropy to enhance their trading strategies and improve their understanding of market conditions.
Best regards
Chervolino
All Harmonic Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically draws and sends alerts for all of the harmonic patterns in my public library as they occur. The patterns included are as follows:
•	Bearish 5-0
•	Bullish 5-0
•	Bearish ABCD
•	Bullish ABCD
•	Bearish Alternate Bat
•	Bullish Alternate Bat
•	Bearish Bat
•	Bullish Bat
•	Bearish Butterfly
•	Bullish Butterfly
•	Bearish Cassiopeia A
•	Bullish Cassiopeia A
•	Bearish Cassiopeia B
•	Bullish Cassiopeia B
•	Bearish Cassiopeia C
•	Bullish Cassiopeia C
•	Bearish Crab
•	Bullish Crab
•	Bearish Deep Crab
•	Bullish Deep Crab
•	Bearish Cypher
•	Bullish Cypher
•	Bearish Gartley
•	Bullish Gartley
•	Bearish Shark
•	Bullish Shark
•	Bearish Three-Drive
•	Bullish Three-Drive
█   CONCEPTS 
 Green and Red Candles  
•	A green candle is one that closes with a close price equal to or above the price it opened. 
•	A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
•	A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
•	A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices 
•	The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
•	The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Upper Trends 
•	A return line uptrend is formed when the current peak price is higher than the preceding peak price.
•	A downtrend is formed when the current peak price is lower than the preceding peak price.
•	A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
•	An uptrend is formed when the current trough price is higher than the preceding trough price.
•	A return line downtrend is formed when the current trough price is lower than the preceding trough price.
•	A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Wave Cycles 
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. The first swing high or swing low will set the course for the sequence of wave cycles that follow; for example a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Figure 1.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Fibonacci Retracement and Extension Ratios 
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers, starting with 0 and 1. For example 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, and so on. Ultimately, we could go on forever but the first few numbers in the sequence are as follows: 0 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.
The extension ratios are calculated by dividing each number in the sequence by the number preceding it. For example 0/1 = 0, 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.6666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.6153..., 34/21 = 1.6190..., 55/34 = 1.6176..., 89/55 = 1.6181..., 144/89 = 1.6179..., and so on. The retracement ratios are calculated by inverting this process and dividing each number in the sequence by the number proceeding it. For example 0/1 = 0, 1/1 = 1, 1/2 = 0.5, 2/3 = 0.666..., 3/5 = 0.6, 5/8 = 0.625, 8/13 = 0.6153..., 13/21 = 0.6190..., 21/34 = 0.6176..., 34/55 = 0.6181..., 55/89 = 0.6179..., 89/144 = 0.6180..., and so on.
Fibonacci ranges are typically drawn from left to right, with retracement levels representing ratios inside of the current range and extension levels representing ratios extended outside of the current range. If the current wave cycle ends on a swing low, the Fibonacci range is drawn from peak to trough. If the current wave cycle ends on a swing high the Fibonacci range is drawn from trough to peak.
 Measurement Tolerances  
Tolerance refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. I have applied this concept in my pattern detection logic and have set default tolerances where applicable, as perfect patterns are, needless to say,  very rare.
 Chart Patterns 
Generally speaking price charts are nothing more than a series of swing highs and swing lows. When demand outweighs supply over a period of time prices swing higher and when supply outweighs demand over a period of time prices swing lower. These swing highs and swing lows can form patterns that offer insight into the prevailing supply and demand dynamics at play at the relevant moment in time. 
‘Let us assume… that you the reader, are not a member of that mysterious inner circle known to the boardrooms as  “the insiders”… But it is fairly certain that there are not nearly so many “insiders” as amateur trader supposes and… It is even more certain that insiders can be wrong… Any success they have, however, can be accomplished only by buying and selling…    hey can do neither without altering the delicate poise of supply and demand that governs prices. Whatever they do is sooner or later reflected on the charts where you… can detect it. Or detect, at least, the way in which the supply-demand equation is being affected… So, you do not need to be an insider to ride with them frequently… prices move in trends. Some of those trends are straight, some are curved; some are brief and some are long and continued… produced in a series of action and reaction waves of great uniformity. Sooner or later, these trends change direction; they may reverse (as from up to down), or they may be interrupted by some sort of sideways movement and then, after a time, proceed again in their former direction… when a price trend is in the process of reversal… a characteristic area or pattern takes shape on the chart, which becomes recognisable as a reversal formation… Needless to say, the first and most important task of the technical chart analyst is to learn to know the important reversal formations and to judge what they may signify in terms of trading opportunities’ (Edwards & Magee, 1948).
This is as true today as it was when Edwards and Magee were writing in the first half of the last Century, study your patterns and make judgements for yourself about what their implications truly are on the markets and timeframes you are interested in trading. 
Over the years, traders have come to discover a multitude of chart and candlestick patterns that are supposed to pertain information on future price movements. However, it is never so clear cut in practice and patterns that where once considered to be reversal patterns are now considered to be continuation patterns and vice versa. Bullish patterns can have bearish implications and bearish patterns can have bullish implications. As such, I would highly encourage you to do your own backtesting.
There is no denying that chart patterns exist, but their implications will vary from market to market and timeframe to timeframe. So it is down to you as an individual to study them and make decisions about how they may be used in a strategic sense. 
 Harmonic Patterns 
The concept of harmonic patterns in trading was first introduced by H.M. Gartley in his book "Profits in the Stock Market", published in 1935. Gartley observed that markets have a tendency to move in repetitive patterns, and he identified several specific patterns that he believed could be used to predict future price movements. The bullish and bearish Gartley patterns are the oldest recognized harmonic patterns in trading and all the other harmonic patterns are modifications of the original Gartley patterns. Gartley patterns are fundamentally composed of 5 points, or 4 waves.
Since then, many other traders and analysts have built upon Gartley's work and developed their own variations of harmonic patterns. One such contributor is Larry Pesavento, who developed his own methods for measuring harmonic patterns using Fibonacci ratios. Pesavento has written several books on the subject of harmonic patterns and Fibonacci ratios in trading. Another notable contributor to harmonic patterns is Scott Carney, who developed his own approach to harmonic trading in the late 1990s and also popularised the use of Fibonacci ratios to measure harmonic patterns. Carney expanded on Gartley's work and also introduced several new harmonic patterns, such as the Shark pattern and the 5-0 pattern. 
█   INPUTS 
•	Change pattern and label colours
•	Show or hide patterns individually
•	Adjust pattern tolerances
•	Set or remove alerts for individual patterns
█   NOTES 
You can test the patterns with your own strategies manually by applying the indicator to your chart while in bar replay mode and playing through the history. You could also automate this process with PineScript by using the conditions from my swing and pattern libraries as entry conditions in the strategy tester or your own custom made strategy screener. 
 
█   LIMITATIONS  
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   SOURCES 
Edwards, R., & Magee, J. (1948) Technical Analysis of Stock Trends (10th edn). Reprint, Boca Raton, Florida: Taylor and Francis Group,  CRC Press: 2013.
All Chart Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically draws and sends alerts for all of the chart patterns in my public library as they occur. The patterns included are as follows:
•	Ascending Broadening
•	Broadening
•	Descending Broadening
•	Double Bottom
•	Double Top
•	Triple Bottom
•	Triple Top
•	Bearish Elliot Wave
•	Bullish Elliot Wave
•	Bearish Alternate Flag
•	Bullish Alternate Flag
•	Bearish Flag
•	Bullish Flag
•	Bearish Ascending Head and Shoulders
•	Bullish Ascending Head and Shoulders
•	Bearish Descending Head and Shoulders
•	Bullish Descending Head and Shoulders
•	Bearish Head and Shoulders
•	Bullish Head and Shoulders
•	Bearish Pennant
•	Bullish Pennant
•	Ascending Wedge
•	Descending Wedge
•	Wedge
█   CONCEPTS 
 Green and Red Candles  
•	A green candle is one that closes with a close price equal to or above the price it opened. 
•	A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
•	A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
•	A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices 
•	The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
•	The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Upper Trends 
•	A return line uptrend is formed when the current peak price is higher than the preceding peak price.
•	A downtrend is formed when the current peak price is lower than the preceding peak price.
•	A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
•	An uptrend is formed when the current trough price is higher than the preceding trough price.
•	A return line downtrend is formed when the current trough price is lower than the preceding trough price.
•	A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Measurement Tolerances  
Tolerance refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. I have applied this concept in my pattern detection logic and have set default tolerances where applicable, as perfect patterns are, needless to say,  very rare.
 Chart Patterns 
Generally speaking price charts are nothing more than a series of swing highs and swing lows. When demand outweighs supply over a period of time prices swing higher and when supply outweighs demand over a period of time prices swing lower. These swing highs and swing lows can form patterns that offer insight into the prevailing supply and demand dynamics at play at the relevant moment in time. 
‘Let us assume… that you the reader, are not a member of that mysterious inner circle known to the boardrooms as  “the insiders”… But it is fairly certain that there are not nearly so many “insiders” as amateur trader supposes and… It is even more certain that insiders can be wrong… Any success they have, however, can be accomplished only by buying and selling…    hey can do neither without altering the delicate poise of supply and demand that governs prices. Whatever they do is sooner or later reflected on the charts where you… can detect it. Or detect, at least, the way in which the supply-demand equation is being affected… So, you do not need to be an insider to ride with them frequently… prices move in trends. Some of those trends are straight, some are curved; some are brief and some are long and continued… produced in a series of action and reaction waves of great uniformity. Sooner or later, these trends change direction; they may reverse (as from up to down), or they may be interrupted by some sort of sideways movement and then, after a time, proceed again in their former direction… when a price trend is in the process of reversal… a characteristic area or pattern takes shape on the chart, which becomes recognisable as a reversal formation… Needless to say, the first and most important task of the technical chart analyst is to learn to know the important reversal formations and to judge what they may signify in terms of trading opportunities’ (Edwards & Magee, 1948).
This is as true today as it was when Edwards and Magee were writing in the first half of the last Century, study your patterns and make judgements for yourself about what their implications truly are on the markets and timeframes you are interested in trading. 
Over the years, traders have come to discover a multitude of chart and candlestick patterns that are supposed to pertain information on future price movements. However, it is never so clear cut in practice and patterns that where once considered to be reversal patterns are now considered to be continuation patterns and vice versa. Bullish patterns can have bearish implications and bearish patterns can have bullish implications. As such, I would highly encourage you to do your own backtesting.
There is no denying that chart patterns exist, but their implications will vary from market to market and timeframe to timeframe. So it is down to you as an individual to study them and make decisions about how they may be used in a strategic sense. 
█   INPUTS 
•	Change pattern and label colours
•	Show or hide patterns individually
•	Adjust pattern ratios and tolerances
•	Set or remove alerts for individual patterns
█   NOTES 
I have decided to rename some of my previously published patterns based on the way in which the pattern completes. If the pattern completes on a swing high then the pattern is considered bearish, if the pattern completes on a swing low then it is considered bullish. This may seem confusing but it makes sense when you come to backtesting the patterns and want to use the most recent peak or trough prices as stop losses. Patterns that can complete on both a swing high and swing low are for such reasons treated as neutral, namely all broadening and wedge variations. I trust that it is quite self-evident that double and triple bottom patterns are considered bullish while double and triple top patterns are considered bearish, so I did not feel the need to rename those.
The patterns that have been renamed and what they have been renamed to, are as follows:
•	Ascending Elliot Waves to Bearish Elliot Waves
•	Descending Elliot Waves to Bullish Elliot Waves
•	Ascending Head and Shoulders to Bearish Ascending Head and Shoulders
•	Descending Head and Shoulders to Bearish Descending Head and Shoulders
•	Head and Shoulders to Bearish Head and Shoulders
•	Ascending Inverse Head and Shoulders to Bullish Ascending Head and Shoulders
•	Descending Inverse Head and Shoulders to Bullish Descending Head and Shoulders
•	Inverse Head and Shoulders to Bullish Head and Shoulders
You can test the patterns with your own strategies manually by applying the indicator to your chart while in bar replay mode and playing through the history. You could also automate this process with PineScript by using the conditions from my swing and pattern libraries as entry conditions in the strategy tester or your own custom made strategy screener. 
 
█   LIMITATIONS  
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   SOURCES 
Edwards, R., & Magee, J. (1948) Technical Analysis of Stock Trends (10th edn). Reprint, Boca Raton, Florida: Taylor and Francis Group,  CRC Press: 2013.
Strategy SEMA SDI WebhookPurpose of the Code:
The strategy utilizes Exponential Moving Averages (EMA) and Smoothed Directional Indicators (SDI) to generate buy and sell signals. It includes features like leverage, take profit, stop loss, and trailing stops. The strategy is intended for backtesting and automating trades based on the specified indicators and conditions.
Key Components and Functionalities:
1.Strategy Settings:
	Overlay: The strategy will overlay on the price chart.
	Slippage: Set to 1.
	Commission Value: Set to 0.035.
	Default Quantity Type: Percent of equity.
	Default Quantity Value: 50% of equity.
	Initial Capital: Set to 1000 units.
	Calculation on Order Fills: Enabled.
	Process Orders on Close: Enabled.
2.Date and Time Filters:
	Inputs for enabling/disabling start and end dates.
	Filters to execute strategy only within specified date range.
	
3.Leverage and Quantity:
	Leverage: Adjustable leverage input (default 3).
	USD Percentage: Adjustable percentage of equity to use for trades (default 50%).
	Initial Capital: Calculated based on leverage and percentage of equity.
4.Take Profit, Stop Loss, and Trailing Stop:
	Inputs for enabling/disabling take profit, stop loss, and trailing stop.
	Adjustable parameters for take profit percentage (default 25%), stop loss percentage (default 4.8%), and trailing stop percentage (default 1.9%).
	Calculations for take profit, stop loss, trailing price, and maximum profit tracking.
5.EMA Calculations:
	Fast and slow EMAs.
	Smoothed versions of the fast and slow EMAs.
6.SDI Calculations:
	Directional movement calculation for positive and negative directional indicators.
	Difference between the positive and negative directional indicators, smoothed.
7.Buy/Sell Conditions:
	Long (Buy) Condition: Positive DI is greater than negative DI, and fast EMA is greater than slow EMA.
	Short (Sell) Condition: Negative DI is greater than positive DI, and fast EMA is less than slow EMA.
8.Strategy Execution:
	If buy conditions are met, close any short positions and enter a long position.
	If sell conditions are met, close any long positions and enter a short position.
	Exit conditions for long and short positions based on take profit, stop loss, and trailing stop levels.
	Close all positions if outside the specified date range.
Usage:
This strategy is used to automate trading based on the specified conditions involving EMAs and SDI. It allows backtesting to evaluate performance based on historical data. The strategy includes risk management through take profit, stop loss, and trailing stops to protect gains and limit losses. Traders can customize the parameters to fit their specific trading preferences and risk tolerance. Differently, it can perform leverage analysis and use it as a template.
By using this strategy, traders can systematically execute trades based on technical indicators, helping to remove emotional bias and improve consistency in trading decisions.
Important Note:
This script is provided for educational and template purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
ICT KillZones + Pivot Points [TradingFinder] Support/Resistance 🟣 Introduction 
Pivot Points are critical levels on a price chart where trading activity is notably high. These points are derived from the prior day's price data and serve as key reference markers for traders' decision-making processes.
 Types of Pivot Points :
 
 Floor
 Woodie
 Camarilla
 Fibonacci
 
🔵 Floor Pivot Points 
Widely utilized in technical analysis, floor pivot points are essential in identifying support and resistance levels. The central pivot point (PP) acts as the primary level, suggesting the trend's likely direction. 
The additional resistance levels (R1, R2, R3) and support levels (S1, S2, S3) offer further insight into potential trend reversals or continuations.
  
🔵 Camarilla Pivot Points 
Featuring eight distinct levels, Camarilla pivot points closely correspond with support and resistance, making them highly effective for setting stop-loss orders and profit targets.
  
🔵 Woodie Pivot Points 
Similar to floor pivot points, Woodie pivot points differ by placing greater emphasis on the closing price, often resulting in different pivot levels compared to the floor method.
  
🔵 Fibonacci Pivot Points 
Fibonacci pivot points combine the standard floor pivot points with Fibonacci retracement levels applied to the previous trading period's range. Common retracement levels used are 38.2%, 61.8%, and 100%.
  
🟣 Sessions 
Financial markets are divided into specific time segments, known as sessions, each with unique characteristics and activity levels. These sessions are active at different times throughout the day.
 The primary sessions in financial markets include :
 
 Asian Session
 European Session
 New York Session
 
 The timing of these major sessions in UTC is as follows :
 
 Asian Session: 23:00 to 06:00
 European Session: 07:00 to 14:25
 New York Session: 14:30 to 22:55
 
🟣 Kill Zones 
Kill zones are periods within a session marked by heightened trading activity. During these times, trading volume surges and price movements become more pronounced.
 The timing of the major kill zones in UTC is :
 
 Asian Kill Zone: 23:00 to 03:55
 European Kill Zone: 07:00 to 09:55
 New York Kill Zone: 14:30 to 16:55
 
  
 Combining kill zones and pivot points in financial market analysis provides several advantages :
 
 Enhanced Market Sentiment Analysis : Aligns key price levels with high-activity periods for a clearer market sentiment.
 Improved Timing for Trade Entries and Exits : Helps better time trades based on when price movements are most likely.
 Higher Probability of Successful Trades : Increases the accuracy of predicting market movements and placing profitable trades.
 Strategic Stop-Loss and Profit Target Placement : Allows for precise risk management by strategically setting stop-loss and profit targets.
 Versatility Across Different Time Frames : Effective in both short and long time frames, suitable for various trading strategies.
 Enhanced Trend Identification and Confirmation : Confirms trends using both pivot levels and high-activity periods, ensuring stronger trend validation.
 In essence, this integrated approach enhances decision-making, optimizes trading performance, and improves risk management.
 
🟣 How to Use  
🔵 Two Approaches to Trading Pivot Points 
There are two main strategies for trading pivot points: utilizing "pivot point breakouts" and "price reversals."
🔵 Pivot Point Breakout 
When the price breaks through pivot lines, it signals a shift in market sentiment to the trader. In the case of an upward breakout, where the price crosses these pivot lines, a trader might enter a long position, placing their stop-loss just below the pivot point (P).
Conversely, if the price breaks downward, a short position can be initiated below the pivot point. When using the pivot point breakout strategy, the first and second support levels can serve as profit targets in an upward trend. In a downward trend, these roles are filled by the first and second resistance levels.
🔵 Price Reversal 
An alternative method involves waiting for the price to reverse at the support and resistance levels. To implement this strategy, traders should take positions opposite to the prevailing trend as the price rebounds from the pivot point.
While this tool is commonly used in higher time frames, it tends to produce better results in shorter time frames, such as 1-hour, 30-minute, and 15-minute intervals.
Three Strategies for Trading the Kill Zone
 There are three principal strategies for trading within the kill zone :
 
 Kill Zone Hunt
 Breakout and Pullback to Kill Zone
 Trading in the Trend of the Kill Zone
 
🔵 Kill Zone Hunt 
This strategy involves waiting until the kill zone concludes and its high and low lines are established. If the price reaches one of these lines within the same session and is strongly rejected, a trade can be executed.
🔵 Breakout and Pullback to Kill Zone 
In this approach, once the kill zone ends and its high and low lines stabilize, a trade can be made if the price breaks one of these lines decisively within the same session and then pulls back to that level.
🔵 Trading in the Trend of the Kill Zone 
Kill zones are characterized by high trading volumes and strong trends. Therefore, trades can be placed in the direction of the prevailing trend. For instance, if an upward trend dominates this area, a buy trade can be entered when the price reaches a demand order block.
Uptrick: Trend Confirmation IndicatorIf you buy this indicator/strategy the code will be provided so in order to access it you will need to go to Tradingview and at the bottom click 'Pine Editor'. Then click 'Open' and then click on 'New strategy'. Here you can then paste the code and save it. Make sure to first delete all the code that there is before pasting it inside.
Description:
The "Uptrick: Trend Confirmation Indicator" stands as an exceptional tool for traders seeking reliable confirmation of market trends. This indicator integrates multiple technical analysis components to provide clear signals for trend direction, aiding traders in making well-informed trading decisions with confidence.
EMA and MACD Analysis:
The indicator leverages the Exponential Moving Average (EMA) to capture the long-term trend direction of the market. The EMA is calculated over a customizable period, allowing traders to adapt the indicator to various timeframes and market conditions.
Additionally, the Moving Average Convergence Divergence (MACD) is employed to further confirm trend direction. By analyzing the difference between two moving averages and their smoothing, the MACD component helps identify potential shifts in market momentum.
Trend Confirmation Mechanism:
The indicator confirms a trend when the closing price is above the EMA, and the MACD line shows a positive change, indicating upward momentum. This combined signal enhances the reliability of trend confirmation, reducing false signals and noise in the market.
To filter out short-term fluctuations, the indicator requires trend confirmation over multiple bars, ensuring a more robust assessment of market direction.
Background Color and Visualization:
The background color dynamically adjusts based on the direction of the EMA, providing visual cues for trend directionality. A green background signifies an upward trend, while a red background indicates a downward trend.
This visual representation enhances the clarity of trend identification, allowing traders to quickly assess market conditions at a glance.
Signal Generation and Execution:
The indicator generates long signals when the EMA crosses above its previous value, indicating a potential bullish reversal. Conversely, short signals are generated when the EMA crosses below its previous value, signaling a potential bearish reversal.
These signals are executed through automated buy and sell orders, streamlining the trading process and minimizing human error.
Utility and Potential Usage:
The "Uptrick: Trend Confirmation Indicator" is an indispensable tool for traders across various experience levels, offering clear and reliable signals for trend confirmation.
Short-term traders can benefit from its ability to filter out noise and provide accurate trend signals, enhancing their intraday trading strategies.
Long-term investors can leverage its robust trend confirmation mechanism to identify favorable entry and exit points, optimizing their portfolio management and risk mitigation strategies.
In conclusion, the "Uptrick: Trend Confirmation Indicator" stands out as an excellent trading tool, empowering traders with the confidence to navigate the markets effectively and capitalize on profitable opportunities with precision and clarity.
TASC 2024.06 REIT ETF Trading System█ OVERVIEW
This strategy script demonstrates the application of the Real Estate Investment Trust (REIT) ETF trading system presented in the article by Markos Katsanos titled "Is The Price REIT?" from  TASC's June 2024 edition of Traders' Tips . 
█ CONCEPTS
 REIT  stocks and ETFs offer a simplified, diversified approach to real estate investment. They exhibit sensitivity to interest rates, often moving inversely to  interest rate and treasury yield  changes. Markos Katsanos explores this relationship and the correlation of prices with the broader market to develop a trading strategy for REIT ETFs.
The script employs  Bollinger Bands  and  Donchian channel  indicators to identify oversold conditions and trends in REIT ETFs. It incorporates the 10-year treasury yield index (TNX) as a proxy for interest rates and the S&P 500 ETF (SPY) as a benchmark for the overall market. The system filters trade entries based on their behavior and correlation with the REIT ETF price. 
█ CALCULATIONS
The strategy initiates  long entries (buy signals)  under two conditions: 
1.  Oversold condition 
 
 The weekly ETF low price dips below the 15-week Bollinger Band bottom, the closing price is above the value by at least 0.2 * ATR ( Average True Range ), and the price exceeds the week's median.
 Either of the following:
–  The TNX index is down over 15% from its 25-week high, and its correlation with the ETF price is less than 0.3.
–  The yield is below 2%.
 
2.  Uptrend 
 
 The weekly ETF price crosses above the previous week's 30-week Donchian channel high.
 The SPY ETF is above its 20-week moving average.
 Either of the following:
– Over ten weeks have passed since the TNX index was at its 30-week high.
– The correlation between the TNX value and the ETF price exceeds 0.3.
– The yield is below 2%.
 
The strategy also includes three  exit (sell)  rules:
1.  Trailing (Chandelier) stop 
 
 The weekly close drops below the highest close over the last five weeks by over 1.5 * ATR.
 The TNX value rises over the latest 25 weeks, with a yield exceeding 4%, or its value surges over 15% above the 25-week low. 
 
2.  Stop-loss 
 
 The ETF's price declines by at least 8% of the previous week's close and falls below the 30-week moving average. 
 The SPY price is down by at least 8%, or its correlation with the ETF's price is negative. 
 
3.  Overbought condition 
 
 The ETF's value rises above the 100-week low by over 50%. 
 The ETF's price falls over 1.5 * ATR below the 3-week high.
 The ETF's 10-week Stochastic indicator exceeds 90 within the last three weeks. 
 
█ DISCLAIMER
This strategy script educates users on the system outlined by the TASC article. However, note that its default properties might not fully represent real-world trading conditions for an individual. By default, it uses 10% of equity as the order size and a slippage amount of 5 ticks. Traders should adjust these settings and the commission amount when using this script. Additionally, since this strategy utilizes compound conditions on weekly data to trigger orders, it will generate significantly fewer trades than other, higher-frequency strategies. 
utilsLibrary   "utils" 
Provides a set of utility functions for use in strategies or indicators.
 colorGreen(opacity) 
  Parameters:
     opacity (int) 
 colorRed(opacity) 
  Parameters:
     opacity (int) 
 colorTeal(opacity) 
  Parameters:
     opacity (int) 
 colorBlue(opacity) 
  Parameters:
     opacity (int) 
 colorOrange(opacity) 
  Parameters:
     opacity (int) 
 colorPurple(opacity) 
  Parameters:
     opacity (int) 
 colorPink(opacity) 
  Parameters:
     opacity (int) 
 colorYellow(opacity) 
  Parameters:
     opacity (int) 
 colorWhite(opacity) 
  Parameters:
     opacity (int) 
 colorBlack(opacity) 
  Parameters:
     opacity (int) 
 trendChangingUp(emaShort, emaLong) 
  Signals when the trend is starting to change in a positive direction.
  Parameters:
     emaShort (float) 
     emaLong (float) 
  Returns: bool
 trendChangingDown(emaShort, emaLong) 
  Signals when the trend is starting to change in a negative direction.
  Parameters:
     emaShort (float) 
     emaLong (float) 
  Returns: bool
 percentChange(start, end) 
  Returns the percent change between a start number and end number. A positive change returns a positive value and vice versa.
  Parameters:
     start (float) 
     end (float) 
  Returns: float
 percentOf(percent, n) 
  Returns the number that's the percentage of the provided value.
  Parameters:
     percent (float) : Use 0.2 for 20 percent, 0.35 for 35 percent, etc.
     n (float) : The number to calculate the percentage of.
  Returns: float
 targetPriceByPercent(percent, n) 
  Parameters:
     percent (float) 
     n (float) 
 hasNegativeSlope(start, end) 
  Parameters:
     start (float) 
     end (float) 
 timeinrange(resolution, session, timezone) 
  Returns true when the current time is within a given session window. Note, the time is calculated in the "America/New_York" timezone.
  Parameters:
     resolution (simple string) : The time interval to use to start/end the background color. Use "1" for the coloring the background up to the minute.
     session (simple string) : The session string to use to identify the time window. Example: "0930-1600:23456" means normal market hours on weekdays.
     timezone (simple string) 
  Returns: series bool
 barsSinceLastEntry() 
  Returns the number of bars since the last entry order.
  Returns: series int
 barsSinceLastExit() 
  Returns the number of bars since the last exit order.
  Returns: series int
 calcSlope(ln, lookback) 
  Calculates the slope of the provided line based on its x,y coordinates in the previous bar to the current bar.
  Parameters:
     ln (float) 
     lookback (int) 
  Returns: series float
 openPL() 
  Returns slope of the line given the start and end x,y coordinates.
  Returns: series float
 hasConsecutiveNegativeCandles(lookbackInput) 
  Returns true if the number of consecutive red candles matches the provided count.
  Parameters:
     lookbackInput (int) : The amount of bars to look back to check for consecutive negative bars. Default = 1.
  Returns: series bool
 stdevPercent(stdev, price) 
  Returns the standard deviation as a percentage of price.
  Parameters:
     stdev (float) : The standard deviation value
     price (float) : The current price of the target ticker.
  Returns: series float
Reversal Pivot PointsThis indicator aims to identify price levels where price action has quickly reversed from. These "pivots" establish major levels where major liquidity is located. Unlike standard support and resistance levels, when price breaks below or above a pivot, these pivots disappear from the chart. Comes with various customization features built to fit all.
 Features 
 
  Pivot Timeframe: Identify and plot pivots from one specific timeframe and see it from all lower timeframes
  Pivot left/right bar limit: A feature aimed at preventing false pivots identification
  Remove On Close (ROC): Feature to only remove pivots once price close under it
  ROC Timeframe: The timeframe the script uses to determine if the candle closed under the level
  Wait For Close: Will only remove the pivot after the current candle closes
   Line Extension Type: The extension of the line. None - extends line to current time, left - only extends line to the left, right - only extends line to the right, both - extends line both directions
  Line Offset: How much to offset (in bars) the line and label from the current candle
  Line Type: The style of line when plotted. Solid (─), dotted (┈), dashed (╌), arrow left (←), arrow right (→), arrows both (↔)
  Display Level: Whether to or not to display the price of the pivot
  Display Perfect Level: Whether to or not to display levels where price perfectly rejected off of
  Alerts: Creates an alert when a level has been crossed
 
 How to trade 
1. Pivots can be traded to or from. The stock market (market makers) will tend to "chase" liquidity in order to fill orders at better averages. This allows us retail traders to to participate alongside these moves to these pivots. Once price action hits a pivot, it can do two things: break the pivot and continue or bounce off it. We can participate alongside these bounces after confirmation of a reversal (doji, volume, etc). These bounce plays are high risk as it's generally 50-50, but the risk to reward is typically also very high, making them very valuable to take.
2. Typically, the market is a fluid environment and should be "natural," so perfect things (manmade and filled with liquidity) should not occur. With this knowledge, we can expect these perfect levels, "PDT/PDB," to break as they are not natural occurrence and have heavy liquidity on and above/below them. We can trade to these levels and expect them to break/sweep if price action comes near them again. 
BBSR Extreme Strategy [nachodog]The Bollinger Bands Stochastic RSI Extreme Strategy is a comprehensive trading approach designed for use on the TradingView platform, employing a combination of Bollinger Bands and the Stochastic RSI to identify potential entry and exit points in the market. This strategy is converted into Pine Script version 5 and is specifically tailored as a strategy rather than a mere study, allowing traders to simulate and backtest their trades within the TradingView environment.
 Strategy Overview:
 Bollinger Bands serve as the primary tool for volatility and price level analysis. By calculating the standard deviation of price movements around a simple moving average (SMA), this strategy identifies the upper and lower bounds of price fluctuations, helping traders spot potential reversal points.
Stochastic RSI is used to gauge the momentum by comparing the closing price's position relative to its price range over a certain period. This indicator helps in determining overbought or oversold conditions, providing insights into potential bullish or bearish momentum.
 Entry Signals:
 Bullish Entry: The strategy signals a long entry when the price moves from below to above the lower Bollinger Band, coupled with a Stochastic RSI indicating an exit from oversold conditions. This suggests an uptrend initiation, prompting a buy order.
Bearish Entry: Conversely, a short entry is signaled when the price drops from above to below the upper Bollinger Band while the Stochastic RSI moves from overbought territory. This condition indicates a potential downtrend, triggering a sell order.
 Exit Criteria:
 Stop Loss: A key feature of this strategy is the inclusion of a user-defined stop loss percentage, which helps manage risk by specifying the maximum allowable loss per trade.
Bearish Exit for Long Positions: Long positions are exited either when a bearish signal is detected or when the price crosses below the lower Bollinger Band, suggesting a reversal or weakening of the bullish trend.
Bullish Exit for Short Positions: Short positions are closed upon a bullish signal or when the price crosses above the upper Bollinger Band, indicating a potential reversal or diminishing bearish momentum.
 Strategy Benefits:
 The strategy provides a structured framework for entering and exiting trades, leveraging the strengths of both Bollinger Bands and Stochastic RSI.
It includes parameters for customization, such as the stop loss percentage, allowing traders to align the strategy with their risk tolerance and trading objectives.
The ability to backtest and simulate trades on TradingView enhances its utility, offering insights into the strategy's performance under historical market conditions.
Overall, the Bollinger Bands Stochastic RSI Extreme Strategy is designed for traders who seek to capitalize on trend reversals and momentum shifts, with built-in risk management features to safeguard against significant losses.
Footprint strategyThis strategy uses imbalance volume data obtained by footprint calculation technology.
There are two signals to enter a trade:
 
 trend - the current buy volume on the bar is greater than the current sell volume and there is at least one imbalance line.
 reversal - the current bar is falling, but the general market trend is positive (growing) and the imbalance buy volume exceeds the imbalance sell volume.
 
When any of the conditions is triggered, two orders are placed: Take Profit and Stop loss (according to the percentage value from the inputs).
A little advice on use:
 
 The strategy performs best on a 15 minute timeframe.
 It is necessary to choose acceptable values of Take Profit and Stop loss depending on the order of symbol prices.
 
Inputs related to the strategy:
 
 Stop loss - percentage size of stop loss to exit the trade.
 Enable stop loss - stop loss activation.
 Take Profit - percentage size of Take Profit.
 Calculation timeframe - this is the timeframe from which the volume will be collected for distribution to buy and sell (if you do not have access to the seconds chart, set here 1 minute, the accuracy will be less, but it will work).
 Trend timeframe - this is the timeframe from which the trend will be calculated.
 Enable trend - activation of trend calculation.
 
Inputs related to the calculation of footprints (collection of the volume of purchases and sales):
 
 Count show bars - Number of bars from rt bar to history to calculate.
 Display all available bars - Strategy calculation on all available bars (based on the available amount of data with reduced resolution (set in Calculation timeframe)).
 Ticks Per Row - Sets the price step, calculated by multiplying the entered value by syminfo.mintick.
 Auto - The automatic "Ticks Per Row" calculation is based on the first available bar and applied to subsequent bars.
 Max row - sets the acceptable number of rows within a bar.
 Imbalance Percent - A percentage coefficient to determine the Imbalance of price levels.
 Stacked levels - And minimum number of consecutive Imbalance levels required to draw extended lines.
 
If you have suggestions for improving the strategy and adding new conditions for entering and exiting the trade, please write).
Bearish Cassiopeia C Harmonic Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically detects and draws bearish Cassiopeia C harmonic patterns and price projections derived from the ranges that constitute the patterns. 
Cassiopeia A, B and C harmonic patterns are patterns that I created/discovered myself. They are all inspired by the Cassiopeia constellation and each one is based on different rotations of the constellation as it moves through the sky. The range ratios are also based on the constellation's right ascension and declination listed on Wikipedia:
Right ascension 22h 57m 04.5897s–03h 41m 14.0997s
Declination 77.6923447°–48.6632690°
en.wikipedia.org
I actually developed this idea quite a while ago now but have not felt audacious enough to introduce a new harmonic pattern, let alone 3 at the same time! But I have since been able to run backtests on tick data going back to 2002 across a variety of market and  timeframe combinations and have learned that the Cassiopeia patterns can certainly hold their own against the currently known harmonic patterns. 
I would also point out that the Cassiopeia constellation does actually look like a harmonic pattern and the Cassiopeia A star is literally the  'strongest source of radio emission in the sky beyond the solar system', so its arguably more of a real harmonic phenomenon than the current patterns. 
www.britannica.com
chandra.si.edu
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a close price equal to or above the price it opened.
• A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Upper Trends 
• A return line uptrend is formed when the current peak price is higher than the preceding peak price.
• A downtrend is formed when the current peak price is lower than the preceding peak price.
• A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
• An uptrend is formed when the current trough price is higher than the preceding trough price.
• A return line downtrend is formed when the current trough price is lower than the preceding trough price.
• A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Muti-Part Upper and Lower Trends 
• A multi-part return line uptrend begins with the formation of a new return line uptrend and continues until a new downtrend ends the trend.
• A multi-part downtrend begins with the formation of a new downtrend and continues until a new return line uptrend ends the trend.
• A multi-part uptrend begins with the formation of a new uptrend and continues until a new return line downtrend ends the trend.
• A multi-part return line downtrend begins with the formation of a new return line downtrend and continues until a new uptrend ends the trend.
 Double Trends 
• A double uptrend is formed when the current trough price is higher than the preceding trough price and the current peak price is higher than the preceding peak price.
• A double downtrend is formed when the current peak price is lower than the preceding peak price and the current trough price is lower than the preceding trough price.
 Muti-Part Double Trends 
• A multi-part double uptrend begins with the formation of a new uptrend that proceeds a new return line uptrend, and continues until a new downtrend or return line downtrend ends the trend.
• A multi-part double downtrend begins with the formation of a new downtrend that proceeds a new return line downtrend, and continues until a new uptrend or return line uptrend ends the trend. 
 Wave Cycles 
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. The first swing high or swing low will set the course for the sequence of wave cycles that follow; for example a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Figure 1.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Fibonacci Retracement and Extension Ratios 
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers, starting with 0 and 1. For example 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, and so on. Ultimately, we could go on forever but the first few numbers in the sequence are as follows: 0 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.
The extension ratios are calculated by dividing each number in the sequence by the number preceding it. For example 0/1 = 0, 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.6666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.6153..., 34/21 = 1.6190..., 55/34 = 1.6176..., 89/55 = 1.6181..., 144/89 = 1.6179..., and so on. The retracement ratios are calculated by inverting this process and dividing each number in the sequence by the number proceeding it. For example 0/1 = 0, 1/1 = 1, 1/2 = 0.5, 2/3 = 0.666..., 3/5 = 0.6, 5/8 = 0.625, 8/13 = 0.6153..., 13/21 = 0.6190..., 21/34 = 0.6176..., 34/55 = 0.6181..., 55/89 = 0.6179..., 89/144 = 0.6180..., and so on.
1.618 is considered to be the 'golden ratio', found in many natural phenomena such as the growth of seashells and the branching of trees. Some now speculate the universe oscillates at a frequency of 0,618 Hz, which could help to explain such phenomena, but this theory has yet to be proven.
Traders and analysts use Fibonacci retracement and extension indicators, consisting of horizontal lines representing different Fibonacci ratios, for identifying potential levels of support and resistance. Fibonacci ranges are typically drawn from left to right, with retracement levels representing ratios inside of the current range and extension levels representing ratios extended outside of the current range. If the current wave cycle ends on a swing low, the Fibonacci range is drawn from peak to trough. If the current wave cycle ends on a swing high the Fibonacci range is drawn from trough to peak.
 Harmonic Patterns 
The concept of harmonic patterns in trading was first introduced by H.M. Gartley in his book "Profits in the Stock Market", published in 1935. Gartley observed that markets have a tendency to move in repetitive patterns, and he identified several specific patterns that he believed could be used to predict future price movements.
Since then, many other traders and analysts have built upon Gartley's work and developed their own variations of harmonic patterns. One such contributor is Larry Pesavento, who developed his own methods for measuring harmonic patterns using Fibonacci ratios. Pesavento has written several books on the subject of harmonic patterns and Fibonacci ratios in trading. Another notable contributor to harmonic patterns is Scott Carney, who developed his own approach to harmonic trading in the late 1990s and also popularised the use of Fibonacci ratios to measure harmonic patterns. Carney expanded on Gartley's work and also introduced several new harmonic patterns, such as the Shark pattern and the 5-0 pattern.
The bullish and bearish Gartley patterns are the oldest recognized harmonic patterns in trading and all the other harmonic patterns are ultimately modifications of the original Gartley patterns. Gartley patterns are fundamentally composed of 5 points, or 4 waves.
 Bullish and Bearish Cassiopeia C Harmonic Patterns 
• Bullish Cassiopeia C patterns are fundamentally composed of three troughs and two peaks. The second peak being higher than the first peak. And the third trough being lower than both the first and second troughs, while the second trough is higher than the first.
• Bearish Cassiopeia C patterns are fundamentally composed of three peaks and two troughs. The second trough being lower than the first trough. And the third peak being higher than both the first and second peaks, while the second peak is lower than the first.
The ratio measurements I use to detect the patterns are as follows:
• Wave 1 of the pattern, generally referred to as XA, has no specific ratio requirements.
• Wave 2 of the pattern, generally referred to as AB, should retrace by at least 11.34%, but no further than 22.31% of the range set by wave 1. 
• Wave 3 of the pattern, generally referred to as BC, should extend by at least 225.7%, but no further than 341% of the range set by wave 2.
• Wave 4 of the pattern, generally referred to as CD, should retrace by at least 77.69%, but no further than 88.66% of the range set by wave 3.
 Measurement Tolerances 
In general, tolerance in measurements refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. In this script I have applied this concept to the measurement of harmonic pattern ratios to increase to the frequency of pattern occurrences.
For example, the AB measurement of Gartley patterns is generally set at around 61.8%, but with such specificity in the measuring requirements the patterns are very rare. We can increase the frequency of pattern occurrences by setting a tolerance. A tolerance of 10% to both downside and upside, which is the default setting for all tolerances, means we would have a tolerable measurement range between 51.8-71.8%, thus increasing the frequency of occurrence.
█   FEATURES 
 Inputs 
• AB Lower Tolerance
• AB Upper Tolerance
• BC Lower Tolerance
• BC Upper Tolerance
• CD Lower Tolerance
• CD Upper Tolerance
• Pattern Color
• Label Color
• Show Projections
• Extend Current Projection Lines
 Alerts 
Users can set alerts for when the patterns occur.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   NOTES 
I know a few people have been requesting a single indicator that contains all my patterns and I definitely hear you on that one. However, I have been very busy working on other projects while trying to trade and be a human at the same time. For now I am going to maintain my original approach of releasing each pattern individually so as to maintain consistency. But I am now also working on getting my some of my libraries ready for public release and in doing so I will finally be able to fit all patterns into one script. I will also be giving my scripts some TLC by making them cleaner once I have the libraries up and running. Please bear with me in the meantime, this may take a while. Cheers!
Bullish Cassiopeia C Harmonic Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically detects and draws bullish Cassiopeia C harmonic patterns and price projections derived from the ranges that constitute the patterns. 
Cassiopeia A, B and C harmonic patterns are patterns that I created/discovered myself. They are all inspired by the Cassiopeia constellation and each one is based on different rotations of the constellation as it moves through the sky. The range ratios are also based on the constellation's right ascension and declination listed on Wikipedia:
Right ascension 22h 57m 04.5897s–03h 41m 14.0997s
Declination 77.6923447°–48.6632690°
en.wikipedia.org
I actually developed this idea quite a while ago now but have not felt audacious enough to introduce a new harmonic pattern, let alone 3 at the same time! But I have since been able to run backtests on tick data going back to 2002 across a variety of market and  timeframe combinations and have learned that the Cassiopeia patterns can certainly hold their own against the currently known harmonic patterns. 
I would also point out that the Cassiopeia constellation does actually look like a harmonic pattern and the Cassiopeia A star is literally the  'strongest source of radio emission in the sky beyond the solar system', so its arguably more of a real harmonic phenomenon than the current patterns. 
www.britannica.com
chandra.si.edu
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a close price equal to or above the price it opened.
• A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Upper Trends 
• A return line uptrend is formed when the current peak price is higher than the preceding peak price.
• A downtrend is formed when the current peak price is lower than the preceding peak price.
• A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
• An uptrend is formed when the current trough price is higher than the preceding trough price.
• A return line downtrend is formed when the current trough price is lower than the preceding trough price.
• A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Muti-Part Upper and Lower Trends 
• A multi-part return line uptrend begins with the formation of a new return line uptrend and continues until a new downtrend ends the trend.
• A multi-part downtrend begins with the formation of a new downtrend and continues until a new return line uptrend ends the trend.
• A multi-part uptrend begins with the formation of a new uptrend and continues until a new return line downtrend ends the trend.
• A multi-part return line downtrend begins with the formation of a new return line downtrend and continues until a new uptrend ends the trend.
 Double Trends 
• A double uptrend is formed when the current trough price is higher than the preceding trough price and the current peak price is higher than the preceding peak price.
• A double downtrend is formed when the current peak price is lower than the preceding peak price and the current trough price is lower than the preceding trough price.
 Muti-Part Double Trends 
• A multi-part double uptrend begins with the formation of a new uptrend that proceeds a new return line uptrend, and continues until a new downtrend or return line downtrend ends the trend.
• A multi-part double downtrend begins with the formation of a new downtrend that proceeds a new return line downtrend, and continues until a new uptrend or return line uptrend ends the trend. 
 Wave Cycles 
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. The first swing high or swing low will set the course for the sequence of wave cycles that follow; for example a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Figure 1.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Fibonacci Retracement and Extension Ratios 
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers, starting with 0 and 1. For example 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, and so on. Ultimately, we could go on forever but the first few numbers in the sequence are as follows: 0 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.
The extension ratios are calculated by dividing each number in the sequence by the number preceding it. For example 0/1 = 0, 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.6666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.6153..., 34/21 = 1.6190..., 55/34 = 1.6176..., 89/55 = 1.6181..., 144/89 = 1.6179..., and so on. The retracement ratios are calculated by inverting this process and dividing each number in the sequence by the number proceeding it. For example 0/1 = 0, 1/1 = 1, 1/2 = 0.5, 2/3 = 0.666..., 3/5 = 0.6, 5/8 = 0.625, 8/13 = 0.6153..., 13/21 = 0.6190..., 21/34 = 0.6176..., 34/55 = 0.6181..., 55/89 = 0.6179..., 89/144 = 0.6180..., and so on.
1.618 is considered to be the 'golden ratio', found in many natural phenomena such as the growth of seashells and the branching of trees. Some now speculate the universe oscillates at a frequency of 0,618 Hz, which could help to explain such phenomena, but this theory has yet to be proven.
Traders and analysts use Fibonacci retracement and extension indicators, consisting of horizontal lines representing different Fibonacci ratios, for identifying potential levels of support and resistance. Fibonacci ranges are typically drawn from left to right, with retracement levels representing ratios inside of the current range and extension levels representing ratios extended outside of the current range. If the current wave cycle ends on a swing low, the Fibonacci range is drawn from peak to trough. If the current wave cycle ends on a swing high the Fibonacci range is drawn from trough to peak.
 Harmonic Patterns 
The concept of harmonic patterns in trading was first introduced by H.M. Gartley in his book "Profits in the Stock Market", published in 1935. Gartley observed that markets have a tendency to move in repetitive patterns, and he identified several specific patterns that he believed could be used to predict future price movements.
Since then, many other traders and analysts have built upon Gartley's work and developed their own variations of harmonic patterns. One such contributor is Larry Pesavento, who developed his own methods for measuring harmonic patterns using Fibonacci ratios. Pesavento has written several books on the subject of harmonic patterns and Fibonacci ratios in trading. Another notable contributor to harmonic patterns is Scott Carney, who developed his own approach to harmonic trading in the late 1990s and also popularised the use of Fibonacci ratios to measure harmonic patterns. Carney expanded on Gartley's work and also introduced several new harmonic patterns, such as the Shark pattern and the 5-0 pattern.
The bullish and bearish Gartley patterns are the oldest recognized harmonic patterns in trading and all the other harmonic patterns are ultimately modifications of the original Gartley patterns. Gartley patterns are fundamentally composed of 5 points, or 4 waves.
 Bullish and Bearish Cassiopeia C Harmonic Patterns 
• Bullish Cassiopeia C patterns are fundamentally composed of three troughs and two peaks. The second peak being higher than the first peak. And the third trough being lower than both the first and second troughs, while the second trough is higher than the first.
• Bearish Cassiopeia C patterns are fundamentally composed of three peaks and two troughs. The second trough being lower than the first trough. And the third peak being higher than both the first and second peaks, while the second peak is lower than the first.
The ratio measurements I use to detect the patterns are as follows:
• Wave 1 of the pattern, generally referred to as XA, has no specific ratio requirements.
• Wave 2 of the pattern, generally referred to as AB, should retrace by at least 11.34%, but no further than 22.31% of the range set by wave 1. 
• Wave 3 of the pattern, generally referred to as BC, should extend by at least 225.7%, but no further than 341% of the range set by wave 2.
• Wave 4 of the pattern, generally referred to as CD, should retrace by at least 77.69%, but no further than 88.66% of the range set by wave 3.
 Measurement Tolerances 
In general, tolerance in measurements refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. In this script I have applied this concept to the measurement of harmonic pattern ratios to increase to the frequency of pattern occurrences.
For example, the AB measurement of Gartley patterns is generally set at around 61.8%, but with such specificity in the measuring requirements the patterns are very rare. We can increase the frequency of pattern occurrences by setting a tolerance. A tolerance of 10% to both downside and upside, which is the default setting for all tolerances, means we would have a tolerable measurement range between 51.8-71.8%, thus increasing the frequency of occurrence.
█   FEATURES 
 Inputs 
• AB Lower Tolerance
• AB Upper Tolerance
• BC Lower Tolerance
• BC Upper Tolerance
• CD Lower Tolerance
• CD Upper Tolerance
• Pattern Color
• Label Color
• Show Projections
• Extend Current Projection Lines
 Alerts 
Users can set alerts for when the patterns occur.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   NOTES 
I know a few people have been requesting a single indicator that contains all my patterns and I definitely hear you on that one. However, I have been very busy working on other projects while trying to trade and be a human at the same time. For now I am going to maintain my original approach of releasing each pattern individually so as to maintain consistency. But I am now also working on getting my some of my libraries ready for public release and in doing so I will finally be able to fit all patterns into one script. I will also be giving my scripts some TLC by making them cleaner once I have the libraries up and running. Please bear with me in the meantime, this may take a while. Cheers!
Bearish Cassiopeia B Harmonic Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically detects and draws bearish Cassiopeia B harmonic patterns and price projections derived from the ranges that constitute the patterns. 
Cassiopeia A, B and C harmonic patterns are patterns that I created/discovered myself. They are all inspired by the Cassiopeia constellation and each one is based on different rotations of the constellation as it moves through the sky. The range ratios are also based on the constellation's right ascension and declination listed on Wikipedia:
Right ascension 22h 57m 04.5897s–03h 41m 14.0997s
Declination 77.6923447°–48.6632690°
en.wikipedia.org
I actually developed this idea quite a while ago now but have not felt audacious enough to introduce a new harmonic pattern, let alone 3 at the same time! But I have since been able to run backtests on tick data going back to 2002 across a variety of market and  timeframe combinations and have learned that the Cassiopeia patterns can certainly hold their own against the currently known harmonic patterns. 
I would also point out that the Cassiopeia constellation does actually look like a harmonic pattern and the Cassiopeia A star is literally the  'strongest source of radio emission in the sky beyond the solar system', so its arguably more of a real harmonic phenomenon than the current patterns. 
www.britannica.com
chandra.si.edu
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a close price equal to or above the price it opened.
• A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Upper Trends 
• A return line uptrend is formed when the current peak price is higher than the preceding peak price.
• A downtrend is formed when the current peak price is lower than the preceding peak price.
• A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
• An uptrend is formed when the current trough price is higher than the preceding trough price.
• A return line downtrend is formed when the current trough price is lower than the preceding trough price.
• A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Muti-Part Upper and Lower Trends 
• A multi-part return line uptrend begins with the formation of a new return line uptrend and continues until a new downtrend ends the trend.
• A multi-part downtrend begins with the formation of a new downtrend and continues until a new return line uptrend ends the trend.
• A multi-part uptrend begins with the formation of a new uptrend and continues until a new return line downtrend ends the trend.
• A multi-part return line downtrend begins with the formation of a new return line downtrend and continues until a new uptrend ends the trend.
 Double Trends 
• A double uptrend is formed when the current trough price is higher than the preceding trough price and the current peak price is higher than the preceding peak price.
• A double downtrend is formed when the current peak price is lower than the preceding peak price and the current trough price is lower than the preceding trough price.
 Muti-Part Double Trends 
• A multi-part double uptrend begins with the formation of a new uptrend that proceeds a new return line uptrend, and continues until a new downtrend or return line downtrend ends the trend.
• A multi-part double downtrend begins with the formation of a new downtrend that proceeds a new return line downtrend, and continues until a new uptrend or return line uptrend ends the trend. 
 Wave Cycles 
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. The first swing high or swing low will set the course for the sequence of wave cycles that follow; for example a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Figure 1.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Fibonacci Retracement and Extension Ratios 
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers, starting with 0 and 1. For example 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, and so on. Ultimately, we could go on forever but the first few numbers in the sequence are as follows: 0 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.
The extension ratios are calculated by dividing each number in the sequence by the number preceding it. For example 0/1 = 0, 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.6666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.6153..., 34/21 = 1.6190..., 55/34 = 1.6176..., 89/55 = 1.6181..., 144/89 = 1.6179..., and so on. The retracement ratios are calculated by inverting this process and dividing each number in the sequence by the number proceeding it. For example 0/1 = 0, 1/1 = 1, 1/2 = 0.5, 2/3 = 0.666..., 3/5 = 0.6, 5/8 = 0.625, 8/13 = 0.6153..., 13/21 = 0.6190..., 21/34 = 0.6176..., 34/55 = 0.6181..., 55/89 = 0.6179..., 89/144 = 0.6180..., and so on.
1.618 is considered to be the 'golden ratio', found in many natural phenomena such as the growth of seashells and the branching of trees. Some now speculate the universe oscillates at a frequency of 0,618 Hz, which could help to explain such phenomena, but this theory has yet to be proven.
Traders and analysts use Fibonacci retracement and extension indicators, consisting of horizontal lines representing different Fibonacci ratios, for identifying potential levels of support and resistance. Fibonacci ranges are typically drawn from left to right, with retracement levels representing ratios inside of the current range and extension levels representing ratios extended outside of the current range. If the current wave cycle ends on a swing low, the Fibonacci range is drawn from peak to trough. If the current wave cycle ends on a swing high the Fibonacci range is drawn from trough to peak.
 Harmonic Patterns 
The concept of harmonic patterns in trading was first introduced by H.M. Gartley in his book "Profits in the Stock Market", published in 1935. Gartley observed that markets have a tendency to move in repetitive patterns, and he identified several specific patterns that he believed could be used to predict future price movements.
Since then, many other traders and analysts have built upon Gartley's work and developed their own variations of harmonic patterns. One such contributor is Larry Pesavento, who developed his own methods for measuring harmonic patterns using Fibonacci ratios. Pesavento has written several books on the subject of harmonic patterns and Fibonacci ratios in trading. Another notable contributor to harmonic patterns is Scott Carney, who developed his own approach to harmonic trading in the late 1990s and also popularised the use of Fibonacci ratios to measure harmonic patterns. Carney expanded on Gartley's work and also introduced several new harmonic patterns, such as the Shark pattern and the 5-0 pattern.
The bullish and bearish Gartley patterns are the oldest recognized harmonic patterns in trading and all the other harmonic patterns are ultimately modifications of the original Gartley patterns. Gartley patterns are fundamentally composed of 5 points, or 4 waves.
 Bullish and Bearish Cassiopeia B Harmonic Patterns 
• Bullish Cassiopeia B patterns are fundamentally composed of three troughs and two peaks. The second peak being lower than the first peak. And the third trough being lower than both the first and second troughs, while the second trough is also lower than the first.
• Bearish Cassiopeia B patterns are fundamentally composed of three peaks and two troughs. The second trough being higher than the first trough. And the third peak being higher than both the first and second peaks, while the second peak is also higher than the first.
The ratio measurements I use to detect the patterns are as follows:
• Wave 1 of the pattern, generally referred to as XA, has no specific ratio requirements.
• Wave 2 of the pattern, generally referred to as AB, should retrace by at least 11.34%, but no further than 22.31% of the range set by wave 1. 
• Wave 3 of the pattern, generally referred to as BC, should extend by at least 225.7%, but no further than 341% of the range set by wave 2.
• Wave 4 of the pattern, generally referred to as CD, should retrace by at least 77.69%, but no further than 88.66% of the range set by wave 3.
 Measurement Tolerances 
In general, tolerance in measurements refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. In this script I have applied this concept to the measurement of harmonic pattern ratios to increase to the frequency of pattern occurrences.
For example, the AB measurement of Gartley patterns is generally set at around 61.8%, but with such specificity in the measuring requirements the patterns are very rare. We can increase the frequency of pattern occurrences by setting a tolerance. A tolerance of 10% to both downside and upside, which is the default setting for all tolerances, means we would have a tolerable measurement range between 51.8-71.8%, thus increasing the frequency of occurrence.
█   FEATURES 
 Inputs 
• AB Lower Tolerance
• AB Upper Tolerance
• BC Lower Tolerance
• BC Upper Tolerance
• CD Lower Tolerance
• CD Upper Tolerance
• Pattern Color
• Label Color
• Show Projections
• Extend Current Projection Lines
 Alerts 
Users can set alerts for when the patterns occur.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   NOTES 
I know a few people have been requesting a single indicator that contains all my patterns and I definitely hear you on that one. However, I have been very busy working on other projects while trying to trade and be a human at the same time. For now I am going to maintain my original approach of releasing each pattern individually so as to maintain consistency. But I am now also working on getting my some of my libraries ready for public release and in doing so I will finally be able to fit all patterns into one script. I will also be giving my scripts some TLC by making them cleaner once I have the libraries up and running. Please bear with me in the meantime, this may take a while. Cheers!
Bullish Cassiopeia B Harmonic Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically detects and draws bullish Cassiopeia B harmonic patterns and price projections derived from the ranges that constitute the patterns. 
Cassiopeia A, B and C harmonic patterns are patterns that I created/discovered myself. They are all inspired by the Cassiopeia constellation and each one is based on different rotations of the constellation as it moves through the sky. The range ratios are also based on the constellation's right ascension and declination listed on Wikipedia:
Right ascension 22h 57m 04.5897s–03h 41m 14.0997s
Declination 77.6923447°–48.6632690°
en.wikipedia.org
I actually developed this idea quite a while ago now but have not felt audacious enough to introduce a new harmonic pattern, let alone 3 at the same time! But I have since been able to run backtests on tick data going back to 2002 across a variety of market and  timeframe combinations and have learned that the Cassiopeia patterns can certainly hold their own against the currently known harmonic patterns. 
I would also point out that the Cassiopeia constellation does actually look like a harmonic pattern and the Cassiopeia A star is literally the  'strongest source of radio emission in the sky beyond the solar system', so its arguably more of a real harmonic phenomenon than the current patterns. 
www.britannica.com
chandra.si.edu
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a close price equal to or above the price it opened.
• A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Upper Trends 
• A return line uptrend is formed when the current peak price is higher than the preceding peak price.
• A downtrend is formed when the current peak price is lower than the preceding peak price.
• A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
• An uptrend is formed when the current trough price is higher than the preceding trough price.
• A return line downtrend is formed when the current trough price is lower than the preceding trough price.
• A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Muti-Part Upper and Lower Trends 
• A multi-part return line uptrend begins with the formation of a new return line uptrend and continues until a new downtrend ends the trend.
• A multi-part downtrend begins with the formation of a new downtrend and continues until a new return line uptrend ends the trend.
• A multi-part uptrend begins with the formation of a new uptrend and continues until a new return line downtrend ends the trend.
• A multi-part return line downtrend begins with the formation of a new return line downtrend and continues until a new uptrend ends the trend.
 Double Trends 
• A double uptrend is formed when the current trough price is higher than the preceding trough price and the current peak price is higher than the preceding peak price.
• A double downtrend is formed when the current peak price is lower than the preceding peak price and the current trough price is lower than the preceding trough price.
 Muti-Part Double Trends 
• A multi-part double uptrend begins with the formation of a new uptrend that proceeds a new return line uptrend, and continues until a new downtrend or return line downtrend ends the trend.
• A multi-part double downtrend begins with the formation of a new downtrend that proceeds a new return line downtrend, and continues until a new uptrend or return line uptrend ends the trend. 
 Wave Cycles 
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. The first swing high or swing low will set the course for the sequence of wave cycles that follow; for example a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Figure 1.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Fibonacci Retracement and Extension Ratios 
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers, starting with 0 and 1. For example 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, and so on. Ultimately, we could go on forever but the first few numbers in the sequence are as follows: 0 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.
The extension ratios are calculated by dividing each number in the sequence by the number preceding it. For example 0/1 = 0, 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.6666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.6153..., 34/21 = 1.6190..., 55/34 = 1.6176..., 89/55 = 1.6181..., 144/89 = 1.6179..., and so on. The retracement ratios are calculated by inverting this process and dividing each number in the sequence by the number proceeding it. For example 0/1 = 0, 1/1 = 1, 1/2 = 0.5, 2/3 = 0.666..., 3/5 = 0.6, 5/8 = 0.625, 8/13 = 0.6153..., 13/21 = 0.6190..., 21/34 = 0.6176..., 34/55 = 0.6181..., 55/89 = 0.6179..., 89/144 = 0.6180..., and so on.
1.618 is considered to be the 'golden ratio', found in many natural phenomena such as the growth of seashells and the branching of trees. Some now speculate the universe oscillates at a frequency of 0,618 Hz, which could help to explain such phenomena, but this theory has yet to be proven.
Traders and analysts use Fibonacci retracement and extension indicators, consisting of horizontal lines representing different Fibonacci ratios, for identifying potential levels of support and resistance. Fibonacci ranges are typically drawn from left to right, with retracement levels representing ratios inside of the current range and extension levels representing ratios extended outside of the current range. If the current wave cycle ends on a swing low, the Fibonacci range is drawn from peak to trough. If the current wave cycle ends on a swing high the Fibonacci range is drawn from trough to peak.
 Harmonic Patterns 
The concept of harmonic patterns in trading was first introduced by H.M. Gartley in his book "Profits in the Stock Market", published in 1935. Gartley observed that markets have a tendency to move in repetitive patterns, and he identified several specific patterns that he believed could be used to predict future price movements.
Since then, many other traders and analysts have built upon Gartley's work and developed their own variations of harmonic patterns. One such contributor is Larry Pesavento, who developed his own methods for measuring harmonic patterns using Fibonacci ratios. Pesavento has written several books on the subject of harmonic patterns and Fibonacci ratios in trading. Another notable contributor to harmonic patterns is Scott Carney, who developed his own approach to harmonic trading in the late 1990s and also popularised the use of Fibonacci ratios to measure harmonic patterns. Carney expanded on Gartley's work and also introduced several new harmonic patterns, such as the Shark pattern and the 5-0 pattern.
The bullish and bearish Gartley patterns are the oldest recognized harmonic patterns in trading and all the other harmonic patterns are ultimately modifications of the original Gartley patterns. Gartley patterns are fundamentally composed of 5 points, or 4 waves.
 Bullish and Bearish Cassiopeia B Harmonic Patterns 
• Bullish Cassiopeia B patterns are fundamentally composed of three troughs and two peaks. The second peak being lower than the first peak. And the third trough being lower than both the first and second troughs, while the second trough is also lower than the first.
• Bearish Cassiopeia B patterns are fundamentally composed of three peaks and two troughs. The second trough being higher than the first trough. And the third peak being higher than both the first and second peaks, while the second peak is also higher than the first.
The ratio measurements I use to detect the patterns are as follows:
• Wave 1 of the pattern, generally referred to as XA, has no specific ratio requirements.
• Wave 2 of the pattern, generally referred to as AB, should retrace by at least 11.34%, but no further than 22.31% of the range set by wave 1. 
• Wave 3 of the pattern, generally referred to as BC, should extend by at least 225.7%, but no further than 341% of the range set by wave 2.
• Wave 4 of the pattern, generally referred to as CD, should retrace by at least 77.69%, but no further than 88.66% of the range set by wave 3.
 Measurement Tolerances 
In general, tolerance in measurements refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. In this script I have applied this concept to the measurement of harmonic pattern ratios to increase to the frequency of pattern occurrences.
For example, the AB measurement of Gartley patterns is generally set at around 61.8%, but with such specificity in the measuring requirements the patterns are very rare. We can increase the frequency of pattern occurrences by setting a tolerance. A tolerance of 10% to both downside and upside, which is the default setting for all tolerances, means we would have a tolerable measurement range between 51.8-71.8%, thus increasing the frequency of occurrence.
█   FEATURES 
 Inputs 
• AB Lower Tolerance
• AB Upper Tolerance
• BC Lower Tolerance
• BC Upper Tolerance
• CD Lower Tolerance
• CD Upper Tolerance
• Pattern Color
• Label Color
• Show Projections
• Extend Current Projection Lines
 Alerts 
Users can set alerts for when the patterns occur.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   NOTES 
I know a few people have been requesting a single indicator that contains all my patterns and I definitely hear you on that one. However, I have been very busy working on other projects while trying to trade and be a human at the same time. For now I am going to maintain my original approach of releasing each pattern individually so as to maintain consistency. But I am now also working on getting my some of my libraries ready for public release and in doing so I will finally be able to fit all patterns into one script. I will also be giving my scripts some TLC by making them cleaner once I have the libraries up and running. Please bear with me in the meantime, this may take a while. Cheers!
Bearish Cassiopeia A Harmonic Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically detects and draws bearish Cassiopeia A harmonic patterns and price projections derived from the ranges that constitute the patterns. 
Cassiopeia A, B and C harmonic patterns are patterns that I created/discovered myself. They are all inspired by the Cassiopeia constellation and each one is based on different rotations of the constellation as it moves through the sky. The range ratios are also based on the constellation's right ascension and declination listed on Wikipedia:
Right ascension 22h 57m 04.5897s–03h 41m 14.0997s
Declination 77.6923447°–48.6632690°
en.wikipedia.org
I actually developed this idea quite a while ago now but have not felt audacious enough to introduce a new harmonic pattern, let alone 3 at the same time! But I have since been able to run backtests on tick data going back to 2002 across a variety of market and  timeframe combinations and have learned that the Cassiopeia patterns can certainly hold their own against the currently known harmonic patterns. 
I would also point out that the Cassiopeia constellation does actually look like a harmonic pattern and the Cassiopeia A star is literally the  'strongest source of radio emission in the sky beyond the solar system', so its arguably more of a real harmonic phenomenon than the current patterns. 
www.britannica.com
chandra.si.edu
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a close price equal to or above the price it opened.
• A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Upper Trends 
• A return line uptrend is formed when the current peak price is higher than the preceding peak price.
• A downtrend is formed when the current peak price is lower than the preceding peak price.
• A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
• An uptrend is formed when the current trough price is higher than the preceding trough price.
• A return line downtrend is formed when the current trough price is lower than the preceding trough price.
• A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Muti-Part Upper and Lower Trends 
• A multi-part return line uptrend begins with the formation of a new return line uptrend and continues until a new downtrend ends the trend.
• A multi-part downtrend begins with the formation of a new downtrend and continues until a new return line uptrend ends the trend.
• A multi-part uptrend begins with the formation of a new uptrend and continues until a new return line downtrend ends the trend.
• A multi-part return line downtrend begins with the formation of a new return line downtrend and continues until a new uptrend ends the trend.
 Double Trends 
• A double uptrend is formed when the current trough price is higher than the preceding trough price and the current peak price is higher than the preceding peak price.
• A double downtrend is formed when the current peak price is lower than the preceding peak price and the current trough price is lower than the preceding trough price.
 Muti-Part Double Trends 
• A multi-part double uptrend begins with the formation of a new uptrend that proceeds a new return line uptrend, and continues until a new downtrend or return line downtrend ends the trend.
• A multi-part double downtrend begins with the formation of a new downtrend that proceeds a new return line downtrend, and continues until a new uptrend or return line uptrend ends the trend. 
 Wave Cycles 
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. The first swing high or swing low will set the course for the sequence of wave cycles that follow; for example a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Figure 1.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Fibonacci Retracement and Extension Ratios 
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers, starting with 0 and 1. For example 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, and so on. Ultimately, we could go on forever but the first few numbers in the sequence are as follows: 0 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.
The extension ratios are calculated by dividing each number in the sequence by the number preceding it. For example 0/1 = 0, 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.6666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.6153..., 34/21 = 1.6190..., 55/34 = 1.6176..., 89/55 = 1.6181..., 144/89 = 1.6179..., and so on. The retracement ratios are calculated by inverting this process and dividing each number in the sequence by the number proceeding it. For example 0/1 = 0, 1/1 = 1, 1/2 = 0.5, 2/3 = 0.666..., 3/5 = 0.6, 5/8 = 0.625, 8/13 = 0.6153..., 13/21 = 0.6190..., 21/34 = 0.6176..., 34/55 = 0.6181..., 55/89 = 0.6179..., 89/144 = 0.6180..., and so on.
1.618 is considered to be the 'golden ratio', found in many natural phenomena such as the growth of seashells and the branching of trees. Some now speculate the universe oscillates at a frequency of 0,618 Hz, which could help to explain such phenomena, but this theory has yet to be proven.
Traders and analysts use Fibonacci retracement and extension indicators, consisting of horizontal lines representing different Fibonacci ratios, for identifying potential levels of support and resistance. Fibonacci ranges are typically drawn from left to right, with retracement levels representing ratios inside of the current range and extension levels representing ratios extended outside of the current range. If the current wave cycle ends on a swing low, the Fibonacci range is drawn from peak to trough. If the current wave cycle ends on a swing high the Fibonacci range is drawn from trough to peak.
 Harmonic Patterns 
The concept of harmonic patterns in trading was first introduced by H.M. Gartley in his book "Profits in the Stock Market", published in 1935. Gartley observed that markets have a tendency to move in repetitive patterns, and he identified several specific patterns that he believed could be used to predict future price movements.
Since then, many other traders and analysts have built upon Gartley's work and developed their own variations of harmonic patterns. One such contributor is Larry Pesavento, who developed his own methods for measuring harmonic patterns using Fibonacci ratios. Pesavento has written several books on the subject of harmonic patterns and Fibonacci ratios in trading. Another notable contributor to harmonic patterns is Scott Carney, who developed his own approach to harmonic trading in the late 1990s and also popularised the use of Fibonacci ratios to measure harmonic patterns. Carney expanded on Gartley's work and also introduced several new harmonic patterns, such as the Shark pattern and the 5-0 pattern.
The bullish and bearish Gartley patterns are the oldest recognized harmonic patterns in trading and all the other harmonic patterns are ultimately modifications of the original Gartley patterns. Gartley patterns are fundamentally composed of 5 points, or 4 waves.
 Bullish and Bearish Cassiopeia A Harmonic Patterns 
• Bullish Cassiopeia A patterns are fundamentally composed of three troughs and two peaks. The second peak being higher than the first peak. And the third trough being higher than both the first and second troughs, while the second trough is also higher than the first.
• Bearish Cassiopeia A patterns are fundamentally composed of three peaks and two troughs. The second trough being lower than the first trough. And the third peak being lower than both the first and second peaks, while the second peak is also lower than the first.
The ratio measurements I use to detect the patterns are as follows:
• Wave 1 of the pattern, generally referred to as XA, has no specific ratio requirements.
• Wave 2 of the pattern, generally referred to as AB, should retrace by at least 11.34%, but no further than 22.31% of the range set by wave 1. 
• Wave 3 of the pattern, generally referred to as BC, should extend by at least 225.7%, but no further than 341% of the range set by wave 2.
• Wave 4 of the pattern, generally referred to as CD, should retrace by at least 77.69%, but no further than 88.66% of the range set by wave 3.
 Measurement Tolerances 
In general, tolerance in measurements refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. In this script I have applied this concept to the measurement of harmonic pattern ratios to increase to the frequency of pattern occurrences.
For example, the AB measurement of Gartley patterns is generally set at around 61.8%, but with such specificity in the measuring requirements the patterns are very rare. We can increase the frequency of pattern occurrences by setting a tolerance. A tolerance of 10% to both downside and upside, which is the default setting for all tolerances, means we would have a tolerable measurement range between 51.8-71.8%, thus increasing the frequency of occurrence.
█   FEATURES 
 Inputs 
• AB Lower Tolerance
• AB Upper Tolerance
• BC Lower Tolerance
• BC Upper Tolerance
• CD Lower Tolerance
• CD Upper Tolerance
• Pattern Color
• Label Color
• Show Projections
• Extend Current Projection Lines
 Alerts 
Users can set alerts for when the patterns occur.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   NOTES 
I know a few people have been requesting a single indicator that contains all my patterns and I definitely hear you on that one. However, I have been very busy working on other projects while trying to trade and be a human at the same time. For now I am going to maintain my original approach of releasing each pattern individually so as to maintain consistency. But I am now also working on getting my some of my libraries ready for public release and in doing so I will finally be able to fit all patterns into one script. I will also be giving my scripts some TLC by making them cleaner once I have the libraries up and running. Please bear with me in the meantime, this may take a while. Cheers!
Bullish Cassiopeia A Harmonic Patterns [theEccentricTrader]█   OVERVIEW 
This indicator automatically detects and draws bullish Cassiopeia A harmonic patterns and price projections derived from the ranges that constitute the patterns. 
Cassiopeia A, B and C harmonic patterns are patterns that I created/discovered myself. They are all inspired by the Cassiopeia constellation and each one is based on different rotations of the constellation as it moves through the sky. The range ratios are also based on the constellation's right ascension and declination listed on Wikipedia:
Right ascension 22h 57m 04.5897s–03h 41m 14.0997s
Declination 77.6923447°–48.6632690°
en.wikipedia.org
I actually developed this idea quite a while ago now but have not felt audacious enough to introduce a new harmonic pattern, let alone 3 at the same time! But I have since been able to run backtests on tick data going back to 2002 across a variety of market and  timeframe combinations and have learned that the Cassiopeia patterns can certainly hold their own against the currently known harmonic patterns. As can be seen in the picture above the bullish Cassiopeia A caught the 2009 bear market bottom almost perfectly.
I would also point out that the Cassiopeia constellation does actually look like a harmonic pattern and the Cassiopeia A star is literally the  'strongest source of radio emission in the sky beyond the solar system', so its arguably more of a real harmonic phenomenon than the current patterns. 
www.britannica.com
chandra.si.edu
█   CONCEPTS 
 Green and Red Candles 
• A green candle is one that closes with a close price equal to or above the price it opened.
• A red candle is one that closes with a close price that is lower than the price it opened.
 Swing Highs and Swing Lows 
• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.
 Peak and Trough Prices (Basic) 
• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.
 Historic Peaks and Troughs 
The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.
 Range 
The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.
 Upper Trends 
• A return line uptrend is formed when the current peak price is higher than the preceding peak price.
• A downtrend is formed when the current peak price is lower than the preceding peak price.
• A double-top is formed when the current peak price is equal to the preceding peak price.
 Lower Trends 
• An uptrend is formed when the current trough price is higher than the preceding trough price.
• A return line downtrend is formed when the current trough price is lower than the preceding trough price.
• A double-bottom is formed when the current trough price is equal to the preceding trough price.
 Muti-Part Upper and Lower Trends 
• A multi-part return line uptrend begins with the formation of a new return line uptrend and continues until a new downtrend ends the trend.
• A multi-part downtrend begins with the formation of a new downtrend and continues until a new return line uptrend ends the trend.
• A multi-part uptrend begins with the formation of a new uptrend and continues until a new return line downtrend ends the trend.
• A multi-part return line downtrend begins with the formation of a new return line downtrend and continues until a new uptrend ends the trend.
 Double Trends 
• A double uptrend is formed when the current trough price is higher than the preceding trough price and the current peak price is higher than the preceding peak price.
• A double downtrend is formed when the current peak price is lower than the preceding peak price and the current trough price is lower than the preceding trough price.
 Muti-Part Double Trends 
• A multi-part double uptrend begins with the formation of a new uptrend that proceeds a new return line uptrend, and continues until a new downtrend or return line downtrend ends the trend.
• A multi-part double downtrend begins with the formation of a new downtrend that proceeds a new return line downtrend, and continues until a new uptrend or return line uptrend ends the trend. 
 Wave Cycles 
A wave cycle is here defined as a complete two-part move between a swing high and a swing low, or a swing low and a swing high. The first swing high or swing low will set the course for the sequence of wave cycles that follow; for example a chart that begins with a swing low will form its first complete wave cycle upon the formation of the first complete swing high and vice versa.
Figure 1.
 Retracement and Extension Ratios 
Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range. 
 Fibonacci Retracement and Extension Ratios 
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers, starting with 0 and 1. For example 0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, and so on. Ultimately, we could go on forever but the first few numbers in the sequence are as follows: 0 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.
The extension ratios are calculated by dividing each number in the sequence by the number preceding it. For example 0/1 = 0, 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.6666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.6153..., 34/21 = 1.6190..., 55/34 = 1.6176..., 89/55 = 1.6181..., 144/89 = 1.6179..., and so on. The retracement ratios are calculated by inverting this process and dividing each number in the sequence by the number proceeding it. For example 0/1 = 0, 1/1 = 1, 1/2 = 0.5, 2/3 = 0.666..., 3/5 = 0.6, 5/8 = 0.625, 8/13 = 0.6153..., 13/21 = 0.6190..., 21/34 = 0.6176..., 34/55 = 0.6181..., 55/89 = 0.6179..., 89/144 = 0.6180..., and so on.
1.618 is considered to be the 'golden ratio', found in many natural phenomena such as the growth of seashells and the branching of trees. Some now speculate the universe oscillates at a frequency of 0,618 Hz, which could help to explain such phenomena, but this theory has yet to be proven.
Traders and analysts use Fibonacci retracement and extension indicators, consisting of horizontal lines representing different Fibonacci ratios, for identifying potential levels of support and resistance. Fibonacci ranges are typically drawn from left to right, with retracement levels representing ratios inside of the current range and extension levels representing ratios extended outside of the current range. If the current wave cycle ends on a swing low, the Fibonacci range is drawn from peak to trough. If the current wave cycle ends on a swing high the Fibonacci range is drawn from trough to peak.
 Harmonic Patterns 
The concept of harmonic patterns in trading was first introduced by H.M. Gartley in his book "Profits in the Stock Market", published in 1935. Gartley observed that markets have a tendency to move in repetitive patterns, and he identified several specific patterns that he believed could be used to predict future price movements.
Since then, many other traders and analysts have built upon Gartley's work and developed their own variations of harmonic patterns. One such contributor is Larry Pesavento, who developed his own methods for measuring harmonic patterns using Fibonacci ratios. Pesavento has written several books on the subject of harmonic patterns and Fibonacci ratios in trading. Another notable contributor to harmonic patterns is Scott Carney, who developed his own approach to harmonic trading in the late 1990s and also popularised the use of Fibonacci ratios to measure harmonic patterns. Carney expanded on Gartley's work and also introduced several new harmonic patterns, such as the Shark pattern and the 5-0 pattern.
The bullish and bearish Gartley patterns are the oldest recognized harmonic patterns in trading and all the other harmonic patterns are ultimately modifications of the original Gartley patterns. Gartley patterns are fundamentally composed of 5 points, or 4 waves.
 Bullish and Bearish Cassiopeia A Harmonic Patterns 
• Bullish Cassiopeia A patterns are fundamentally composed of three troughs and two peaks. The second peak being higher than the first peak. And the third trough being higher than both the first and second troughs, while the second trough is also higher than the first.
• Bearish Cassiopeia A patterns are fundamentally composed of three peaks and two troughs. The second trough being lower than the first trough. And the third peak being lower than both the first and second peaks, while the second peak is also lower than the first.
The ratio measurements I use to detect the patterns are as follows:
• Wave 1 of the pattern, generally referred to as XA, has no specific ratio requirements.
• Wave 2 of the pattern, generally referred to as AB, should retrace by at least 11.34%, but no further than 22.31% of the range set by wave 1. 
• Wave 3 of the pattern, generally referred to as BC, should extend by at least 225.7%, but no further than 341% of the range set by wave 2.
• Wave 4 of the pattern, generally referred to as CD, should retrace by at least 77.69%, but no further than 88.66% of the range set by wave 3.
 Measurement Tolerances 
In general, tolerance in measurements refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. In this script I have applied this concept to the measurement of harmonic pattern ratios to increase to the frequency of pattern occurrences.
For example, the AB measurement of Gartley patterns is generally set at around 61.8%, but with such specificity in the measuring requirements the patterns are very rare. We can increase the frequency of pattern occurrences by setting a tolerance. A tolerance of 10% to both downside and upside, which is the default setting for all tolerances, means we would have a tolerable measurement range between 51.8-71.8%, thus increasing the frequency of occurrence.
█   FEATURES 
 Inputs 
• AB Lower Tolerance
• AB Upper Tolerance
• BC Lower Tolerance
• BC Upper Tolerance
• CD Lower Tolerance
• CD Upper Tolerance
• Pattern Color
• Label Color
• Show Projections
• Extend Current Projection Lines
 Alerts 
Users can set alerts for when the patterns occur.
█   LIMITATIONS 
All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
█   NOTES 
I know a few people have been requesting a single indicator that contains all my patterns and I definitely hear you on that one. However, I have been very busy working on other projects while trying to trade and be a human at the same time. For now I am going to maintain my original approach of releasing each pattern individually so as to maintain consistency. But I am now also working on getting my some of my libraries ready for public release and in doing so I will finally be able to fit all patterns into one script. I will also be giving my scripts some TLC by making them cleaner once I have the libraries up and running. Please bear with me in the meantime, this may take a while. Cheers!
Liquidity Grab Screener | Flux Charts💎 GENERAL OVERVIEW 
Introducing our new Liquidity Grab Screener! This screener can provide information about the latest liquidity grabs in up to 5 tickers. You can also customize the algorithm that finds the liquidity grabs and the styling of the screener.
  
Features of the new Liquidity Grab Screener :
 
 Find Latest Liquidity Grabs Accross 5 Tickers
 Price, Size, Status Information
 Customizable Algoritm / Styling
 
 📌 HOW DOES IT WORK ? 
Liquidity grabs occur when one of the latest pivots has a false breakout. Then, if the wick to body ratio of the bar is higher than 0.5 (can be changed from the settings) a bubble is plotted.
  
The bubble size is determined by the wick to body ratio of the candle.
This screener then finds liquidity grabs accross 5 different tickers, and shows the latest information about them.
  
Price -> The price when the liquidity grab happened.
Size -> Size of the liquidity grab, determined by the wick-body ratio.
Status -> Shows the elapsed time of the liquidity grab.
 🚩UNIQUENESS 
Liquidity grabs can be useful when determining candles that have executed a lot of market orders, and planning your trades accordingly. This screener will find liquidity grabs from up to 5 tickers and give information about their price, size and status. The screener also lets you customize the pivot length and the wick-body ratio for liquidity grabs.
  
 ⚙️SETTINGS 
1. Tickers
You can set up to 5 tickers for the screener to scan order blocks here. You can also enable / disable them and set their individual timeframes.
2. General Configuration
Pivot Length -> This setting determines the range of the pivots. This means a candle has to have the highest / lowest wick of the previous X bars and the next X bars to become a high / low pivot.
Wick-Body Ratio -> After a pivot has a false breakout, the wick-body ratio of the latest candle is tested. The resulting ratio must be higher than this setting for it to be considered as a liquidity grab.
  
 
Liquidity-Finder ICT / SMCIn the context of ICT and the Smart Money Concept, liquidity is likely viewed as a crucial factor for determining the strength and sustainability of a market move. Smart Money is often associated with large institutional traders who have the ability to influence liquidity.
Liquidity Sweep:
A liquidity sweep in this context might involve Smart Money intentionally executing trades across various price levels to assess market depth and liquidity. This information can be used to identify potential areas of interest for Smart Money to initiate or exit positions without causing significant price disruptions.
Stop Hunt:
Stop hunting is a concept that Smart Money traders may employ to deliberately trigger stop orders in the market. By doing so, they can create temporary price movements that allow them to accumulate or liquidate positions at more favorable prices before the market reacts.
Smart Money Concept (SMC):
The Smart Money Concept revolves around the idea that large institutional traders (Smart Money) have superior information and resources compared to retail traders. Understanding the behavior of Smart Money, as taught in ICT and SMC, involves analyzing market dynamics, order flow, and liquidity to make more informed trading decisions.
Liquidating:
Liquidating refers to the process of selling or closing out existing positions. In the context of Smart Money, the term could imply that institutional traders are actively managing their positions, either taking profits or cutting losses strategically based on their analysis of market conditions.
 The Indicator 
 
  The Indicator show open liquidity as solid lines and liquidates liquidity as dashed lines
  Is able to send alerts for liquidity level was liquidated, liquidity level was dipped or the next close is on the other side 
Double AI Super Trend Trading - Strategy [PresentTrading]█ Introduction and How It is Different
The Double AI Super Trend Trading Strategy is a cutting-edge approach that leverages the power of not one, but two AI algorithms, in tandem with the SuperTrend technical indicator. The strategy aims to provide traders with enhanced precision in market entry and exit points. It is designed to adapt to market conditions dynamically, offering the flexibility to trade in both bullish and bearish markets.
*The KNN part is mainly referred from @Zeiierman.
BTCUSD 8hr performance
  
ETHUSD 8hr performance
  
█ Strategy, How It Works: Detailed Explanation
1. SuperTrend Calculation
The SuperTrend is a popular indicator that captures market trends through a combination of the Volume-Weighted Moving Average (VWMA) and the Average True Range (ATR). This strategy utilizes two sets of SuperTrend calculations with varying lengths and factors to capture both short-term and long-term market trends.
2. KNN Algorithm
The strategy employs k-Nearest Neighbors (KNN) algorithms, which are supervised machine learning models. Two sets of KNN algorithms are used, each focused on different lengths of historical data and number of neighbors. The KNN algorithms classify the current SuperTrend data point as bullish or bearish based on the weighted sum of the labels of the k closest historical data points.
3. Signal Generation
Based on the KNN classifications and the SuperTrend indicator, the strategy generates signals for the start of a new trend and the continuation of an existing trend.
4. Trading Logic
The strategy uses these signals to enter long or short positions. It also incorporates dynamic trailing stops for exit conditions.
Local picture
  
█ Trade Direction
The strategy allows traders to specify their trading direction: long, short, or both. This enables the strategy to be versatile and adapt to various market conditions.
█ Usage
ToolTips: Comprehensive tooltips are provided for each parameter to guide the user through the customization process.
Inputs: Traders can customize numerous parameters including the number of neighbors in KNN, ATR multiplier, and types of moving averages.
Plotting: The strategy also provides visual cues on the chart to indicate bullish or bearish trends.
Order Execution: Based on the generated signals, the strategy will execute buy or sell orders automatically.
█ Default Settings
The default settings are configured to offer a balanced approach suitable for most scenarios:
Initial Capital: $10,000
Default Quantity Type: 10% of equity
Commission: 0.1%
Slippage: 1
Currency: USD
These settings can be modified to suit various trading styles and asset classes.
CandlestickPatternsLibrary   "CandlestickPatterns" 
This library provides a wide range of candlestick patterns, and available for user to call each pattern individually. It's a comprehensive and common tool designed for traders seeking to raise their technical analysis, and it may help users identify key turning of price action in financial instruments. Credit to public technical “*All Candlestick Patterns*” indicator.
 abandonedBaby(order, d1) 
  The "Abandoned Baby" candlestick pattern is a bullish/bearish pattern consists of three candles.
  Parameters:
     order (simple string) : (simple string) Pattern order type "bull" or "bear".
     d1 (simple float) : (simple float)  Previous candle's body percentage out of candle range. Optional argument, default is 5.
 darkCloudCover(c1, n) 
  The "Dark Cloud Cover" is a bearish pattern consists of two candles.
  Parameters:
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 doji(d0) 
  The "Doji" is neither bullish or bearish consists of one candles.
  Parameters:
     d0 (simple float) : (simple float)  Current candle's body percentage out of candle range. Optional argument, default is 5.
 dojiStar(order, c1, n, d0) 
  The "Doji Star" is a bullish/bearish pattern consists of two candles.
  Parameters:
     order (simple string) : (simple string) Pattern order type "bull" or "bear" .
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
     d0 (simple float) : (simple float) Current candle's body percentage out of candle range. Optional argument, default is 5.
 downsideTasukiGap(c2, c1, n) 
  The "Downside Tasuki Gap" is a bearish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool) Before previous candle's body must be higher than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) Previous candle's body must be lower than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 dragonflyDoji(d0) 
  The "Dragon Fly Doji" is a bullish pattern consists of one candle.
  Parameters:
     d0 (simple float) : (simple float)  Current candle's body percentage out of candle range. Optional argument, default is 5.
 engulfing(order, c1, c0, n) 
  The "Engulfing" is a bullish/bearish pattern consists of two candles.
  Parameters:
     order (simple string) : (simple string) Pattern order type "bull" or "bear".
     c1 (simple bool) : (simple bool) Previous candle's body must be lower than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 eveningDojiStar(c2, c0, d1, n) 
  The "Evening Doji Star" is a bearish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool) Before previous candle's body must be higher than average, default is true.
     c0 (simple bool) : (simple bool) Current candle's body must be higher than average. Optional argument, default is true.
     d1 (simple float) : (simple float) Previous candle's body percentage out of candle range. Optional argument, default is 5.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 eveningStar(c2, c1, c0, n) 
  The "Evening Star" is a bearish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool) Before previous candle's body must be higher than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) Previous candle's body must be lower than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 fallingThreeMethods(c4, c3, c2, c1, c0, n) 
  The "Falling Three Methods" is a bearish pattern consists of five candles.
  Parameters:
     c4 (simple bool) : (simple bool) 5th candle ago body must be higher than average. Optional argument, default is true.
     c3 (simple bool) : (simple bool) 4th candle ago body must be lower than average. Optional argument, default is true.
     c2 (simple bool) : (simple bool) 3rd candle ago body must be lower than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) 2nd candle ago body must be lower than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int) Length of average candle's body. Optional argument, default is 14.
  Returns: (bool)
 fallingWindow() 
  The "Falling Window" is a bearish pattern consists of two candles.
 gravestoneDoji(d0) 
  The "Gravestone Doji" is a bearish pattern consists of one candle.
  Parameters:
     d0 (simple float) : (simple float)  Current candle's body percentage out of candle range. Optional argument, default is 5.
 hammer(c0, n) 
  The "Hammer" is a bullish pattern consists of one candle.
  Parameters:
     c0 (simple bool) : (simple bool) Current candle's body must be lower than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 hangingMan(c0, n) 
  The "Hanging Man" is a bearish pattern consists of one candle.
  Parameters:
     c0 (simple bool) : (simple bool) Current candle's body must be lower than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 haramiCross(order, c1, n) 
  The "Harami Cross" candlestick pattern is a bullish/bearish pattern consists of two candles.
  Parameters:
     order (string) : (simple string) Pattern order type "bull" or "bear".
     c1 (simple bool) : (simple bool)   Previous candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)    Length of average candle's body. Optional argument, default is 14.
 harami(order, c1, c0, n) 
  The "Harami" candlestick pattern is a bullish/bearish pattern consists of two candles.
  Parameters:
     order (string) : (simple string) Pattern order type "bull" or "bear"
     c1 (simple bool) : (simple bool)   Previous candle's body must be higher than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool)   Current candle's body must be lower than average. Optional argument, default is true.
     n (simple int) : (simple int)    Length of average candle's body. Optional argument, default is 14.
 invertedHammer(c0, n) 
  The "Inverted Hammer" is a bullish pattern consists of one candle.
  Parameters:
     c0 (simple bool) : (simple bool)   Current candle's body must be lower than average. Optional argument, default is true.
     n (simple int) : (simple int)    Length of average candle's body. Optional argument, default is 14.
 kicking(order, c1, c0, n) 
  The "Kicking" candlestick pattern is a bullish/bearish pattern consists of two candles.
  Parameters:
     order (string) : (simple string) Pattern order type "bull" or "bear"
     c1 (simple bool) : (simple bool)   Previous candle's body must be higher than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool)   Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)    Length of average candle's body. Optional argument, default is 14.
 longLowerShadow(l0) 
  The "Long Lower Shadow" candlestick pattern is a bullish pattern consists of one candles.
  Parameters:
     l0 (simple float) : (simple float)  Current candle's lower wick min percentage out of candle range. Optional argument, default is 75.
 longUpperShadow(u0) 
  The "Long Upper Shadow" candlestick pattern is a bearish pattern consists of one candles.
  Parameters:
     u0 (simple float) : (simple float)  Current candle's upper wick min percentage out of candle range. Optional argument, default is 75.
 marubozuBlack(c0, n) 
  The "Marubozu Black" candlestick pattern is a bearish pattern consists of one candles.
  Parameters:
     c0 (simple bool) : (simple bool)   Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)    Length of average candle's body. Optional argument, default is 14.
 marubozuWhite(c0, n) 
  The "Marubozu White" candlestick pattern is a bullish pattern consists of one candles.
  Parameters:
     c0 (simple bool) : (simple bool)   Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)    Length of average candle's body. Optional argument, default is 14.
 morningDojiStar(c2, d1, c0, n) 
  The "Morning Doji Star" candlestick pattern is a bullish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool)  Before previous candle's body must be higher than average. Optional argument, default is true.
     d1 (simple float) : (simple float) Previous candle's body percentage out of candle range. Optional argument, default is 5.
     c0 (simple bool) : (simple bool)  Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)   Length of average candle's body. Optional argument, default is 14.
 morningStar(c2, c1, c0, n) 
  The "Morning Star" candlestick pattern is a bullish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool) Before previous candle's body must be higher than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) Previous candle's body must be lower than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Cuurent candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 onNeck(c1, c0, n) 
  The "On Neck" candlestick pattern is a bearish pattern consists of two candles.
  Parameters:
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Cuurent candle's body must be lower than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 piercing(c1, n) 
  The "Piercing" candlestick pattern is a bullish pattern consists of two candles.
  Parameters:
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 risingThreeMethods(c4, c3, c2, c1, c0, n) 
  The "Rising Three Methods" candlestick pattern is a bullish pattern consists of five candles.
  Parameters:
     c4 (simple bool) : (simple bool) 5th candle ago body must be higher than average. Optional argument, default is true.
     c3 (simple bool) : (simple bool) 4th candle ago body must be Lower than average. Optional argument, default is true.
     c2 (simple bool) : (simple bool) 3rd candle ago body must be Lower than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) 2nd candle ago body must be Lower than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 risingWindow() 
  The "Rising Window" candlestick pattern is a bullish pattern consists of two candle.
 shootingStar(c0, n) 
  The "Shooting Star" candlestick pattern is a bearish pattern consists of one candle.
  Parameters:
     c0 (simple bool) : (simple bool) Current candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 spinningTopBlack(l0, u0) 
  The "Spinning Top Black" is neither bullish or bearish.
  Parameters:
     l0 (simple float) : (simple float)  Current candle's lower wick min percentage out of candle range. Optional argument, default is 34.
     u0 (simple float) : (simple float)  Current candle's upper wick min percentage out of candle range. Optional argument, default is 34.
 spinningTopWhite(l0, u0) 
  The "Spinning Top White" is neither bullish or bearish.
  Parameters:
     l0 (simple float) : (simple float)  Current candle's lower wick min percentage out of candle range. Optional argument, default is 34.
     u0 (simple float) : (simple float)  Current candle's upper wick min percentage out of candle range. Optional argument, default is 34.
 threeBlackCrows(c2, c1, c0, n) 
  The "Three Black Crows" candlestick pattern is a bearish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool) Before previous candle's body must be higher than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Cuurent candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 threeWhiteSoldiers(c2, c1, c0, n) 
  The "Three White Soldiers" candlestick pattern is a bullish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool) Before previous candle's body must be higher than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     c0 (simple bool) : (simple bool) Cuurent candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 triStar(order, d2, d1, d0) 
  The "Tri Star" candlestick pattern is a bullish/bearish pattern consists of three candles.
  Parameters:
     order (simple string) : (simple string) Pattern order type "bull" or "bear".
     d2 (simple float) : (simple float)  Before previous candle's body percentage out of candle range. Optional argument, default is 5.
     d1 (simple float) : (simple float)  Previous candle's body percentage out of candle range. Optional argument, default is 5.
     d0 (simple float) : (simple float)  Current candle's body percentage out of candle range. Optional argument, default is 5.
 tweezerBottom(c1, n) 
  The "Tweezer Bottom" candlestick pattern is a bullish pattern consists of two candles.
  Parameters:
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 tweezerTop(c1, n) 
  The "Tweezer Top" candlestick pattern is a bearish pattern consists of two candles.
  Parameters:
     c1 (simple bool) : (simple bool) Previous candle's body must be higher than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
 upsideTasukiGap(c2, c1, n) 
  The "Tri Star" candlestick pattern is a bullish pattern consists of three candles.
  Parameters:
     c2 (simple bool) : (simple bool) Before Previous candle's body must be higher than average. Optional argument, default is true.
     c1 (simple bool) : (simple bool) Previous candle's body must be lower than average. Optional argument, default is true.
     n (simple int) : (simple int)  Length of average candle's body. Optional argument, default is 14.
Moving Average Rainbow (Stormer)This strategy is based and shown by trader and investor Alexandre Wolwacz "Stormer".
 Overview 
The strategy uses 12 moving averages (default EMA) to identify trends and generate trading signals opening positions.
Allowing to select the type of moving average and length to be used.
The conditions includes relationship between moving averages, the position of the current price relative to the moving averages, and the occurrence of certain price patterns.
 Calculation 
 
 The mean moving averages is calculated by adding all the 12 moving averages and dividing by 12, the value is used to help to identify trend and possible condition to open position.
 The 12 moving averages is spliced by 3 ranges, initial range (moving average lines 1 to 4), middle range (moving average lines 5 to 8) and end range (moving average lines 9 to 12). These ranges helps to identify potential trend and market turn over.
 The moving average touch price is a relationship between the low price (uptrend) or high price (downtrend) with the moving average lines, it identifies where the price (low/high) has reached the the moving average line. Fetching the value to help for opening position, set stop loss and take profit.
 Since the stop loss is based and set from the previous moving average touch price value, when position is about to be open and setting the stop loss value, there is a verification to check both current and previous moving average touch price to recalculate the stop loss value.
 The turnover trend checks for a possible market turnover event, setting up a new profit target, this setting when enabled is to be helpful when a turnover occurs against the position to exit position with some profit based on highest high price if long or lowest low price if short.
 The turnover signal is similar to turnover trend. The difference is that when this setting is enabled and it triggers, it simply exit the current position and opens up a reverse position, long goes short and short goes long. And there is an complement optional that checks current price exit profitable.
 
 Entry Position 
Long Position:
 
 Price is higher than the mean moving averages. Meaning possible uptrend.
 The lines of the middle range from the moving averages are in increasing order. Meaning possible uptrend.
 The current high  pierced up  previous high.
 Fetch the previous value of the moving average touch price. Meaning the low price has touched one of the moving average lines, which that value is conditioning to open position.
 
Short Position:
 
 Price is lower than the mean moving averages. Meaning possible downtrend.
 The lines of the middle range from the moving averages are in decreasing order. Meaning possible downtrend.
 The current low  pierced down  previous low.
 Fetch the previous value of the moving average touch price. Meaning the high price has touched one of the moving average lines, which that value is conditioning to open position.
 
 Risk Management 
Stop Loss:
 
 The stop loss is based from the previous moving average touch price value, high price for short and low price for long or occurs an verification to check for both current and previous moving average touch price value and a recalculation is done to set the stop loss.
 
Take Profit:
 
 According to the author, the profit target should be at least 1:1.6 the risk, so to have the strategy mathematically positive.
 The profit target is configured input, can be increased or decreased.
 It calculates the take profit based on the price of the stop loss with the profit target input.
 
 Turnover Trend 
Long Position:
 
 The moving averages initial range lines signals a possible market turnover. Meaning long might be going short.
 Fetches the highest high hit since the opening of the position, setting that value to the new profit target.
 
Short Position:
 
 The moving averages initial range lines signals a possible market turnover. Meaning short might be going long.
 Fetches the lowest low hit since the opening of the position, setting that value to the new profit target.






















