Ty's Magic Volatility SwitchLow volatility = weak and unreliable signals.
Only enter trades when volatility is above the threshold.
Happy trading. 8]
Forecasting
First 5-Minute High, Mid, Low with Custom Range BacktestFirst 5-Minute High, Mid, Low with Custom Range Backtest
BTCUSD-USDT momentum indicatorIt is a script that compares the price of BTC-USD, and BTC-USDT. Recently did a back test combined with RSI crossing signal lined and had promising results dec. 1 2023- dec 8 2024
Bitcoin Risk IndicatorBased on Ben Cowen's Risk Indicator - only works on BTC, weekly timeframe
Both of the series represent risk, the red line is scaled according to the regression trend line such that the peak risk is 1.
normalised risk is transposed by -1 so as not to overlap the EMA ratio plot
Estrategia EMA 50 y 100 _ANDO Cálculo de EMAs :
Nós o usamos ta.ema()para calcular as EMAs de 50 e 100 períodos.
Condições de Compra e Venda :
ta.crossover(ema50, ema100): Gera um sinal de compra quando a EMA 50 cruza a EMA 100 para cima.
ta.crossunder(ema50, ema100): Gera um sinal de venda quando a EMA 50 cruza a EMA 100 para baixo.
Sinais Visuais :
plotshape()Desenhe rótulos no gráfico indicando pontos de compra e venda.
Cruzamento de Médias Móveis com Filtragem de RSI e MACD_ANDO LER:
Filtro baseado no RSI de sobrecompra e sobrevenda.
A compra é permitida apenas quando o RSI não está sobrecomprado.
A venda é permitida apenas quando o RSI não está sobrevendido.
MACD:
Filtro baseado em não cruzar a linha MACD com a linha de sinal.
Compra permitida somente quando a linha MACD estiver acima da linha de sinal.
A venda é permitida somente quando a linha MACD está abaixo da linha de sinal.
Condições Combinadas:
O filtro RSI e MACD pode ser ativado ou desativado através das entradas ( use_rsi_filtere use_macd_filter).
Como condições de compra/venda verificamos os filtros selecionados.
Saídas Automáticas:
Configurado com Take Profit e Stop Loss em porcentagens ajustáveis.
Laguerre RSI + ADX + RSI + MACD Combothis indicatore only helps the manipulation for the crypto compare with volume and you will understand
Combined MA + Trend Channel Features:
MA Sabres: Plots MA ribbons and reversal signals with configurable settings.
Trend Continuation Signals: Adds trend detection with volatility bands and continuation signals.
Custom Alerts: Alerts for both bullish and bearish signals.
Colors and Visualization: Maintains distinct colors for uptrend, downtrend, and neutral trends for clarity.
Murad Picks Target MCThe Murad Picks Target Market Cap Indicator is a custom TradingView tool designed for crypto traders and enthusiasts tracking tokens in the Murad Picks list. This indicator dynamically calculates and visualizes the price targets based on Murad Mahmudov's projected market capitalizations, allowing you to gauge each token's growth potential directly on your charts.
Indicator support tokens:
- SPX6900
- GIGA
- MOG
- POPCAT
- APU
- BITCOIN
- RETARDIO
- LOCKIN
Key Features :
Dynamic Target Price Lines:
- Displays horizontal lines representing the price when the token reaches its projected market cap.
- Automatically adjusts for the active chart symbol (e.g., SPX, MOG, APU, etc.).
X Multiplier Calculation:
- Shows how many times the current price must multiply to achieve the target price.
- Perfect for understanding relative growth potential.
Customizable Inputs:
- Easily update target market caps and circulating supply for each token.
- Adjust visuals such as line colors and styles.
Seamless Integration:
- Automatically adapts to the token you’re viewing (e.g., SPX, MOG, APU).
- Clean and visually intuitive, with labels marking targets.
FuTech : Earnings (All 269 Fundamental Metrics of Tradingview)FuTech : Earnings Indicator
The FuTech : Earnings Indicator is a revolutionary tool, offering the most comprehensive integration of all 269 fundamental financial metrics available from the TradingView platform.
This groundbreaking indicator is designed to empower financial researchers, traders, investors, and analysts with an unmatched depth of data, enabling superior analysis and decision-making.
Overview
"FuTech : Earnings Indicator" is the first-ever indicator to provide a holistic comparison of fundamental financial metrics for any stock, covering quarterly, yearly, and trailing twelve months (TTM) periods.
This tool brings together key financial data from income statements, balance sheets, cash flows, and other critical metrics found in company annual reports.
It also incorporates additional unique features like per-employee data, R&D expenses, and capital expenditures (CapEx), which are typically hidden within dense financial statements of Annual Reports.
---
Key Features and Capabilities
1. Comprehensive Financial Metrics
- "FuTech : Earnings Indicator" offers access to all 269 fundamental metrics available on TradingView platform. This includes widely used data such as revenue, profit margins, and EPS, alongside more niche metrics like R&D expenditure, employee efficiency, and financial scores developed by renowned analysts.
- Users can explore income statement data (e.g., net income, gross profit), balance sheet items (e.g., total assets, liabilities), cash flow metrics, and other financial statistics such as Altman Score, per employee expenses etc. in unparalleled detail.
2. Comparison Across Time Periods
- "FuTech : Earnings Indicator" allows users to analyze data for:
- Quarterly periods (e.g., Q1, Q2, Q3, Q4).
- Yearly comparisons for a broad historical view.
- TTM analysis to observe the most recent trends and developments.
- Users can select a minimum of 4 periods up to an unlimited range for detailed comparisons in both quarter.
3. Dynamic Data Display
- Users can select up to 5 key metrics alongside the stock price column to focus their analysis on the most relevant data points.
- Highlighting with green and red symbols offers an intuitive and visual representation:
- Green : Positive trends or improvements.
- Red : Negative trends or deteriorations.
4. Automated Averages
- "FuTech : Earnings Indicator" automatically calculates averages of selected metrics across the chosen periods. This feature helps users quickly identify performance trends and smooth out anomalies, enabling faster and more reliable research.
5. Designed for Research Excellence
- FuTech serves a wide audience, including:
- Corporate finance professionals who need a deep dive into financial metrics.
- Individual investors seeking robust tools for investment analysis.
- Broking companies and equity research analysts performing stock analysis.
- Traders looking to incorporate fundamental metrics into their strategies.
- Technical analysts seeking a better understanding of price behavior in relation to fundamentals.
- Fundamental research aspirants who want an edge in their learning process.
6. Unmatched Detail for Deeper Insights
- By pulling all 269 Financial metrics from the TradingView, "FuTech : Earnings Indicator" enables:
- Cross-comparison of a stock’s performance with its historical benchmarks.
- Evaluation of rare data like R&D expenses, CapEx trends, and employee efficiency ratios for enhanced investment insights.
- This ensures users can study stocks in greater depth than ever before.
7. Enhanced Usability
- Simple to use and visually appealing, "FuTech : Earnings Indicator" is designed with researchers in mind.
- Its intuitive interface ensures even novice users can navigate the wealth of data without feeling overwhelmed.
Applications of FuTech : Earnings Indicator
FuTech : Earnings Indicator is incredibly versatile and has applications in diverse fields of financial research and trading:
1. Corporate Finance
- Professionals in corporate finance can leverage "FuTech : Earnings Indicator" to benchmark company performance, study efficiency ratios, and evaluate financial health across various metrics.
2. Investors and Traders
- Long-term investors can use the tool to study the fundamental strengths of a stock before making buy-and-hold decisions.
- Traders can incorporate "FuTech : Earnings Indicator" into their analysis to align comprehensive fundamental trends with their targeted technical signals.
3. Equity Research Analysts
- Analysts can streamline their workflows by quickly identifying trends, outliers, and averages across large datasets.
4. Education and Research
- "FuTech : Earnings Indicator" is ideal for students and aspiring financial analysts who want a practical tool for understanding real-world data.
How FuTech : Earnings Indicator Stands Out
1. First-Ever Integration of All Financial Metrics
- It's an exclusive tool which offers the ability to explore all 269 financial metrics available on TradingView for a single stock research in-depth for quarters, years or TTM periods.
2. Period Customization
- Users have complete flexibility to select and analyze data across any range of time periods, allowing for customized insights tailored to specific research goals.
3. Data Visualization
- The intuitive use of color-coded symbols (green for positive trends, red for negative) makes complex data easy to interpret at a glance.
4. Actionable Insights
- The automated average calculations provide actionable insights for making informed decisions without manual computations.
5. Unique Metrics
- Metrics such as research and development costs, CapEx, and per-employee efficiency data offer unique angles that aren’t typically available in traditional analysis tools.
Why to Use FuTech : Earnings Indicator ?
1. Boost Your Research Power
- With FuTech, you can unlock a world of data that gives you the edge in analyzing stocks. Whether you’re a seasoned analyst or a beginner, this tool offers something for everyone.
2. Save Time and Effort
- The automated features and intuitive interface eliminate the need for time-consuming manual calculations and formatting.
3. Make Better Decisions
- "FuTech : Earnings Indicator's" detailed comparison capabilities and insightful visual aids allow for more accurate assessments of a stock’s performance and potential.
4. Broad Appeal
- From individual investors to financial institutions, FuTech is a valuable tool for anyone in the world of finance.
---
Conclusion
- The FuTech : Earnings Indicator is a must-have for anyone serious about financial analysis.
- It combines the depth of all 269 fundamental metrics with intuitive tools for comparison, visualization, and calculation.
- Designed for ease of use and powerful insights, FuTech : Earnings Indicator is set to transform the way financial data is analyzed and understood.
Thank you !
Boost, Share, Follow, and Enjoy with FuTech!
Jai Swaminarayan Dasna Das !
He Hari ! Bas Ek Tu Raji Tha !
Kalman PredictorThe **Kalman Predictor** indicator is a powerful tool designed for traders looking to enhance their market analysis by smoothing price data and projecting future price movements. This script implements a Kalman filter, a statistical method for noise reduction, to dynamically estimate price trends and velocity. Combined with ATR-based confidence bands, it provides actionable insights into potential price movement, while offering clear trend and momentum visualization.
---
#### **Key Features**:
1. **Kalman Filter Smoothing**:
- Dynamically estimates the current price state and velocity to filter out market noise.
- Projects three future price levels (`Next Bar`, `Next +2`, `Next +3`) based on velocity.
2. **Dynamic Confidence Bands**:
- Confidence bands are calculated using ATR (Average True Range) to reflect market volatility.
- Visualizes potential price deviation from projected levels.
3. **Trend Visualization**:
- Color-coded prediction dots:
- **Green**: Indicates an upward trend (positive velocity).
- **Red**: Indicates a downward trend (negative velocity).
- Dynamically updated label displaying the current trend and velocity value.
4. **User Customization**:
- Inputs to adjust the process and measurement noise for the Kalman filter (`q` and `r`).
- Configurable ATR multiplier for confidence bands.
- Toggleable trend label with adjustable positioning.
---
#### **How It Works**:
1. **Kalman Filter Core**:
- The Kalman filter continuously updates the estimated price state and velocity based on real-time price changes.
- Projections are based on the current price trend (velocity) and extend into the future (Next Bar, +2, +3).
2. **Confidence Bands**:
- Calculated using ATR to provide a dynamic range around the projected future prices.
- Indicates potential volatility and helps traders assess risk-reward scenarios.
3. **Trend Label**:
- Updates dynamically on the last bar to show:
- Current trend direction (Up/Down).
- Velocity value, providing insight into the expected magnitude of the price movement.
---
#### **How to Use**:
- **Trend Analysis**:
- Observe the direction and spacing of the prediction dots relative to current candles.
- Larger spacing indicates a potential strong move, while clustering suggests consolidation.
- **Risk Management**:
- Use the confidence bands to gauge potential price volatility and set stop-loss or take-profit levels accordingly.
- **Pullback Detection**:
- Look for flattening or clustering of dots during trends as a signal of potential pullbacks or reversals.
---
#### **Customizable Inputs**:
- **Kalman Filter Parameters**:
- `lookback`: Adjusts the smoothing window.
- `q`: Process noise (higher values make the filter more reactive to changes).
- `r`: Measurement noise (controls sensitivity to price deviations).
- **Confidence Bands**:
- `band_multiplier`: Multiplies ATR to define the range of confidence bands.
- **Visualization**:
- `show_label`: Option to toggle the trend label.
- `label_offset`: Adjusts the label’s distance from the price for better visibility.
---
#### **Examples of Use**:
- **Scalping**: Use on lower timeframes (e.g., 1-minute, 5-minute) to detect short-term price trends and reversals.
- **Swing Trading**: Identify pullbacks or continuations on higher timeframes (e.g., 4-hour, daily) by observing the prediction dots and confidence bands.
- **Risk Assessment**: Confidence bands help visualize potential price volatility, aiding in the placement of stops and targets.
---
#### **Notes for Traders**:
- The **Kalman Predictor** does not predict the future with certainty but provides a statistically informed estimate of price movement.
- Confidence bands are based on historical volatility and should be used as guidelines, not guarantees.
- Always combine this tool with other analysis techniques for optimal results.
---
This script is open-source, and the Kalman filter logic has been implemented uniquely to integrate noise reduction with dynamic confidence band visualization. If you find this indicator useful, feel free to share your feedback and experiences!
---
#### **Credits**:
This script was developed leveraging the statistical principles of Kalman filtering and is entirely original. It incorporates ATR for dynamic confidence band calculations to enhance trader usability and market adaptability.
SMT Divergence ICT 01 [TradingFinder] Smart Money Technique🔵 Introduction
SMT Divergence (short for Smart Money Technique Divergence) is a trading technique in the ICT Concepts methodology that focuses on identifying divergences between two positively correlated assets in financial markets.
These divergences occur when two assets that should move in the same direction move in opposite directions. Identifying these divergences can help traders spot potential reversal points and trend changes.
Bullish and Bearish divergences are clearly visible when an asset forms a new high or low, and the correlated asset fails to do so. This technique is applicable in markets like Forex, stocks, and cryptocurrencies, and can be used as a valid signal for deciding when to enter or exit trades.
Bullish SMT Divergence : This type of divergence occurs when one asset forms a higher low while the correlated asset forms a lower low. This divergence is typically a sign of weakness in the downtrend and can act as a signal for a trend reversal to the upside.
Bearish SMT Divergence : This type of divergence occurs when one asset forms a higher high while the correlated asset forms a lower high. This divergence usually indicates weakness in the uptrend and can act as a signal for a trend reversal to the downside.
🔵 How to Use
SMT Divergence is an analytical technique that identifies divergences between two correlated assets in financial markets.
This technique is used when two assets that should move in the same direction move in opposite directions.
Identifying these divergences can help you pinpoint reversal points and trend changes in the market.
🟣 Bullish SMT Divergence
This divergence occurs when one asset forms a higher low while the correlated asset forms a lower low. This divergence indicates weakness in the downtrend and can signal a potential price reversal to the upside.
In this case, when the correlated asset is forming a lower low, and the main asset is moving lower but the correlated asset fails to continue the downward trend, there is a high probability of a trend reversal to the upside.
🟣 Bearish SMT Divergence
Bearish divergence occurs when one asset forms a higher high while the correlated asset forms a lower high. This type of divergence indicates weakness in the uptrend and can signal a potential trend reversal to the downside.
When the correlated asset fails to make a new high, this divergence may be a sign of a trend reversal to the downside.
🟣 Confirming Signals with Correlation
To improve the accuracy of the signals, use assets with strong correlation. Forex pairs like OANDA:EURUSD and OANDA:GBPUSD , or cryptocurrencies like COINBASE:BTCUSD and COINBASE:ETHUSD , or commodities such as gold ( FX:XAUUSD ) and silver ( FX:XAGUSD ) typically have significant correlation. Identifying divergences between these assets can provide a strong signal for a trend change.
🔵 Settings
Second Symbol : This setting allows you to select another asset for comparison with the primary asset. By default, "XAUUSD" (Gold) is set as the second symbol, but you can change it to any currency pair, stock, or cryptocurrency. For example, you can choose currency pairs like EUR/USD or GBP/USD to identify divergences between these two assets.
Divergence Fractal Periods : This parameter defines the number of past candles to consider when identifying divergences. The default value is 2, but you can change it to suit your preferences. This setting allows you to detect divergences more accurately by selecting a greater number of candles.
Bullish Divergence Line : Displays a line showing bullish divergence from the lows.
Bearish Divergence Line : Displays a line showing bearish divergence from the highs.
Bullish Divergence Label : Displays the "+SMT" label for bullish divergences.
Bearish Divergence Label : Displays the "-SMT" label for bearish divergences.
🔵 Conclusion
SMT Divergence is an effective tool for identifying trend changes and reversal points in financial markets based on identifying divergences between two correlated assets. This technique helps traders receive more accurate signals for market entry and exit by analyzing bullish and bearish divergences.
Identifying these divergences can provide opportunities to capitalize on trend changes in Forex, stocks, and cryptocurrency markets. Using SMT Divergence along with risk management and confirming signals with other technical analysis tools can improve the accuracy of trading decisions and reduce risks from sudden market changes.
M2 Money Shift for Bitcoin [SAKANE]M2 Money Shift for Bitcoin was developed to visualize the impact of M2 Money, a macroeconomic indicator, on the Bitcoin market and to support trade analysis.
Bitcoin price fluctuations have a certain correlation with cycles in M2 money supply.In particular, it has been noted that changes in M2 supply can affect the bitcoin price 70 days in advance.Very high correlations have been observed in recent years in particular, making it useful as a supplemental analytical tool for trading.
Support for M2 data from multiple countries
M2 supply data from the U.S., Europe, China, Japan, the U.K., Canada, Australia, and India are integrated and all are displayed in U.S. dollar equivalents.
Slide function
Using the "Slide Days Forward" setting, M2 data can be slid up to 500 days, allowing for flexible analysis that takes into account the time difference from the bitcoin price.
Plotting Total Liquidity
Plot total liquidity (in trillions of dollars) by summing the M2 supply of multiple countries.
How to use
After applying the indicator to the chart, activate the M2 data for the required country from the settings screen. 2.
2. adjust "Slide Days Forward" to analyze the relationship between changes in M2 supply and bitcoin price
3. refer to the Gross Liquidity plot to build a trading strategy that takes into account macroeconomic influences.
Notes.
This indicator is an auxiliary tool for trade analysis and does not guarantee future price trends.
The relationship between M2 supply and bitcoin price depends on many factors and should be used in conjunction with other analysis methods.
Simple Decesion Matrix Classification Algorithm [SS]Hello everyone,
It has been a while since I posted an indicator, so thought I would share this project I did for fun.
This indicator is an attempt to develop a pseudo Random Forest classification decision matrix model for Pinescript.
This is not a full, robust Random Forest model by any stretch of the imagination, but it is a good way to showcase how decision matrices can be applied to trading and within Pinescript.
As to not market this as something it is not, I am simply calling it the "Simple Decision Matrix Classification Algorithm". However, I have stolen most of the aspects of this machine learning algo from concepts of Random Forest modelling.
How it works:
With models like Support Vector Machines (SVM), Random Forest (RF) and Gradient Boosted Machine Learning (GBM), which are commonly used in Machine Learning Classification Tasks (MLCTs), this model operates similarity to the basic concepts shared amongst those modelling types. While it is not very similar to SVM, it is very similar to RF and GBM, in that it uses a "voting" system.
What do I mean by voting system?
How most classification MLAs work is by feeding an input dataset to an algorithm. The algorithm sorts this data, categorizes it, then introduces something called a confusion matrix (essentially sorting the data in no apparently order as to prevent over-fitting and introduce "confusion" to the algorithm to ensure that it is not just following a trend).
From there, the data is called upon based on current data inputs (so say we are using RSI and Z-Score, the current RSI and Z-Score is compared against other RSI's and Z-Scores that the model has saved). The model will process this information and each "tree" or "node" will vote. Then a cumulative overall vote is casted.
How does this MLA work?
This model accepts 2 independent variables. In order to keep things simple, this model was kept as a three node model. This means that there are 3 separate votes that go in to get the result. A vote is casted for each of the two independent variables and then a cumulative vote is casted for the overall verdict (the result of the model's prediction).
The model actually displays this system diagrammatically and it will likely be easier to understand if we look at the diagram to ground the example:
In the diagram, at the very top we have the classification variable that we are trying to predict. In this case, we are trying to predict whether there will be a breakout/breakdown outside of the normal ATR range (this is either yes or no question, hence a classification task).
So the question forms the basis of the input. The model will track at which points the ATR range is exceeded to the upside or downside, as well as the other variables that we wish to use to predict these exceedences. The ATR range forms the basis of all the data flowing into the model.
Then, at the second level, you will see we are using Z-Score and RSI to predict these breaks. The circle will change colour according to "feature importance". Feature importance basically just means that the indicator has a strong impact on the outcome. The stronger the importance, the more green it will be, the weaker, the more red it will be.
We can see both RSI and Z-Score are green and thus we can say they are strong options for predicting a breakout/breakdown.
So then we move down to the actual voting mechanisms. You will see the 2 pink boxes. These are the first lines of voting. What is happening here is the model is identifying the instances that are most similar and whether the classification task we have assigned (remember out ATR exceedance classifier) was either true or false based on RSI and Z-Score.
These are our 2 nodes. They both cast an individual vote. You will see in this case, both cast a vote of 1. The options are either 1 or 0. A vote of 1 means "Yes" or "Breakout likely".
However, this is not the only voting the model does. The model does one final vote based on the 2 votes. This is shown in the purple box. We can see the final vote and result at the end with the orange circle. It is 1 which means a range exceedance is anticipated and the most likely outcome.
The Data Table Component
The model has many moving parts. I have tried to represent the pivotal functions diagrammatically, but some other important aspects and background information must be obtained from the companion data table.
If we bring back our diagram from above:
We can see the data table to the left.
The data table contains 2 sections, one for each independent variable. In this case, our independent variables are RSI and Z-Score.
The data table will provide you with specifics about the independent variables, as well as about the model accuracy and outcome.
If we take a look at the first row, it simply indicates which independent variable it is looking at. If we go down to the next row where it reads "Weighted Impact", we can see a corresponding percent. The "weighted impact" is the amount of representation each independent variable has within the voting scheme. So in this case, we can see its pretty equal, 45% and 55%, This tells us that there is a slight higher representation of z-score than RSI but nothing to worry about.
If there was a major over-respresentation of greater than 30 or 40%, then the model would risk being skewed and voting too heavily in favour of 1 variable over the other.
If we move down from there we will see the next row reads "independent accuracy". The voting of each independent variable's accuracy is considered separately. This is one way we can determine feature importance, by seeing how well one feature augments the accuracy. In this case, we can see that RSI has the greatest importance, with an accuracy of around 87% at predicting breakouts. That makes sense as RSI is a momentum based oscillator.
Then if we move down one more, we will see what each independent feature (node) has voted for. In this case, both RSI and Z-Score voted for 1 (Breakout in our case).
You can weigh these in collaboration, but its always important to look at the final verdict of the model, which if we move down, we can see the "Model prediction" which is "Bullish".
If you are using the ATR breakout, the model cannot distinguish between "Bullish" or "Bearish", must that a "Breakout" is likely, either bearish or bullish. However, for the other classification tasks this model can do, the results are either Bullish or Bearish.
Using the Function:
Okay so now that all that technical stuff is out of the way, let's get into using the function. First of all this function innately provides you with 3 possible classification tasks. These include:
1. Predicting Red or Green Candle
2. Predicting Bullish / Bearish ATR
3. Predicting a Breakout from the ATR range
The possible independent variables include:
1. Stochastics,
2. MFI,
3. RSI,
4. Z-Score,
5. EMAs,
6. SMAs,
7. Volume
The model can only accept 2 independent variables, to operate within the computation time limits for pine execution.
Let's quickly go over what the numbers in the diagram mean:
The numbers being pointed at with the yellow arrows represent the cases the model is sorting and voting on. These are the most identical cases and are serving as the voting foundation for the model.
The numbers being pointed at with the pink candle is the voting results.
Extrapolating the functions (For Pine Developers:
So this is more of a feature application, so feel free to customize it to your liking and add additional inputs. But here are some key important considerations if you wish to apply this within your own code:
1. This is a BINARY classification task. The prediction must either be 0 or 1.
2. The function consists of 3 separate functions, the 2 first functions serve to build the confusion matrix and then the final "random_forest" function serves to perform the computations. You will need all 3 functions for implementation.
3. The model can only accept 2 independent variables.
I believe that is the function. Hopefully this wasn't too confusing, it is very statsy, but its a fun function for me! I use Random Forest excessively in R and always like to try to convert R things to Pinescript.
Hope you enjoy!
Safe trades everyone!
Weekly Bullish Pattern DetectorThis script is a TradingView Pine Script designed to detect a specific bullish candlestick pattern on the weekly chart. Below is a detailed breakdown of its components:
1. Purpose
The script identifies a four-candle bullish pattern where:
The first candle is a long green (bullish) candlestick.
The second and third candles are small-bodied candles, signifying consolidation or indecision.
The fourth candle is another long green (bullish) candlestick.
When this pattern is detected, the script:
Marks the chart with a visual label.
Optionally triggers an alert to notify the trader.
2. Key Features
Overlay on Chart:
indicator("Weekly Bullish Pattern Detector", overlay=true) ensures the indicator draws directly on the price chart.
Customizable Inputs:
length (Body Size Threshold):
Defines the minimum percentage of the total range that qualifies as a "long" candle body (default: 14%).
smallCandleThreshold (Small Candle Body Threshold):
Defines the maximum percentage of the total range that qualifies as a "small" candle body (default: 10%).
Candlestick Property Calculations:
bodySize: Measures the absolute size of the candle body (close - open).
totalRange: Measures the total high-to-low range of the candle.
bodyPercentage: Calculates the proportion of the body size relative to the total range ((bodySize / totalRange) * 100).
isGreen and isRed: Identify bullish (green) or bearish (red) candles based on their open and close prices.
Pattern Conditions:
longGreenCandle:
Checks if the candle is bullish (isGreen) and its body percentage exceeds the defined length threshold.
smallCandle:
Identifies small-bodied candles where the body percentage is below the smallCandleThreshold.
consolidation:
Confirms the second and third candles are both small-bodied (smallCandle and smallCandle ).
Bullish Pattern Detection:
bullishPattern:
Detects the full four-candle sequence:
The first candle (longGreenCandle ) is a long green candle.
The second and third candles (consolidation) are small-bodied.
The fourth candle (longGreenCandle) is another long green candle.
Visualization:
plotshape(bullishPattern):
Draws a green label ("Pattern") below the price chart whenever the pattern is detected.
Alert Notification:
alertcondition(bullishPattern):
Sends an alert with the message "Bullish Pattern Detected on Weekly Chart" whenever the pattern is found.
3. How It Works
Evaluates Candle Properties:
For each weekly candle, the script calculates its size, range, and body percentage.
Identifies Each Component of the Pattern:
Checks for a long green candle (first and fourth).
Verifies the presence of two small-bodied candles (second and third).
Detects and Marks the Pattern:
Confirms the sequence and marks the chart with a label if the pattern is complete.
Sends Alerts:
Notifies the trader when the pattern is detected.
4. Use Cases
This script is ideal for:
Swing Traders:
Spotting weekly patterns that indicate potential bullish continuations.
Breakout Traders:
Identifying consolidation zones followed by upward momentum.
Pattern Recognition:
Automatically detecting a commonly used bullish formation.
5. Key Considerations
Timeframe: Works best on weekly charts.
Customization: The thresholds for "long" and "small" candles can be adjusted to suit different markets or volatility levels.
Limitations:
It doesn't confirm the pattern's success; further analysis (e.g., volume, support/resistance levels) may be required for validation
ATR% Multiple from Key Moving AverageThis script gives signal when the ATR% multiple from any chosen moving average is beyond the configurable threshold value. This indicator quantifies how extended the stock is from a given key moving average.
A lot of traders use ATR% multiple from 10DMA, 21EMA, 50SMA or 200SMA to determine how extended a stock is and accordingly sell partials or exit. By default the indicator takes 50SMA and when the ATR% multiple is greater than 7 then it gives the signal to take partials. You can back test this indicator with previous trades and determine the ideal threshold for the signal. For small and midcaps a threshold of 7 to 10 ATR% multiples from 50SMA is where partials can be taken while large caps can revert to mean even earlier at 3 to 5 ATR% multiples from 50SMA.
You can modify this script and use it anyway you please as long as you make it opensource on TradingView.
Hybrid Triple Exponential Smoothing🙏🏻 TV, I present you HTES aka Hybrid Triple Exponential Smoothing, designed by Holt & Winters in the US, assembled by me in Saint P. I apply exponential smoothing individually to the data itself, then to residuals from the fitted values, and lastly to one-point forecast (OPF) errors, hence 'hybrid'. At the same time, the method is a closed-form solution and purely online, no need to make any recalculations & optimize anything, so the method is O(1).
^^ historical OPFs and one-point forecasting interval plotted instead of fitted values and prediction interval
Before the How-to, first let me tell you some non-obvious things about Triple Exponential smoothing (and about Exponential Smoothing in general) that not many catch. Expo smoothing seems very straightforward and obvious, but if you look deeper...
1) The whole point of exponential smoothing is its incremental/online nature, and its O(1) algorithm complexity, making it dope for high-frequency streaming data that is also univariate and has no weights. Consequently:
- Any hybrid models that involve expo smoothing and any type of ML models like gradient boosting applied to residuals rarely make much sense business-wise: if you have resources to boost the residuals, you prolly have resources to use something instead of expo smoothing;
- It also concerns the fashion of using optimizers to pick smoothing parameters; honestly, if you use this approach, you have to retrain on each datapoint, which is crazy in a streaming context. If you're not in a streaming context, why expo smoothing? What makes more sense is either picking smoothing parameters once, guided by exogenous info, or using dynamic ones calculated in a minimalistic and elegant way (more on that in further drops).
2) No matter how 'right' you choose the smoothing parameters, all the resulting components (level, trend, seasonal) are not pure; each of them contains a bit of info from the other components, this is just how non-sequential expo smoothing works. You gotta know this if you wanna use expo smoothing to decompose your time series into separate components. The only pure component there, lol, is the residuals;
3) Given what I've just said, treating the level (that does contain trend and seasonal components partially) as the resulting fit is a mistake. The resulting fit is level (l) + trend (b) + seasonal (s). And from this fit, you calculate residuals;
4) The residuals component is not some kind of bad thing; it is simply the component that contains info you consciously decide not to include in your model for whatever reason;
5) Forecasting Errors and Residuals from fitted values are 2 different things. The former are deltas between the forecasts you've made and actual values you've observed, the latter are simply differences between actual datapoints and in-sample fitted values;
6) Residuals are used for in-sample prediction intervals, errors for out-of-sample forecasting intervals;
7) Choosing between single, double, or triple expo smoothing should not be based exclusively on the nature of your data, but on what you need to do as well. For example:
- If you have trending seasonal data and you wanna do forecasting exclusively within the expo smoothing framework, then yes, you need Triple Exponential Smoothing;
- If you wanna use prediction intervals for generating trend-trading signals and you disregard seasonality, then you need single (simple) expo smoothing, even on trending data. Otherwise, the trend component will be included in your model's fitted values → prediction intervals.
8) Kind of not non-obvious, but when you put one smoothing parameter to zero, you basically disregard this component. E.g., in triple expo smoothing, when you put gamma and beta to zero, you basically end up with single exponential smoothing.
^^ data smoothing, beta and gamma zeroed out, forecasting steps = 0
About the implementation
* I use a simple power transform that results in a log transform with lambda = 0 instead of the mainstream-used transformers (if you put lambda on 2 in Box-Cox, you won't get a power of 2 transform)
* Separate set of smoothing parameters for data, residuals, and errors smoothing
* Separate band multipliers for residuals and errors
* Both typical error and typical residuals get multiplied by math.sqrt(math.pi / 2) in order to approach standard deviation so you can ~use Z values and get more or less corresponding probabilities
* In script settings → style, you can switch on/off plotting of many things that get calculated internally:
- You can visualize separate components (just remember they are not pure);
- You can switch off fit and switch on OPF plotting;
- You can plot residuals and their exponentially smoothed typical value to pick the smoothing parameters for both data and residuals;
- Or you might plot errors and play with data smoothing parameters to minimize them (consult SAE aka Sum of Absolute Errors plot);
^^ nuff said
More ideas on how to use the thing
1) Use Double Exponential Smoothing (data gamma = 0) to detrend your time series for further processing (Fourier likes at least weakly stationary data);
2) Put single expo smoothing on your strategy/subaccount equity chart (data alpha = data beta = 0), set prediction interval deviation multiplier to 1, run your strat live on simulator, start executing on real market when equity on simulator hits upper deviation (prediction interval), stop trading if equity hits lower deviation on simulator. Basically, let the strat always run on simulator, but send real orders to a real market when the strat is successful on your simulator;
3) Set up the model to minimize one-point forecasting errors, put error forecasting steps to 1, now you're doing nowcasting;
4) Forecast noisy trending sine waves for fun.
^^ nuff said 2
All Good TV ∞
Asset MaxGain MinLoss Tracker [CHE]Asset MaxGain MinLoss Tracker – Your Tool to Discover the Best Trading Opportunities
Introduction
Hello dear traders,
Today, I'd like to introduce you to a fantastic tool: the Asset MaxGain MinLoss Tracker . This indicator is designed to help you identify the best trading opportunities in the market by analyzing the maximum gain and adjusted maximum loss potentials of various assets.
Why Use This Indicator?
1. Time-Saving Analysis
Instead of spending hours sifting through different charts, this indicator provides you with key metrics for up to 10 assets at a glance.
2. Compare Multiple Assets Simultaneously
Monitor and compare multiple assets to discover which ones offer the highest profit potential and the lowest risk of loss.
3. Customizable Settings
Adjust the observation period and select the assets you want to analyze according to your trading strategy.
4. Clear Visual Representation
Data is presented in an easy-to-read table directly on your chart, highlighting assets with the highest maximum gain and the lowest adjusted maximum loss.
How to Use It in Everyday Trading
Step 1: Setting Up the Indicator
Select Your Assets: Choose up to 10 assets you wish to track. These can be cryptocurrencies, stocks, forex pairs, etc.
Configure the Trading Period Length: Set the number of bars (candles) over which you want to calculate the maximum gain and adjusted maximum loss. This allows you to tailor the analysis to your preferred time frame, whether it's short-term trading or long-term investing.
Step 2: Interpreting the Results
Maximum Gain (%): This value shows the potential upside of each asset over the selected period. A higher percentage indicates a greater potential for profit if the asset's price moves upward.
Adjusted Maximum Loss (%): This figure represents the potential downside risk, adjusted to give a more accurate reflection of loss potential. A lower percentage means less risk of significant loss.
Category Highlighting: Assets are categorized based on their performance:
High Gain & Low Loss: Assets that have both the highest max gain and the lowest adjusted max loss.
High Gain: Assets with the highest max gain.
Low Loss: Assets with the lowest adjusted max loss.
Step 3: Making Trading Decisions
Identify Opportunities: Focus on assets categorized as High Gain & Low Loss for the most favorable risk-to-reward scenarios.
Risk Management: Use the adjusted maximum loss to assess and mitigate potential risks associated with each asset.
Portfolio Diversification: Allocate your investments across assets with varying levels of gain and loss potentials to diversify your portfolio effectively.
Practical Example
Imagine you're monitoring the following assets:
Asset 1: BTCUSD
Asset 2: ETHUSD
Asset 3: ADAUSD
Asset 4: XRPUSD
After applying the indicator:
BTCUSD shows a high maximum gain but also a high adjusted maximum loss.
ETHUSD has both a high maximum gain and a low adjusted maximum loss, categorizing it as High Gain & Low Loss.
ADAUSD indicates a low maximum gain but the lowest adjusted maximum loss.
XRPUSD reflects moderate values in both categories.
Decision Making:
Primary Focus: ETHUSD may be your top choice due to its high reward and lower risk.
Risk-Averse Option: ADAUSD could be considered if you prioritize minimizing losses.
Balanced Approach: Diversify by investing in both ETHUSD and ADAUSD.
Understanding the Core Functionality
While you don't need to delve deep into the code to use the indicator effectively, understanding its core function can enhance your confidence in the tool.
The Main Function: Calculating Max Gain and Adjusted Max Loss
The heart of the indicator is a function that calculates two critical metrics for each asset:
Maximum Gain (sym_MaxGain):
Purpose: Measures the highest potential profit over the selected period.
How It Works: It finds the lowest price (sym_minlow) within the period and calculates the percentage increase to the current high price. This shows how much you could have gained if you bought at the lowest point.
Adjusted Maximum Loss (sym_AdjustedMaxLoss):
Purpose: Provides an adjusted measure of the potential loss, giving a more realistic risk assessment.
How It Works: It identifies the highest price (sym_maxhigh) within the period and calculates the percentage decrease to the current low price. This value is adjusted to account for the diminishing impact as losses approach 100%.
Simplified Explanation of the Function
Data Retrieval: For each asset (sym), the function retrieves the high and low prices over the specified timeframe.
Calculations:
Find Highest and Lowest Prices: Determines sym_maxhigh and sym_minlow within the tracking period.
Compute Max Gain: Calculates the potential gain from sym_minlow to the current high.
Compute Max Loss: Calculates the potential loss from sym_maxhigh to the current low.
Adjust Max Loss: Adjusts the max loss calculation to prevent distortion as losses near 100%.
Output: Returns both sym_MaxGain and sym_AdjustedMaxLoss for further analysis.
Benefits of Understanding the Function
Transparency: Knowing how these values are calculated can increase your trust in the indicator's outputs.
Customization: If you're familiar with coding, you might tailor the function to suit specific trading strategies.
Enhanced Analysis: Understanding the underlying calculations allows you to interpret the results more effectively, aiding in better decision-making.
Conclusion
The Asset MaxGain MinLoss Tracker is a powerful tool that can significantly enhance your trading efficiency and effectiveness by:
Providing Quick Insights: Save time by getting immediate access to essential performance metrics of multiple assets.
Assisting in Risk Management: Use the adjusted maximum loss to understand and mitigate potential risks.
Supporting Strategic Decisions: Identify assets with the best risk-to-reward ratios to optimize your trading strategy.
Take advantage of this indicator to elevate your trading game and make more informed decisions with confidence.
Thank you for your time, and happy trading!
Disclaimer:
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
This indicator is inspired by the "Max Gain" indicator. A special thanks to Skipper86 for his relentless effort, creativity, and contributions to the TradingView community, which served as a foundation for this work.
Previous Candle AverageDescription:
The Previous Candle Average indicator is a powerful tool designed to provide traders with insights into market momentum by visualizing the relationship between the current and previous open levels for a customizable timeframe. This versatile indicator allows you to select from various timeframes, including 1 Month, 1 Week, 1 Day, 8 Hours, 4 Hours, and 1 Hour, making it suitable for different trading strategies, whether you're a swing trader, day trader, or scalper.
The indicator plots the Current Open and Previous Open levels for the selected timeframe and calculates the average value between them. By displaying these critical levels, traders can quickly gauge the current market dynamics relative to the previous period, making it easier to identify support, resistance, or trend continuation.
Key Features:
Custom Timeframe Selection: Easily select the desired timeframe from a variety of options (1M, 1W, 1D, 8H, 4H, 1H) to align with your trading strategy.
Current and Previous Open Levels: The indicator plots both the Current Open and Previous Open levels for the chosen timeframe, providing clear visual guidance on where the market is opening relative to the previous period.
Open Fill with Adjustable Transparency: The area between the Current Open and Previous Open levels is filled with color to represent the relationship between the two. The fill color changes based on whether the Current Open is above or below the Previous Open, with a default 20% opacity for better clarity without overwhelming the chart.
Average Line: The indicator also plots the average value between the Current Open and Previous Open levels, painted by default in a solid white color with a line thickness of 2. This average helps identify potential key levels where the price might react.
Dynamic Coloring: The fill color changes dynamically based on whether the Current Open is higher or lower than the Previous Open, using green to indicate bullish behavior and red for bearish behavior.
How to Use:
The Previous Candle Average indicator can help traders identify the momentum of the market by visually comparing the relationship between consecutive open levels.
Use the Average Line as a reference for potential support or resistance, especially when the market opens near this average.
The Open Fill color can quickly indicate a shift in market sentiment. A green fill suggests that the market is opening stronger than the previous period, while a red fill indicates weakness.
Best Practices:
Combine this indicator with other technical analysis tools, such as trend lines, moving averages, or volume analysis, to confirm potential trading opportunities.
The custom timeframe feature is particularly useful for multi-timeframe analysis. For instance, you can monitor weekly open levels while trading on an hourly chart.
Note: The indicator uses real-time open data and is updated accordingly, ensuring there is no delay or repainting of historical values.
Ideal For:
Traders who want a clear visual representation of market open levels relative to previous periods.
Those who want to identify potential shifts in momentum by comparing open levels across different timeframes.
Traders seeking to add an additional layer of analysis to their existing strategy by incorporating key opening levels and their averages.
Drummond Geometry - Pldot and EnvelopeThis Pine Script will:
1.Calculate and display the PL Dot (Price Level Dot), a moving average that reflects short-term market trends.
2.Plot the Envelope Top and Bottom lines based on averages of previous highs and lows, which represent key areas of resistance and support.
Drummond Geometry Overview
Drummond Geometry is a method of market analysis focused on:
PL Dot : Captures market energy and trend direction. It reacts to price deviations and serves as a magnet for price returns, often referred to as a "PL Dot Refresh."
Envelope Theory : Considers price movements as cycles oscillating between the Envelope Top and Bottom. Prices breaking these boundaries often indicate trends, retracements, or exhaustion.
The geometry helps traders visualize energy flows in the market and anticipate directional changes using established support and resistance zones.
Understanding PL Dot and Envelope Top/Bottom
PL Dot:
Formula: Average(Average(H, L, C) of last three bars)
Usage: Indicates short-term trends:
Trend: PL Dot slopes upward or downward.
Congestion: PL Dot moves horizontally.
Envelope Top and Bottom:
Formula:
Top: (11 H1 + 11 H2 + 11 H3) / 3
Bottom: (11 L1 + 11 L2 + 11 L3) / 3
Usage: Acts as dynamic resistance and support:
Price above the top: Indicates strong bullish momentum.
Price below the bottom: Indicates strong bearish momentum.
Advantages of Drummond Geometry
Clarity of Market Flow: Highlights the relationship between price and key levels (PL Dot, Envelope Top/Bottom).
Predictive Power: Suggests possible reversals or continuation based on energy distribution.
Adaptability: Works across multiple time frames and market types (trending, congestion).
Trading Strategy
PL Dot Trades:
Buy: When price returns to the PL Dot in an uptrend.
Sell: When price returns to the PL Dot in a downtrend.
Envelope Trades:
Reversal: Trade counter to price if it breaks and retreats from the Envelope Top/Bottom.
Continuation: Trade in the direction of price if it sustains movement beyond the Envelope Top/Bottom.