5 EMA/SMA by LookTajChỉ báo 5 đường MA/EMA
- Đường MA dốc lên thể hiện bằng nét liền
- Đường MA dốc xuống thể hiện bằng nét đứt
- Điểm bắt đầu dốc lên đánh dấu bằng dấu + màu trắng
- Điểm bắt đầu dốc xuống đánh dấu bằng dấu . màu vàng
المتوسط المتحرك البسيط
Daily MA Crossover SignalsI created a script that allows you to show up to 3 daily MA's and the crossovers. It's highly configurable. Hope you enjoy it!
I did try to make it multi-timeframe, but for some reason I didn't manage to get that work
EMA Trend & Inside Bar | TuanVungTauEMA Trend & Inside Bar | TuanVungTau
This indicator combines the power of Exponential Moving Averages (EMA) and Inside Bar detection to provide traders with comprehensive tools for analyzing trends and key price patterns. Designed for both trend-following and price action traders, it enables precision in identifying market conditions and potential trade opportunities.
Key Features
EMA Trend Analysis:
Plots up to 5 customizable EMAs with adjustable lengths (default: EMA 10, 20, 50, 100, 200).
Provides a clear visual trend background based on the relationship between EMA 1, EMA 2, and EMA 3:
Green Background: Uptrend (EMA 1 > EMA 2 > EMA 3).
Red Background: Downtrend (EMA 1 < EMA 2 < EMA 3).
Gray Background: Neutral (No clear trend).
Custom Moving Average (MA):
Allows users to plot a custom moving average (EMA, SMA, WMA, VWMA) with user-defined length and color.
Inside Bar Detection:
Automatically detects Inside Bar candlestick patterns (candles with lower highs and higher lows compared to the previous candle).
Highlights detected Inside Bars on the chart with a customizable color.
EMA Cross Alerts:
Detects and marks crossover and crossunder events between all EMA pairs (e.g., EMA 1 crossing EMA 2).
Provides visual circles at crossover points to help traders identify key moments.
Alerts for Key Events:
Notifies traders when a trend starts (Uptrend or Downtrend) or when an Inside Bar forms.
Alerts can be configured to align with specific trading strategies.
User-Friendly Customization:
Toggle visibility and customize colors for each EMA.
Adjust trend colors and transparency to suit personal preferences.
Trading Ideas
Trend-Following Strategy: Utilize the trend background and EMA alignment to identify strong trends.
Entry Example: Enter long trades when the background is green and short trades when the background is red.
Inside Bar Breakout: Use detected Inside Bars as potential breakout points.
Entry Example: Place a buy stop above the high or a sell stop below the low of the Inside Bar.
Crossover Confirmation: Combine EMA crossovers with trend background for confirmation.
Entry Example: Look for EMA 1 crossing EMA 2 upwards during a green trend background for stronger signals.
This indicator offers powerful, customizable tools to suit a variety of trading styles, enhancing both analysis and execution.
Developed with precision and passion by TuanVungTau | nhattuan.com
Higher Timeframe MAsPlots moving averages from a higher timeframe onto the current chart. Each line can have its own MA type and length.
SMA 20/50/100/200 by TPThis calculates the SMA 20/50/100/200 and changes the color when it falls through the support level.
Multi SMA EMA VWAPMulti Moving Average Indicator, which includes EMA, SMA and VWAP.
It has 4 EMAs and 5 SMAs, for different trading strategies.
It adds the VWAP, HLC3, to complement the moving averages in low time frames and for scalping.
Buy The Deep Final Version V3 -grid version"Buy The Deep Final Version V3" Indicator Description"
The "Buy The Deep Final Version V3" is an advanced trading strategy designed to help traders automate and optimize their entry, position sizing, and exit points in volatile markets. Below is a detailed explanation of its features, inputs, and functionality.
---
Key Features
1. Dynamic Position Sizing :
- Calculates position size dynamically based on the trader's initial capital, current profit, and leverage settings.
- Provides options for reinvesting profits or maintaining fixed position sizes.
2. Volatility-Based Entry :
- Identifies "buy-the-dip" opportunities based on a calculated volatility percentage (`val`).
3. Automated Take Profit and Stop Loss :
- Automatically sets take profit (`tp`) and stop loss (`tp22`) levels using predefined percentages, ensuring effective risk management.
4. SMA-Based Conditions :
- Utilizes a Simple Moving Average (SMA) as a baseline to determine whether to enter long positions.
5. Support for Additional Buy Levels :
- Allows dollar-cost averaging with multiple additional buy levels (`so1`, `so2`, etc.).
6. Leverage and Commission Customization :
- Users can set desired leverage and trading fees, which are incorporated into the calculations for precise execution.
7. Performance Tracking :
- Displays key metrics, including:
- Total profit and percentage
- Monthly and annual profit percentages
- Maximum drawdown (MDD)
- Win rate
- Includes a performance table and data window for real-time insights.
8. Time-Limited Testing :
- Allows users to test the strategy over specific time periods for refinement and validation.
---
"How It Works"
- Entry Conditions : The strategy identifies opportunities when the price crosses above the SMA or meets specific volatility thresholds.
- Position Sizing : Leverage and capital allocation are used to calculate optimal position sizes dynamically.
- Exit Points : Automated take profit or stop-loss orders minimize manual intervention.
---
Input Descriptions
This strategy provides various customizable input parameters to suit different trading needs. Each input is described below:
1. Initial Settings
- Profit Reinvest (`reinvest`) :
- Options: `True` or `False`
- Determines whether profits are reinvested to increase the size of subsequent trades.
- Long Buy % (`longper`) :
- Default: `6`
- Sets the percentage of initial capital to allocate for the first long position.
- Leverage (`lev`) :
- Default: `3`
- Sets the leverage multiplier for trades. For example, `3` means a 3x leverage is used.
- Fee % (`commission_value`) :
- Default: `0.044`
- Input the trading fee as a percentage. This value is factored into profit calculations.
- Decimal Places (`num`) :
- Default: `2`
- Determines how many decimal places are considered in calculations.
- Table Font Size (`texts`) :
- Default: `Normal`
- Sets the font size for the performance table. Options include `Tiny`, `Small`, `Normal`, and `Large`.
---
2. Volatility and Additional Buy Settings
- Volatility % (`val`) :
- Default: `-1.5`
- Sets the volatility percentage used to determine entry points.
- Additional Buy % (`so`) :
- Default: `-3`
- Defines the percentage drop at which additional buy orders are executed.
- Take Profit % (`tp`) :
- Default: `0.5`
- Specifies the percentage increase at which take profit orders are executed.
- Candle Count (`sl`) :
- Default: `1`
- Sets the number of candles to hold a position before closing it.
- Take Profit Stop-Loss % (`tp22`) :
- Default: `0.1`
- Sets the stop-loss threshold as a percentage below the average entry price.
- SMA Length (`len`) :
- Default: `48`
- Determines the period for calculating the Simple Moving Average (SMA).
---
3. Position Multipliers
- Position Multiplier Longline 4 (`long2_qty`) :
- Default: `1`
- Sets the size of the first additional buy position.
- Position Multiplier Longline 5 (`long3_qty`) :
- Default: `2`
- Sets the size of the second additional buy position.
- Position Multiplier Longline 4 (`long4_qty`) :
- Default: `4`
- Sets the size of the third additional buy position.
- Position Multiplier Longline 5 (`long5_qty`) :
- Default: `8`
- Sets the size of the fourth additional buy position.
---
Scalp SpotterThis indicator is a multi-purpose tool designed to help traders identify trends and generate buy/sell signals based on moving averages and their crossovers. Here's how it works:
1. Moving Averages (MAs):
The indicator uses four Moving Averages (MAs), calculated based on user-defined lengths and types (Simple Moving Average or Exponential Moving Average).
MA 1 and MA 2: These are shorter-term averages, reacting faster to price changes and used to detect quick trend shifts.
MA 3 and MA 4: These are longer-term averages, reacting slower to price changes and indicating broader market trends.
MAs smooth out price data to help traders identify the direction of the market and potential levels of support or resistance.
2. Crossover Detection:
The indicator identifies when one moving average crosses above or below another, which signals potential changes in market momentum:
MA 1 and MA 2 Crossovers:
Buy Signal: When MA 1 crosses above MA 2, it indicates upward momentum.
Sell Signal: When MA 1 crosses below MA 2, it indicates downward momentum.
MA 3 and MA 4 Crossovers:
Buy Signal: When MA 3 crosses above MA 4, it suggests a long-term upward trend.
Sell Signal: When MA 3 crosses below MA 4, it suggests a long-term downward trend.
These crossover signals are visually represented on the chart as labels ("Buy" or "Sell").
4. Practical Use:
Trend Confirmation: Use MA 3 and MA 4 to confirm the overall market trend.
Entry and Exit Points: Use MA 1 and MA 2 crossovers to identify precise entry and exit points within the broader trend.
GTC 5 Customizable Moving Averages5 Customizable Moving Averages
5 Customizable Moving Averages in type of moving average, length, thickness and color as well as activation and deactivation of the same
Supertrend StatsSupertrend with Probabilistic Stats and MA Filter
Overview: The Supertrend with Probabilistic Stats and MA Filter is a comprehensive TradingView Pine Script indicator designed to enhance trading strategies by combining the trend-detection capabilities of the Supertrend indicator with the trend-confirmation strength of Moving Averages (MA). Additionally, it offers robust statistical tracking to provide traders with valuable insights into the performance and reliability of their trading signals.
Key Features:
Supertrend Indicator Integration:
Trend Detection: Utilizes the Supertrend algorithm to identify prevailing market trends.
Buy/Sell Signals: Generates clear buy and sell signals based on trend reversals.
Customizable Parameters: Allows adjustment of ATR period and multiplier to suit different trading styles and market conditions.
Visual Aids: Plots Supertrend lines on the chart and highlights trend areas for easy visualization.
Moving Average (MA) Filter:
Trend Confirmation: Filters buy signals to occur only when the open price is above the MA and sell signals only when the open price is below the MA.
Customizable MA Types: Supports various MA types, including SMA, EMA, SMMA (RMA), WMA, and VWMA.
Flexible Configuration: Offers options to enable/disable the MA filter, select MA type, set MA length, and adjust MA source and offset.
Statistical Tracking:
Trimmed Mean Calculation: Computes trimmed means for bullish and bearish movements, removing outliers to provide a more accurate average movement.
Success Rate Metrics: Calculates the success rates (%) for both bullish and bearish signals, indicating the percentage of signals that resulted in favorable price movements.
Candle Count Analysis: Tracks the average number of candles each bullish and bearish move lasts, offering insights into the duration of trends.
Data Visualization: Presents all statistical data in a neatly formatted table on the chart, allowing for quick reference and analysis.
Customizable Statistics Table:
Text Color Customization: Provides an option to change the table text color to match personal preferences or chart aesthetics, enhancing readability.
Comprehensive Metrics: Displays key statistics such as Bullish/Bearish Averages, Counts, Success Rates, and Average Candle Counts.
Optional Pinbar Filtering:
Signal Refinement: Adds an additional layer of signal confirmation by filtering buy and sell signals based on pinbar candlestick patterns.
Adjustable Thresholds: Allows customization of the pinbar wick threshold to fine-tune signal accuracy.
Visual Enhancements:
Markers: Optionally displays markers on the first and last candles of bullish and bearish moves for better trend identification.
Highlighter: Shades the chart background to indicate current trend direction, aiding in visual trend recognition.
How It Works:
Trend Identification with Supertrend:
The indicator calculates the Supertrend based on user-defined ATR periods and multipliers.
It plots the Supertrend lines and generates buy/sell signals when the price crosses these lines, indicating a potential trend reversal.
Filtering Signals with Moving Average:
When the MA filter is enabled, the indicator ensures that buy signals are only considered valid if the candle's open price is above the selected MA, and sell signals only if the open price is below the MA.
This additional confirmation aligns trades with the broader market trend, potentially increasing signal reliability.
Statistical Analysis:
Upon triggering a buy or sell signal, the indicator records the entry price and tracks the subsequent price movements.
It calculates trimmed means to assess average movements while excluding extreme outliers.
Success rates are computed by comparing the closing price against the entry price, indicating how often signals result in favorable outcomes.
The average number of candles per move provides insight into trend duration and volatility.
Visualization and Customization:
All statistical data is presented in a table on the chart, with customizable text colors for enhanced readability.
Optional pinbar filtering and visual markers further refine and illustrate trading signals, aiding in decision-making.
Benefits to Traders:
Enhanced Signal Reliability:
By combining Supertrend with an MA filter, the indicator ensures that only signals aligning with the broader market trend are considered, potentially reducing false signals.
Data-Driven Decision Making:
The comprehensive statistical tracking offers traders insights into the performance of their signals, enabling informed adjustments to their trading strategies based on empirical data.
Trend Confirmation and Alignment:
The MA filter acts as a trend confirmation tool, ensuring that trades are placed in the direction of the prevailing trend, which can enhance the probability of successful trades.
Performance Metrics at a Glance:
The statistics table provides all necessary performance metrics in a single view, allowing traders to quickly assess the effectiveness of their strategy without sifting through extensive data.
Customization and Flexibility:
With options to adjust MA types, lengths, and table text colors, traders can tailor the indicator to fit their specific preferences and trading environments.
Visual Clarity and Aids:
The plotted Supertrend lines, MA line, signal markers, and highlighter enhance visual clarity, making it easier to identify trends and potential trade opportunities on the chart.
Usage Instructions:
Adding the Indicator:
Copy the Script: Select and copy the entire Pine Script provided.
Open TradingView: Navigate to TradingView and open your desired asset's chart.
Access Pine Editor: Click on the Pine Editor tab at the bottom of the TradingView interface.
Paste and Add to Chart: Paste the script into the editor and click "Add to Chart" to apply the indicator.
Configuring Settings:
Supertrend Parameters: Adjust the ATR period and multiplier to suit your trading style and the asset's volatility.
MA Filter Settings:
Enable MA Filter: Toggle "Enable MA Filter?" to ON to activate the filter.
Select MA Type: Choose from SMA, EMA, SMMA (RMA), WMA, or VWMA.
Set MA Length: Define the period for the MA calculation.
MA Source and Offset: Choose the price source (default is close) and set any desired plot offset.
Statistical Tracking:
Trimmed Mean Percentage: Set the percentage to trim outliers in mean calculations.
Show Cross Markers: Toggle to display or hide markers on the first and last candles of bullish and bearish moves.
Table Customization:
Table Text Color: Select your preferred text color for the statistics table to match your chart's theme or enhance readability.
Pinbar Filtering (Optional):
Enable Pinbar Filtering: Toggle to refine signals based on pinbar patterns.
Set Pinbar Wick Threshold: Adjust the threshold to define the characteristics of a valid pinbar.
Interpreting the Indicators:
Buy/Sell Signals: Look for labeled "BUY" and "SELL" signals on the chart that align with Supertrend reversals and MA conditions.
Statistics Table: Refer to the table located at the bottom right of the chart to assess:
Bullish/Bearish Averages: Average price movements following signals.
Counts: Total number of bullish and bearish signals.
Success Rates (%): Percentage of signals that resulted in profitable trades.
Candle Averages: Average duration of bullish and bearish moves in terms of candle counts.
Markers and Highlighter: Utilize visual markers and shaded trend areas to better understand market trends and the context of each signal.
Making Informed Decisions:
Assess Signal Performance: Use the success rates and averages to evaluate the effectiveness of your current settings and make necessary adjustments.
Adjust Parameters: Modify Supertrend and MA parameters based on observed performance and changing market conditions to optimize signal accuracy.
Combine with Other Analysis: Integrate insights from this indicator with other technical analysis tools and fundamental factors to form a holistic trading strategy.
Conclusion: The Supertrend with Probabilistic Stats and MA Filter indicator offers a powerful combination of trend detection, signal filtering, and statistical analysis. By providing detailed performance metrics and ensuring that trades align with the broader market trend, this indicator empowers traders to make more informed, data-driven decisions. Whether you're a novice seeking clarity or an experienced trader aiming to refine your strategy, this tool serves as a valuable asset in your trading toolkit.
If you have any further questions or require additional customizations, feel free to reach out!
Supertrend StatsSupertrend with Probabilistic Stats and MA Filter
Overview: The Supertrend with Probabilistic Stats and MA Filter is a comprehensive TradingView Pine Script indicator designed to enhance trading strategies by combining the trend-detection capabilities of the Supertrend indicator with the trend-confirmation strength of Moving Averages (MA). Additionally, it offers robust statistical tracking to provide traders with valuable insights into the performance and reliability of their trading signals.
Key Features:
Supertrend Indicator Integration:
Trend Detection: Utilizes the Supertrend algorithm to identify prevailing market trends.
Buy/Sell Signals: Generates clear buy and sell signals based on trend reversals.
Customizable Parameters: Allows adjustment of ATR period and multiplier to suit different trading styles and market conditions.
Visual Aids: Plots Supertrend lines on the chart and highlights trend areas for easy visualization.
Moving Average (MA) Filter:
Trend Confirmation: Filters buy signals to occur only when the open price is above the MA and sell signals only when the open price is below the MA.
Customizable MA Types: Supports various MA types, including SMA, EMA, SMMA (RMA), WMA, and VWMA.
Flexible Configuration: Offers options to enable/disable the MA filter, select MA type, set MA length, and adjust MA source and offset.
Statistical Tracking:
Trimmed Mean Calculation: Computes trimmed means for bullish and bearish movements, removing outliers to provide a more accurate average movement.
Success Rate Metrics: Calculates the success rates (%) for both bullish and bearish signals, indicating the percentage of signals that resulted in favorable price movements.
Candle Count Analysis: Tracks the average number of candles each bullish and bearish move lasts, offering insights into the duration of trends.
Data Visualization: Presents all statistical data in a neatly formatted table on the chart, allowing for quick reference and analysis.
Customizable Statistics Table:
Text Color Customization: Provides an option to change the table text color to match personal preferences or chart aesthetics, enhancing readability.
Comprehensive Metrics: Displays key statistics such as Bullish/Bearish Averages, Counts, Success Rates, and Average Candle Counts.
Optional Pinbar Filtering:
Signal Refinement: Adds an additional layer of signal confirmation by filtering buy and sell signals based on pinbar candlestick patterns.
Adjustable Thresholds: Allows customization of the pinbar wick threshold to fine-tune signal accuracy.
Visual Enhancements:
Markers: Optionally displays markers on the first and last candles of bullish and bearish moves for better trend identification.
Highlighter: Shades the chart background to indicate current trend direction, aiding in visual trend recognition.
How It Works:
Trend Identification with Supertrend:
The indicator calculates the Supertrend based on user-defined ATR periods and multipliers.
It plots the Supertrend lines and generates buy/sell signals when the price crosses these lines, indicating a potential trend reversal.
Filtering Signals with Moving Average:
When the MA filter is enabled, the indicator ensures that buy signals are only considered valid if the candle's open price is above the selected MA, and sell signals only if the open price is below the MA.
This additional confirmation aligns trades with the broader market trend, potentially increasing signal reliability.
Statistical Analysis:
Upon triggering a buy or sell signal, the indicator records the entry price and tracks the subsequent price movements.
It calculates trimmed means to assess average movements while excluding extreme outliers.
Success rates are computed by comparing the closing price against the entry price, indicating how often signals result in favorable outcomes.
The average number of candles per move provides insight into trend duration and volatility.
Visualization and Customization:
All statistical data is presented in a table on the chart, with customizable text colors for enhanced readability.
Optional pinbar filtering and visual markers further refine and illustrate trading signals, aiding in decision-making.
Benefits to Traders:
Enhanced Signal Reliability:
By combining Supertrend with an MA filter, the indicator ensures that only signals aligning with the broader market trend are considered, potentially reducing false signals.
Data-Driven Decision Making:
The comprehensive statistical tracking offers traders insights into the performance of their signals, enabling informed adjustments to their trading strategies based on empirical data.
Trend Confirmation and Alignment:
The MA filter acts as a trend confirmation tool, ensuring that trades are placed in the direction of the prevailing trend, which can enhance the probability of successful trades.
Performance Metrics at a Glance:
The statistics table provides all necessary performance metrics in a single view, allowing traders to quickly assess the effectiveness of their strategy without sifting through extensive data.
Customization and Flexibility:
With options to adjust MA types, lengths, and table text colors, traders can tailor the indicator to fit their specific preferences and trading environments.
Visual Clarity and Aids:
The plotted Supertrend lines, MA line, signal markers, and highlighter enhance visual clarity, making it easier to identify trends and potential trade opportunities on the chart.
Usage Instructions:
Adding the Indicator:
Copy the Script: Select and copy the entire Pine Script provided.
Open TradingView: Navigate to TradingView and open your desired asset's chart.
Access Pine Editor: Click on the Pine Editor tab at the bottom of the TradingView interface.
Paste and Add to Chart: Paste the script into the editor and click "Add to Chart" to apply the indicator.
Configuring Settings:
Supertrend Parameters: Adjust the ATR period and multiplier to suit your trading style and the asset's volatility.
MA Filter Settings:
Enable MA Filter: Toggle "Enable MA Filter?" to ON to activate the filter.
Select MA Type: Choose from SMA, EMA, SMMA (RMA), WMA, or VWMA.
Set MA Length: Define the period for the MA calculation.
MA Source and Offset: Choose the price source (default is close) and set any desired plot offset.
Statistical Tracking:
Trimmed Mean Percentage: Set the percentage to trim outliers in mean calculations.
Show Cross Markers: Toggle to display or hide markers on the first and last candles of bullish and bearish moves.
Table Customization:
Table Text Color: Select your preferred text color for the statistics table to match your chart's theme or enhance readability.
Pinbar Filtering (Optional):
Enable Pinbar Filtering: Toggle to refine signals based on pinbar patterns.
Set Pinbar Wick Threshold: Adjust the threshold to define the characteristics of a valid pinbar.
Interpreting the Indicators:
Buy/Sell Signals: Look for labeled "BUY" and "SELL" signals on the chart that align with Supertrend reversals and MA conditions.
Statistics Table: Refer to the table located at the bottom right of the chart to assess:
Bullish/Bearish Averages: Average price movements following signals.
Counts: Total number of bullish and bearish signals.
Success Rates (%): Percentage of signals that resulted in profitable trades.
Candle Averages: Average duration of bullish and bearish moves in terms of candle counts.
Markers and Highlighter: Utilize visual markers and shaded trend areas to better understand market trends and the context of each signal.
Making Informed Decisions:
Assess Signal Performance: Use the success rates and averages to evaluate the effectiveness of your current settings and make necessary adjustments.
Adjust Parameters: Modify Supertrend and MA parameters based on observed performance and changing market conditions to optimize signal accuracy.
Combine with Other Analysis: Integrate insights from this indicator with other technical analysis tools and fundamental factors to form a holistic trading strategy.
Conclusion: The Supertrend with Probabilistic Stats and MA Filter indicator offers a powerful combination of trend detection, signal filtering, and statistical analysis. By providing detailed performance metrics and ensuring that trades align with the broader market trend, this indicator empowers traders to make more informed, data-driven decisions. Whether you're a novice seeking clarity or an experienced trader aiming to refine your strategy, this tool serves as a valuable asset in your trading toolkit.
If you have any further questions or require additional customizations, feel free to reach out!
4 EMA and 2 SMA Indicatorthis is a moving average indicator that offers the following exponential moving averages and simple moving averages. 4EMA (5, 9, 14, 20) and 2SMA (50, 200). You can uses these as indicators instead of always drawing fibs on your charts as they offer the same kind of retracement information.
Conjunto de Indicadores EMA/SMADescrição do Indicador:
Este indicador foi criado com o objetivo de auxiliar usuários com a versão gratuita do TradingView, que possui limitações na quantidade de indicadores simultâneos no gráfico. Ao reunir diversas médias móveis exponenciais (EMAs) e simples (SMAs) em um único script, torna-se possível visualizar uma ampla gama de informações sobre a tendência e o momento do ativo sem ultrapassar o limite de indicadores permitidos pela plataforma.
O que o Indicador Faz:
1. Médias Móveis Múltiplas:
O indicador apresenta quatro conjuntos principais de médias, calculadas inicialmente como uma EMA seguida de uma SMA sobre a EMA, formando assim uma média suavizada. Essas médias são:
• EMA8W (calculada no timeframe semanal) seguida de SMA5
• EMA21W (calculada no timeframe semanal) seguida de SMA5
• EMA17 seguida de SMA5 (no timeframe atual)
• EMA72 seguida de SMA5 (no timeframe atual)
Além disso, o script possibilita plotar até cinco EMAs extras, personalizáveis em período e timeframe, permitindo ao usuário ajustar a análise conforme sua estratégia.
2. Visualização Unificada:
Ao invés de sobrecarregar o gráfico com diversos indicadores separados, este script consolida tudo em uma só ferramenta, ajudando a manter o layout mais limpo e eficiente. Isso é especialmente útil para quem utiliza a versão gratuita do TradingView, que limita o número total de indicadores que podem ser usados ao mesmo tempo.
3. Sinal de Venda baseado em Condição de Preço:
O indicador inclui uma lógica que sinaliza um possível momento de venda do ativo quando o preço fecha acima ou igual ao dobro da média simples de 200 dias. Nesse caso, o script desenha uma forma (um triângulo invertido) acima do candle atual, indicando um topo potencial, e exibe um rótulo com a mensagem “topo máximo. hora da venda”.
Como Utilizar:
• Adicione o indicador ao seu gráfico.
• Ajuste, conforme necessário, as médias extras (período, timeframe) nos parâmetros de entrada.
• Observe as curvas das médias móveis para avaliar a tendência de longo, médio e curto prazo.
• Monitore o sinal de venda indicado pelo triângulo vermelho e a mensagem no topo da barra quando a condição for atendida.
Este indicador visa oferecer uma solução completa de análise técnica unindo diversas médias móveis e um sinal de venda em apenas um painel, facilitando a tomada de decisão e otimização do espaço de indicadores disponíveis.
20/50 SMA Cross 200 SMAThis Pine Script code is designed to identify and visualize crossovers of two shorter-term Simple Moving Averages (SMAs), a 20-period SMA and a 50-period SMA, with a longer-term 200-period SMA on a price chart. It also includes alerts for these crossover events. Here's a breakdown:
**Purpose:**
The core idea behind this script is to detect potential trend changes. Crossovers of shorter-term moving averages over a longer-term moving average are often interpreted as bullish signals, while crossovers below are considered bearish.
**Key Components:**
1. **Moving Average Calculation:**
* `sma20 = ta.sma(close, 20)`: Calculates the 20-period SMA of the closing price.
* `sma50 = ta.sma(close, 50)`: Calculates the 50-period SMA of the closing price.
* `sma200 = ta.sma(close, 200)`: Calculates the 200-period SMA of the closing price.
2. **Crossover Detection:**
* `crossUp20 = ta.crossover(sma20, sma200)`: Returns `true` when the 20-period SMA crosses above the 200-period SMA.
* `crossDown20 = ta.crossunder(sma20, sma200)`: Returns `true` when the 20-period SMA crosses below the 200-period SMA.
* Similar logic applies for `crossUp50` and `crossDown50` with the 50-period SMA.
3. **Recent Crossover Tracking (Crucial Improvement):**
* `lookback = 7`: Defines a lookback period of 7 bars.
* `var bool hasCrossedUp20 = false`, etc.: Declares `var` (persistent) boolean variables to track if a crossover has occurred *within* the last 7 bars. This is the most important correction from previous versions.
* The logic using `ta.barssince()` is the key:
* If a crossover happens (`crossUp20` is true), the corresponding `hasCrossedUp20` is set to `true`.
* If no crossover happens on the current bar, it checks if a crossover happened within the last 7 bars using `ta.barssince(crossUp20) <= lookback`. If so, it keeps `hasCrossedUp20` as `true`. After 7 bars, it becomes `false`.
4. **Plotting Crossovers:**
* `plotshape(...)`: Plots circles on the chart to visually mark the crossovers.
* Green circles below the bars for bullish crossovers (20 and 50).
* Red circles above the bars for bearish crossovers (20 and 50).
* Different shades of green/red (green/lime, red/maroon) distinguish between 20 and 50 SMA crossovers.
5. **Plotting Moving Averages (Optional but Helpful):**
* `plot(sma20, color=color.blue, linewidth=1)`: Plots the 20-period SMA in blue.
* Similar logic for the 50-period SMA (orange) and 200-period SMA (gray).
6. **Alerts:**
* `alertcondition(...)`: Triggers alerts when crossovers occur. This is essential for real-time trading signals.
**How it Works (in Simple Terms):**
The script continuously calculates the 20, 50, and 200 SMAs. It then monitors for instances where the 20 or 50 SMA crosses the 200 SMA. When such a crossover happens, a colored circle is plotted on the chart, and an alert is triggered. The key improvement is that it remembers if a crossover occurred in the last 7 bars and continues to display the circle during that period.
**Use Case:**
Traders use this type of indicator to identify potential entry and exit points in the market. A bullish crossover (shorter SMA crossing above the longer SMA) might be a signal to buy, while a bearish crossover might be a signal to sell.
**Key Improvements over Previous Versions:**
* **Correct Lookback Implementation:** The use of `ta.barssince()` and `var` variables is the correct and efficient way to check for crossovers within a lookback period. This fixes the major flaw in earlier versions.
* **Clear Visualizations:** The use of `plotshape` with distinct colors makes it easy to distinguish between 20 and 50 SMA crossovers.
* **Alerts:** The inclusion of alerts makes the script much more practical for real-time trading.
This improved version provides a robust and useful tool for identifying and tracking SMA crossovers.
SMA Ribbon [A]SMA Ribbon with Adjustable MA200
20, 50, 100, and 200 -period Simple Moving Averages (SMAs) for trend analysis.
The SMA200 dynamically changes color based on its direction—green when rising and red when falling. Additionally, you can lock the SMA200 to the daily timeframe , allowing it to display the 200-day moving average on lower timeframes, such as 4-hour or 1-hour charts.
Features:
Dynamic SMA200 Color: Automatically adjusts to show upward (green) or downward (red) trends.
Daily SMA200 Option: Enables the SMA200 to represent the 200-day moving average on intraday charts for long-term trend insights.
Smart Adaptation: The daily SMA200 setting is automatically disabled on daily or higher timeframes, ensuring accurate period calculations.
How to Use:
Use this script to identify key support/resistance levels and overall market trends.
Adjust the "Daily MA for MA200" option in the settings to toggle between timeframe-specific and daily-locked SMA200.
This script is ideal for traders seeking a clean and customizable tool for long-term and short-term trend analysis.
Bitcoin: Mayer MultipleMayer Multiple Indicator
The Mayer Multiple is a powerful tool designed to help traders assess market conditions and identify optimal buying or selling opportunities. It calculates the ratio between the current price and its 200-day simple moving average (SMA), visualizing key thresholds that indicate value zones, caution areas, and overheated markets.
Key Features:
Dynamic Market Zones: Clearly marked levels like "Smash Buy," "Boost DCA," and "Extreme Euphoria" to guide your trading decisions.
Customizable Input: Adjust the SMA length to fit your strategy.
Color-Coded Signals: Intuitive visualization of market sentiment for quick analysis.
Comprehensive Thresholds: Historical insights into price behavior with plotted reference levels based on probabilities.
This indicator is ideal for traders aiming to enhance their long-term strategies and improve decision-making in volatile markets. Use it to gain an edge in identifying potential turning points and managing risk effectively.
Optimal MA FinderIntroduction to the "Optimal MA Finder" Indicator
The "Optimal MA Finder" is a powerful and versatile tool designed to help traders optimize their moving average strategies. This script combines flexibility, precision, and automation to identify the most effective moving average (MA) length for your trading approach. Whether you're aiming to improve your long-only strategy or implement a buy-and-sell methodology, the "Optimal MA Finder" is your go-to solution for enhanced decision-making.
What Does It Do?
The script evaluates a wide range of moving average lengths, from 10 to 500, to determine which one produces the best results based on historical data. By calculating critical metrics such as the total number of trades and the profit factor for each MA length, it identifies the one that maximizes profitability. It supports both simple moving averages (SMA) and exponential moving averages (EMA), allowing you to tailor the analysis to your preferred method.
The logic works by backtesting each MA length against the price data and assessing the performance under two strategies:
Buy & Sell: Includes both long and short trades.
Long Only: Focuses solely on long positions for more conservative strategies.
Once the optimal MA length is identified, the script overlays it on the chart, highlighting periods when the price crosses over or under the optimal MA, helping traders identify potential entry and exit points.
Why Is It Useful?
This indicator stands out for its ability to automate a task that is often labor-intensive and subjective: finding the best MA length. By providing a clear, data-driven answer, it saves traders countless hours of manual testing while significantly enhancing the accuracy of their strategies. For example, instead of guessing whether a 50-period EMA is more effective than a 200-period SMA, the "Optimal MA Finder" will pinpoint the exact length and type of MA that has historically yielded the best results for your chosen strategy.
Key Benefits:
Precision: Identifies the MA length with the highest profit factor for maximum profitability.
Automation: Conducts thorough backtesting without manual effort.
Flexibility: Adapts to your preferred MA type (SMA or EMA) and trading strategy (Buy & Sell or Long Only).
Real-Time Feedback: Provides actionable insights by plotting the optimal MA directly on your chart and highlighting relevant trading periods.
Example of Use: Imagine you're trading a volatile stock and want to optimize your long-only strategy. By applying the "Optimal MA Finder," you discover that a 120-period EMA results in the highest profit factor. The indicator plots this EMA on your chart, showing you when to consider entering or exiting positions based on price movements relative to the EMA.
In short, the "Optimal MA Finder" empowers traders by delivering data-driven insights and improving the effectiveness of trading strategies. Its clear logic, combined with robust automation, makes it an invaluable tool for both novice and experienced traders seeking consistent results.
OBV + Custom MA StrategyFor a long time, the use of the OBV indicator has been relatively monotonous, with its expression and content lacking diversity. Therefore, I'm considering trying new ways of representation.
This "OBV + Custom MA Strategy" indicator combines the On-Balance Volume (OBV) with customizable moving averages (SMA, EMA, or WMA) to provide advanced insights into market trends. The indicator calculates OBV manually and overlays two moving averages: a short-term and a long-term MA. Key features include:
OBV plotted alongside short-term and long-term moving averages for better trend visualization.
Signals generated when OBV crosses the short-term MA or when the short-term MA crosses the long-term MA.
Alerts for bullish and bearish crossovers to help identify potential buy or sell opportunities.
This indicator is suitable for traders looking to incorporate volume dynamics into their strategy while customizing their moving average type and periods.
中文说明
此“OBV + 自定义均线策略”指标结合了成交量指标OBV与可定制的移动均线(SMA、EMA或WMA),为市场趋势分析提供了更多的视角。该指标手动计算OBV,并叠加短期与长期均线,主要特点包括:
绘制OBV以及短期和长期均线,以更清晰地观察趋势。
当OBV上穿/下穿短期均线或短期均线上穿/下穿长期均线时,生成买卖信号。
提供多种看涨和看跌信号的警报,帮助识别潜在的买入或卖出机会。
此指标适合希望将成交量动态纳入策略的交易者,并支持自定义均线类型和周期以满足个性化需求。
2-Year MA Multiplier [UAlgo]The 2-Year MA Multiplier is a technical analysis tool designed to assist traders and investors in identifying potential overbought and oversold conditions in the market. By plotting the 2-year moving average (MA) of an asset's closing price alongside an upper band set at five times this moving average, the indicator provides visual cues to assess long-term price trends and significant market movements.
🔶 Key Features
2-Year Moving Average (MA): Calculates the simple moving average of the asset's closing price over a 730-day period, representing approximately two years.
Visual Indicators: Plots the 2-year MA in forest green and the upper band in firebrick red for clear differentiation.
Fills the area between the 2-year MA and the upper band to highlight the normal trading range.
Uses color-coded fills to indicate overbought (tomato red) and oversold (cornflower blue) conditions based on the asset's closing price relative to the bands.
🔶 Idea
The concept behind the 2-Year MA Multiplier is rooted in the cyclical nature of markets, particularly in assets like Bitcoin. By analyzing long-term price movements, the indicator aims to identify periods of significant deviation from the norm, which may signal potential buying or selling opportunities.
2-year MA smooths out short-term volatility, providing a clearer view of the asset's long-term trend. This timeframe is substantial enough to capture major market cycles, making it a reliable baseline for analysis.
Multiplying the 2-year MA by five establishes an upper boundary that has historically correlated with market tops. When the asset's price exceeds this upper band, it may indicate overbought conditions, suggesting a potential for price correction. Conversely, when the price falls below the 2-year MA, it may signal oversold conditions, presenting potential buying opportunities.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Fourier Extrapolation of PriceThis advanced algorithm leverages Fourier analysis to predict price trends by decomposing historical price data into its frequency components. Unlike traditional algorithms that often operate in lower-dimensional spaces, this method harnesses a multidimensional approach to capture intricate market behaviors. By utilizing additional dimensions, the algorithm identifies and extrapolates subtle patterns and oscillations that are typically overlooked, providing a more robust and nuanced forecast.
Ideal for traders seeking a deeper understanding of market dynamics, this tool offers an enhanced predictive capability by aligning its calculations with the complexity of real-world financial systems.
DNSE VN301!, SMA & EMA Cross StrategyDiscover the tailored Pinescript to trade VN30F1M Future Contracts intraday, the strategy focuses on SMA & EMA crosses to identify potential entry/exit points. The script closes all positions by 14:25 to avoid holding any contracts overnight.
HNX:VN301!
www.tradingview.com
Setting & Backtest result:
1-minute chart, initial capital of VND 100 million, entering 4 contracts per time, backtest result from Jan-2024 to Nov-2024 yielded a return over 40%, executed over 1,000 trades (average of 4 trades/day), winning trades rate ~ 30% with a profit factor of 1.10.
The default setting of the script:
A decent optimization is reached when SMA and EMA periods are set to 60 and 15 respectively while the Long/Short stop-loss level is set to 20 ticks (2 points) from the entry price.
Entry & Exit conditions:
Long signals are generated when ema(15) crosses over sma(60) while Short signals happen when ema(15) crosses under sma(60). Long orders are closed when ema(15) crosses under sma(60) while Short orders are closed when ema(15) crosses over sma(60).
Exit conditions happen when (whichever came first):
Another Long/Short signal is generated
The Stop-loss level is reached
The Cut-off time is reached (14:25 every day)
*Disclaimers:
Futures Contracts Trading are subjected to a high degree of risk and price movements can fluctuate significantly. This script functions as a reference source and should be used after users have clearly understood how futures trading works, accessed their risk tolerance level, and are knowledgeable of the functioning logic behind the script.
Users are solely responsible for their investment decisions, and DNSE is not responsible for any potential losses from applying such a strategy to real-life trading activities. Past performance is not indicative/guarantee of future results, kindly reach out to us should you have specific questions about this script.
---------------------------------------------------------------------------------------
Khám phá Pinescript được thiết kế riêng để giao dịch Hợp đồng tương lai VN30F1M trong ngày, chiến lược tập trung vào các đường SMA & EMA cắt nhau để xác định các điểm vào/ra tiềm năng. Chiến lược sẽ đóng tất cả các vị thế trước 14:25 để tránh giữ bất kỳ hợp đồng nào qua đêm.
Thiết lập & Kết quả backtest:
Chart 1 phút, vốn ban đầu là 100 triệu đồng, vào 4 hợp đồng mỗi lần, kết quả backtest từ tháng 1/2024 tới tháng 11/2024 mang lại lợi nhuận trên 40%, thực hiện hơn 1.000 giao dịch (trung bình 4 giao dịch/ngày), tỷ lệ giao dịch thắng ~ 30% với hệ số lợi nhuận là 1,10.
Thiết lập mặc định của chiến lược:
Đạt được một mức tối ưu ổn khi SMA và EMA periods được đặt lần lượt là 60 và 15 trong khi mức cắt lỗ được đặt thành 20 tick (2 điểm) từ giá vào.
Điều kiện Mở và Đóng vị thế:
Tín hiệu Long được tạo ra khi ema(15) cắt trên sma(60) trong khi tín hiệu Short xảy ra khi ema(15) cắt dưới sma(60). Lệnh Long được đóng khi ema(15) cắt dưới sma(60) trong khi lệnh Short được đóng khi ema(15) cắt lên sma(60).
Điều kiện đóng vị thể xảy ra khi (tùy điều kiện nào đến trước):
Một tín hiệu Long/Short khác được tạo ra
Giá chạm mức cắt lỗ
Lệnh chưa đóng nhưng tới giờ cut-off (14:25 hàng ngày)
*Tuyên bố miễn trừ trách nhiệm:
Giao dịch hợp đồng tương lai có mức rủi ro cao và giá có thể dao động đáng kể. Chiến lược này hoạt động như một nguồn tham khảo và nên được sử dụng sau khi người dùng đã hiểu rõ cách thức giao dịch hợp đồng tương lai, đã đánh giá mức độ chấp nhận rủi ro của bản thân và hiểu rõ về logic vận hành của chiến lược này.
Người dùng hoàn toàn chịu trách nhiệm về các quyết định đầu tư của mình và DNSE không chịu trách nhiệm về bất kỳ khoản lỗ tiềm ẩn nào khi áp dụng chiến lược này vào các hoạt động giao dịch thực tế. Hiệu suất trong quá khứ không chỉ ra/cam kết kết quả trong tương lai, vui lòng liên hệ với chúng tôi nếu bạn có thắc mắc cụ thể về chiến lược giao dịch này.