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.
---
Media Móvil Simple (SMA)
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
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.
4 EMA and 2 SMA IndicatorHere's an indicator for TradingView, including the 5 EMA, 9 EMA, 14 EMA, 20 EMA, 50 SMA, and 200 SMA:
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.
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.
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
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.
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.
Trend AnalyzerThe Trend Analyzer is designed to help traders identify and analyze market trends. Here's a simple explanation of its logic:
Main Features
Customizable Moving Average: The indicator plots a moving average on the chart. Users can choose from various types (SMA, EMA, WMA, VWMA, HMA, SMMA, TMA) and set the period. This flexibility allows traders to adapt the indicator to different trading styles and timeframes.
Trend Detection: It determines whether the current price is above or below the moving average, providing a clear visual representation of the current trend direction.
Sequence Counter: The indicator counts consecutive candles above or below the moving average. This feature helps traders identify trend strength and persistence, which can be crucial for timing entries and exits.
Statistical Analysis: It calculates probabilities for the next candle's direction based on historical data. This unique feature gives traders a statistical edge in predicting short-term price movements.
Visual Candle Counter: An optional feature that displays the number of consecutive candles above or below the moving average directly on the chart, enhancing visual analysis.
How It Works
The indicator continuously tracks the position of price relative to the chosen moving average.
It maintains a count of how many candles in a row have been above or below the moving average.
For each sequence length, it records historical data on how often the trend continued or reversed in the past.
This historical data is used to calculate probabilities for the next candle's direction, providing a statistical insight into potential price movements.
The indicator displays this information directly on the chart, allowing for quick and easy interpretation.
Practical Applications
Trend Confirmation: Use the indicator to confirm the strength and direction of current trends.
Entry and Exit Signals: The sequence counter and probability calculations can help in timing trades more effectively.
Risk Management: Understanding the statistical likelihood of trend continuation can aid in setting appropriate stop-loss and take-profit levels.
Market Analysis: The indicator provides valuable insights into market behavior and can be used for both short-term and long-term analysis.
While the Trend Analyzer provides valuable insights based on historical data and statistical analysis, it's important to remember that past performance does not guarantee future results. The financial markets are complex and influenced by numerous factors. This indicator should be used as part of a comprehensive trading strategy and not as a sole decision-making tool. Always practice proper risk management and consider seeking advice from financial professionals before making investment decisions.
Adapted RSI w/ Multi-Asset Regime Detection v1.1The relative strength index (RSI) is a momentum indicator used in technical analysis. RSI measures the speed and magnitude of an asset's recent price changes to detect overbought or oversold conditions in the price of said asset.
In addition to identifying overbought and oversold assets, the RSI can also indicate whether your desired asset may be primed for a trend reversal or a corrective pullback in price. It can signal when to buy and sell.
The RSI will oscillate between 0 and 100. Traditionally, an RSI reading of 70 or above indicates an overbought condition. A reading of 30 or below indicates an oversold condition.
The RSI is one of the most popular technical indicators. I intend to offer a fresh spin.
Adapted RSI w/ Multi-Asset Regime Detection
Our Adapted RSI makes necessary improvements to the original Relative Strength Index (RSI) by combining multi-timeframe analysis with multi-asset monitoring and providing traders with an efficient way to analyse market-wide conditions across different timeframes and assets simultaneously. The indicator automatically detects market regimes and generates clear signals based on RSI levels, presenting this data in an organised, easy-to-read format through two dynamic tables. Simplicity is key, and having access to more RSI data at any given time, allows traders to prepare more effectively, especially when trading markets that "move" together.
How we calculate the RSI
First, the RSI identifies price changes between periods, calculating gains and losses from one look-back period to the next. This look-back period averages gains and losses over 14 periods, which in this case would be 14 days, and those gains/losses are calculated based on the daily closing price. For example:
Average Gain = Sum of Gains over the past 14 days / 14
Average Loss = Sum of Losses over the past 14 days / 14
Then we calculate the Relative Strength (RS):
RS = Average Gain / Average Loss
Finally, this is converted to the RSI value:
RSI = 100 - (100 / (1 + RS))
Key Features
Our multi-timeframe RSI indicator enhances traditional technical analysis by offering synchronised Daily, Weekly, and Monthly RSI readings with automatic regime detection. The multi-asset monitoring system allows tracking of up to 10 different assets simultaneously, with pre-configured major pairs that can be customised to any asset selection. The signal generation system provides clear market guidance through automatic regime detection and a five-level signal system, all presented through a sophisticated visual interface with dynamic RSI line colouring and customisable display options.
Quick Guide to Use it
Begin by adding the indicator to your chart and configuring your preferred assets in the "Asset Comparison" settings.
Position the two information tables according to your preference.
The main table displays RSI analysis across three timeframes for your current asset, while the asset table shows a comparative analysis of all monitored assets.
Signals are colour-coded for instant recognition, with green indicating bullish conditions and red for bearish conditions. Pay special attention to regime changes and signal transitions, using multi-timeframe confluence to identify stronger signals.
How it Works (Regime Detection & Signals)
When we say 'Regime', a regime is determined by a persistent trend or in this case momentum and by leveraging this for RSI, which is a momentum oscillator, our indicator employs a relatively simple regime detection system that classifies market conditions as either Bullish (RSI > 50) or Bearish (RSI < 50). Our benchmark between a trending bullish or bearish market is equal to 50. By leveraging a simple classification system helps determine the probability of trend continuation and the weight given to various signals. Whilst we could determine a Neutral regime for consolidating markets, we have employed a 'neutral' signal generation which will be further discussed below...
Signal generation occurs across five distinct levels:
Strong Buy (RSI < 15)
Buy (RSI < 30)
Neutral (RSI 30-70)
Sell (RSI > 70)
Strong Sell (RSI > 85)
Each level represents different market conditions and probability scenarios. For instance, extreme readings (Strong Buy/Sell) indicate the highest probability of mean reversion, while neutral readings suggest equilibrium conditions where traders should focus on the overall regime bias (Bullish/Bearish momentum).
This approach offers traders a new and fresh spin on a popular and well-known tool in technical analysis, allowing traders to make better and more informed decisions from the well presented information across multiple assets and timeframes. Experienced and beginner traders alike, I hope you enjoy this adaptation.
Indicator DashboardThis script creates an 'Indicator Dashboard' designed to assist you in analyzing financial markets and making informed decisions. The indicator provides a summary of current market conditions by presenting various technical analysis indicators in a table format. The dashboard evaluates popular indicators such as Moving Averages, RSI, MACD, and Stochastic RSI. Below, we'll explain each part of this script in detail and its purpose:
### Overview of Indicators
1. **Moving Averages (MA)**:
- This indicator calculates Simple Moving Averages (“SMA”) for 5, 14, 20, 50, 100, and 200 periods. These averages provide a visual summary of price movements. Depending on whether the price is above or below the moving average, it determines the market direction as either “Bullish” or “Bearish.”
2. **RSI (Relative Strength Index)**:
- The RSI helps identify overbought or oversold market conditions. Here, the RSI is calculated for a 14-period window, and this value is displayed in the table. Additionally, the 14-period moving average of the RSI is also included.
3. **MACD (Moving Average Convergence Divergence)**:
- The MACD indicator is used to determine trend strength and potential reversals. This script calculates the MACD line, signal line, and histogram. The MACD condition (“Bullish,” “Bearish,” or “Neutral”) is displayed alongside the MACD and signal line values.
4. **Stochastic RSI**:
- Stochastic RSI is used to identify momentum changes in the market. The %K and %D lines are calculated to determine the market condition (“Bullish” or “Bearish”), which is displayed along with the calculated values for %K and %D.
### Table Layout and Presentation
The dashboard is presented in a vertical table format in the top-right corner of the chart. The table contains two columns: “Indicator” and “Status,” summarizing the condition of each technical indicator.
- **Indicator Column**: Lists each of the indicators being tracked, such as SMA values, RSI, MACD, etc.
- **Status Column**: Displays the current status of each indicator, such as “Bullish,” “Bearish,” or specific values like the RSI or MACD.
The table also includes rounded indicator values for easier interpretation. This helps traders quickly assess market conditions and make informed decisions based on multiple indicators presented in a single location.
### Detailed Indicator Status Calculations
1. **SMA Status**: For each moving average (5, 14, 20, 50, 100, 200), the script checks if the current price is above or below the SMA. The status is determined as “Bullish” if the price is above the SMA and “Bearish” if below, with the value of the SMA also displayed.
2. **RSI and RSI Average**: The RSI value for a 14-period is displayed along with its 14-period SMA, which provides an average reading of the RSI to smooth out volatility.
3. **MACD Indicator**: The MACD line, signal line, and histogram are calculated using standard parameters (12, 26, 9). The status is shown as “Bullish” when the MACD line is above the signal line, and “Bearish” when it is below. The exact values for the MACD line, signal line, and histogram are also included.
4. **Stochastic RSI**: The %K and %D lines of the Stochastic RSI are used to determine the trend condition. If %K is greater than %D, the condition is “Bullish,” otherwise it is “Bearish.” The actual values of %K and %D are also displayed.
### Conclusion
The 'Indicator Dashboard' provides a comprehensive overview of multiple technical indicators in a single, easy-to-read table. This allows traders to quickly gauge market conditions and make more informed decisions. By consolidating key indicators like Moving Averages, RSI, MACD, and Stochastic RSI into one dashboard, it saves time and enhances the efficiency of technical analysis.
This script is particularly useful for traders who prefer a clean and organized overview of their favorite indicators without needing to plot each one individually on the chart. Instead, all the crucial information is available at a glance in a consolidated format.
Simple Moving Average with Regime Detection by iGrey.TradingThis indicator helps traders identify market regimes using the powerful combination of 50 and 200 SMAs. It provides clear visual signals and detailed metrics for trend-following strategies.
Key Features:
- Dual SMA System (50/200) for regime identification
- Colour-coded candles for easy trend visualisation
- Metrics dashboard
Core Signals:
- Bullish Regime: Price < 200 SMA
- Bearish Regime: Price > 200 SMA
- Additional confirmation: 50 SMA Cross-over or Cross-under (golden cross or death cross)
Metrics Dashboard:
- Current Regime Status (Bull/Bear)
- SMA Distance (% from price to 50 SMA)
- Regime Distance (% from price to 200 SMA)
- Regime Duration (bars in current regime)
Usage Instructions:
1. Apply the indicator to your chart
2. Configure the SMA lengths if desired (default: 50/200)
3. Monitor the color-coded candles:
- Green: Bullish regime
- Red: Bearish regime
4. Use the metrics dashboard for detailed analysis
Settings Guide:
- Length: Short-term SMA period (default: 50)
- Source: Price calculation source (default: close)
- Regime Filter Length: Long-term SMA period (default: 200)
- Regime Filter Source: Price source for regime calculation (default: close)
Trading Tips:
- Use bullish regimes for long positions
- Use bearish regimes for capital preservation or short positions
- Consider regime duration for trend strength
- Monitor distance metrics for potential reversals
- Combine with other systems for confluence
#trend-following #moving average #regime #sma #momentum
Risk Management:
- Not a standalone trading system
- Should be used with proper position sizing
- Consider market conditions and volatility
- Always use stop losses
Best Practices:
- Monitor multiple timeframes
- Use with other confirmation tools
- Consider fundamental factors
Version: 1.0
Created by: iGREY.Trading
Release Notes
// v1.1 Allows table overlay customisation
// v1.2 Update to v6 pinescript
Dual Strategy Selector V2 - CryptogyaniOverview:
This script provides traders with a dual-strategy system that they can toggle between using a simple dropdown menu in the input settings. It is designed to cater to different trading styles and needs, offering both simplicity and advanced filtering techniques. The strategies are built around moving average crossovers, enhanced by configurable risk management tools like take profit levels, trailing stops, and ATR-based stop-loss.
Key Features:
Two Strategies in One Script:
Strategy 1: A classic moving average crossover strategy for identifying entry signals based on trend reversals. Includes user-defined take profit and trailing stop-loss options for profit locking.
Strategy 2: An advanced trend-following system that incorporates:
A higher timeframe trend filter to confirm entry signals.
ATR-based stop-loss for dynamic risk management.
Configurable partial take profit to secure gains while letting the trade run.
Highly Customizable:
All key parameters such as SMA lengths, take profit levels, ATR multiplier, and timeframe for the trend filter are adjustable via the input settings.
Dynamic Toggle:
Traders can switch between Strategy 1 and Strategy 2 with a single dropdown, allowing them to adapt the strategy to market conditions.
How It Works:
Strategy 1:
Entry Logic: A long trade is triggered when the fast SMA crosses above the slow SMA.
Exit Logic: The trade exits at either a user-defined take profit level (percentage or pips) or via an optional trailing stop that dynamically adjusts based on price movement.
Strategy 2:
Entry Logic: Builds on the SMA crossover logic but adds a higher timeframe trend filter to align trades with the broader market direction.
Risk Management:
ATR-Based Stop-Loss: Protects against adverse moves with a volatility-adjusted stop-loss.
Partial Take Profit: Allows traders to secure a percentage of gains while keeping some exposure for extended trends.
How to Use:
Select Your Strategy:
Use the dropdown in the input settings to choose Strategy 1 or Strategy 2.
Configure Parameters:
Adjust SMA lengths, take profit, and risk management settings to align with your trading style.
For Strategy 2, specify the higher timeframe for trend filtering.
Deploy and Monitor:
Apply the script to your preferred asset and timeframe.
Use the backtest results to fine-tune settings for optimal performance.
Why Choose This Script?:
This script stands out due to its dual-strategy flexibility and enhanced features:
For beginners: Strategy 1 provides a simple yet effective trend-following system with minimal setup.
For advanced traders: Strategy 2 includes powerful tools like trend filters and ATR-based stop-loss, making it ideal for challenging market conditions.
By combining simplicity with advanced features, this script offers something for everyone while maintaining full transparency and user customization.
Default Settings:
Strategy 1:
Fast SMA: 21, Slow SMA: 49
Take Profit: 7% or 50 pips
Trailing Stop: Optional (disabled by default)
Strategy 2:
Fast SMA: 20, Slow SMA: 50
ATR Multiplier: 1.5
Partial Take Profit: 50%
Higher Timeframe: 1 Day (1D)
SMA200 & RSI [Tarun]The SMA200 & RSI Signal Indicator is a powerful tool designed for traders who want to identify potential entry zones based on a combination of price action and momentum. This indicator combines two essential trading components:
SMA200 (Simple Moving Average): A widely used trend-following tool that highlights the overall direction of the market.
RSI (Relative Strength Index): A momentum oscillator that measures the speed and change of price movements.
How It Works:
Price Above SMA200: Indicates bullish market conditions.
RSI Between 40 and 20: Suggests that the asset is in a potential oversold or pullback zone within a bullish trend.
When both conditions are met, the indicator triggers:
Background Highlight: The chart background turns green to indicate a potential signal zone.
Disclaimer:
This indicator is not a standalone trading strategy. Use it in conjunction with other analysis methods such as support and resistance, candlestick patterns, or volume analysis. Always practice proper risk management.
Adaptive Moving AveragesThe Adaptive Moving Averages indicator stands out with several unique features that set it apart from traditional moving average indicators. Its most remarkable characteristic is the ability to automatically adjust the length of moving averages based on the chosen timeframe. This ensures consistency in analysis regardless of the time scale used, eliminating the need for manual recalculation of appropriate periods for each timeframe. It allows for a more fluid and accurate multi-temporal analysis.
Another innovative aspect is the indicator's consideration of different market types (stocks, forex, crypto). This approach recognizes the fundamental differences between these markets in terms of trading hours, allowing for more precise and representative calculations for each asset class. It offers increased flexibility for traders operating across various markets.
The method for calculating periods for different moving averages (week, month, quarter, semester, year) is particularly sophisticated. It takes into account the specifics of each market, such as trading days and opening hours, automatically adapting to timeframe changes. This ensures a more accurate representation of actual trading periods rather than arbitrary approximations.
The indicator offers a wide choice of moving average types, allowing traders to use their preferred method or compare different approaches. This flexibility adapts to various trading styles and technical analysis strategies, offering the possibility to experiment and find the most effective combination for each market or asset.
In conclusion, this indicator distinguishes itself through its ability to intelligently adapt to different trading contexts, offering a versatile and sophisticated solution for technical analysis. Its flexibility and adaptive approach make it a particularly interesting tool for traders seeking consistent analysis across different markets and time scales.