Fibonacci Bands [BigBeluga]The Fibonacci Band indicator is a powerful tool for identifying potential support, resistance, and mean reversion zones based on Fibonacci ratios. It overlays three sets of Fibonacci ratio bands (38.2%, 61.8%, and 100%) around a central trend line, dynamically adapting to price movements. This structure enables traders to track trends, visualize potential liquidity sweep areas, and spot reversal points for strategic entries and exits.
🔵 KEY FEATURES & USAGE
Fibonacci Bands for Support & Resistance:
The Fibonacci Band indicator applies three key Fibonacci ratios (38.2%, 61.8%, and 100%) to construct dynamic bands around a smoothed price. These levels often act as critical support and resistance areas, marked with labels displaying the percentage and corresponding price. The 100% band level is especially crucial, signaling potential liquidity sweep zones and reversal points.
Mean Reversion Signals at 100% Bands:
When price moves above or below the 100% band, the indicator generates mean reversion signals.
Trend Detection with Midline:
The central line acts as a trend-following tool: when solid, it indicates an uptrend, while a dashed line signals a downtrend. This adaptive midline helps traders assess the prevailing market direction while keeping the chart clean and intuitive.
Extended Price Projections:
All Fibonacci bands extend to future bars (default 30) to project potential price levels, providing a forward-looking perspective on where price may encounter support or resistance. This feature helps traders anticipate market structure in advance and set targets accordingly.
Liquidity Sweep:
--
-Liquidity Sweep at Previous Lows:
The price action moves below a previous low, capturing sell-side liquidity (stop-losses from long positions or entries for breakout traders).
The wick suggests that the price quickly reversed, leaving a failed breakout below support.
This is a classic liquidity grab, often indicating a bullish reversal .
-Liquidity Sweep at Previous Highs:
The price spikes above a prior high, sweeping buy-side liquidity (stop-losses from short positions or breakout entries).
The wick signifies rejection, suggesting a failed breakout above resistance.
This is a bearish liquidity sweep , often followed by a mean reversion or a downward move.
Display Customization:
To declutter the chart, traders can choose to hide Fibonacci levels and only display overbought/oversold zones along with the trend-following midline and mean reversion signals. This option enables a clearer focus on key reversal areas without additional distractions.
🔵 CUSTOMIZATION
Period Length: Adjust the length of the smoothed moving average for more reactive or smoother bands.
Channel Width: Customize the width of the Fibonacci channel.
Fibonacci Ratios: Customize the Fibonacci ratios to reflect personal preference or unique market behaviors.
Future Projection Extension: Set the number of bars to extend Fibonacci bands, allowing flexibility in projecting price levels.
Hide Fibonacci Levels: Toggle the visibility of Fibonacci levels for a cleaner chart focused on overbought/oversold regions and midline trend signals.
Liquidity Sweep: Toggle the visibility of Liquidity Sweep points
The Fibonacci Band indicator provides traders with an advanced framework for analyzing market structure, liquidity sweeps, and trend reversals. By integrating Fibonacci-based levels with trend detection and mean reversion signals, this tool offers a robust approach to navigating dynamic price action and finding high-probability trading opportunities.
Pita dan Kanal
FRIEDRICHs - AI learning trendFRIEDRICHs learning trend - take your trading to the NEXT LEVEL!
Introducing the AI learning trend, an advanced trading indicator designed to adapt to market volatility dynamically using machine learning techniques. This indicator employs Clustering to categorize market volatility into high, medium, and low levels, enhancing the traditional SuperTrend strategy. Perfect for traders who want an edge in identifying trend shifts and market conditions.
What is Clustering and how it works?
Clustering is a machine learning algorithm that partitions data into distinct groups based on similarity. In this indicator, the algorithm analyzes ATR (Average True Range) values to classify volatility into three clusters: high, medium, and low. The algorithm iterates to optimize the centroids of these clusters, ensuring accurate volatility classification.
BTC:
1PAPA7ozQe7QdK2HNSsaPaAwMJnLP2nig1
Network: BTC
XRP:
rNxp4h8apvRis6mJf9Sh8C6iRxfrDWN7AV
MEMO: 393065086
ulasozcalkapBu strateji, finansal piyasalarda daha bilinçli ve kârlı işlemler yapmanızı sağlamak amacıyla tasarlanmıştır. Stratejimiz, detaylı teknik analiz, doğru risk yönetimi ve sabırlı bir yaklaşımı bir araya getirerek, kullanıcıların tutarlı kazançlar elde etmesine yardımcı olmayı hedefler.
Stratejinin temel mantığı, fiyat hareketlerindeki önemli trendleri ve dönüş noktalarını belirlemek üzerine kuruludur. Bunun için strateji, belirli göstergeler ve kriterler temelinde işlem sinyalleri üretir. Ancak unutmayın, bu sinyallerin etkinliği, piyasadaki mevcut koşullara bağlı olarak değişiklik gösterebilir. Bu nedenle, stratejiyi kullanırken şunlara dikkat etmeniz çok önemlidir:
Doğru Risk Yönetimi: Her işlemde riskinizi kontrol altında tutmalısınız. Yatırdığınız sermayenin küçük bir kısmını riske atarak, olası kayıpların büyümesini önleyebilirsiniz. Stop-loss ve take-profit seviyelerini dikkatle belirlemek bu sürecin kritik bir parçasıdır.
Sabır ve Disiplin: Piyasada kazanç sağlamak hızlı değil, sürdürülebilir bir süreçtir. Sabırlı olun ve stratejinin önerdiği sinyalleri acele etmeden değerlendirin. Hatalı işlemlerden kaçınmak için planınıza sadık kalın.
Piyasa Dinamiklerini Takip Edin: Strateji, mevcut piyasa koşullarına göre optimize edilmiştir, ancak finansal piyasalar sürekli değişir. Bu nedenle, ekonomik gelişmeleri, haberleri ve teknik göstergelerin uyumunu yakından takip edin.
Demo Hesapta Test Edin: Yeni bir stratejiyi uygulamadan önce mutlaka demo hesapta test ederek performansını ölçün. Gerçek para ile işlem yapmadan önce stratejiyi anlamak ve kendinize güven kazanmak çok önemlidir.
Bu strateji, profesyonel veya yeni başlayan tüm yatırımcılar için bir rehber niteliği taşır. Ancak unutulmaması gereken önemli bir nokta, hiçbir stratejinin %100 başarı garantisi sunmadığıdır. Finansal piyasalarda risk her zaman vardır. Bu nedenle stratejiyi bir araç olarak görmeli ve kendi analizlerinizle desteklemelisiniz.
Elde edeceğiniz başarı, stratejiyi ne kadar doğru kullandığınıza ve disiplini ne ölçüde koruduğunuza bağlıdır. Kazançlı ve sürdürülebilir işlemler için bu stratejiye güvenebilirsiniz. Ancak riskin her zaman bir parçası olduğunu unutmayarak, kararlarınızı buna göre şekillendirin. Başarılar dileriz! 🚀
GMMA Fill smsm egmiThe modified Gamma Fill tool is good for trading but be careful. It is better to use it with another strategy. I wish everyone the best.
High Probability BreakoutThis indicator calculates the level importance by binning the historical price range and then aggregates occurrence of fractals weighted by the power of the trend the reversal point stopped. Later the indicator detects blocks of high importanc levels, and the action zones between them. When price crosses trough a block of high importance levels aka Support or Resistance zones, the indicator filters out the signal based on the breaker and verification candle structure, the ratios in the settings are out of 1.
Bollinger Bands na otkateИндикатор на основе полос Боллинджера (Bollinger Bands) генерирует сигналы на покупку или продажу в зависимости от определенных условий.
Полосы Боллинджера:
Основная полоса (Basis):
Рассчитывается как скользящее среднее цены (SMA).
Пользователь может настроить длину (BB length), которая определяет период расчета (20).
Верхняя и нижняя линии (Upper и Lower):
Вычисляются на основе стандартного отклонения (Standard Deviation) с заданным множителем (2).
Верхняя линия: basis + dev, нижняя линия: basis - dev.
Экспоненциальная скользящая средняя (EMA):
EMA (200):
Дополнительно рассчитывается EMA для фильтрации сигналов.
Показывается на графике, если включен параметр Show EMA.
Если включен параметр Use EMA in Signals, EMA используется как дополнительное условие для сигналов:
Лонг (покупка) допускается, если цена находится выше EMA.
Шорт (продажа) допускается, если цена находится ниже EMA.
Логика сигналов на лонг (покупка):
Текущее условие (currentBarLongCondition):
Свеча пробила нижнюю линию полос Боллинджера снизу вверх.
Условие по предыдущим барам (previousBarCondition):
Проверяется, были ли закрытия выше верхней линии полос Боллинджера за последние Number of previous bars to check баров.
Итоговый сигнал:
Если оба условия выполнены, формируется сигнал на покупку (Long Signal).
Логика сигналов на шорт (продажа):
Текущее условие (currentBarShortCondition):
Свеча пробила верхнюю линию полос Боллинджера сверху вниз.
Условие по предыдущим барам (previousBarCondition_2):
Проверяется, были ли закрытия ниже нижней линии полос Боллинджера за последние Number of previous bars to checkбаров.
Итоговый сигнал:
Если оба условия выполнены, формируется сигнал на продажу (Short Signal).
Визуализация:
График полос Боллинджера:
Верхняя, нижняя и базовая линии отображаются на графике.
Между линиями добавлены заливки для визуального удобства:
Между основой и верхней линией – цветовая заливка сверху.
Между основой и нижней линией – цветовая заливка снизу.
EMA:
Отображается, если включен параметр Show EMA.
Генерация сигналов:
Сигналы на лонг и шорт визуализируются на графике в виде меток (Long и Short).
Пользователь может выбрать, какие сигналы отображать, с помощью параметра Show:
Только лонги (Longs Only).
Только шорты (Shorts Only).
Оба типа сигналов (Both).
Уведомления:
Настраиваются через функцию alertcondition, чтобы пользователь мог получать уведомления о сигналах в режиме реального времени.
Ключевые параметры настройки:
BB length : Период расчета полос Боллинджера.
Standard Deviation : Множитель для расчета стандартного отклонения.
Number of previous bars to check : Количество предыдущих баров для анализа.
Show EMA : Показывать/скрывать EMA на графике.
Use EMA in Signals : Использовать EMA как фильтр для сигналов.
Trade Type : Выбор отображаемых сигналов (лонг, шорт, оба).
Einfaches Fibonacci-RetracementDieser Indikator ist sehr simpel, kann aber mögliche Retracemants vom letzten Tief bis zum nächsten High berechnen und mehr oder weniger sauber anzeigen...
Viel Spaß beim ausprobieren... ist mein erster größerer Versuch und mit ChatGPT nachgeholfen ;)
Kann gerne kopiert werden...
LG Rafi
jebreil mahmoudiComprehensive Script Explanation
This Pine Script integrates various features aimed at providing real-time insights for traders, with a focus on market opening dynamics, daily levels, Fibonacci retracement, swing highs and lows, and multi-asset comparisons. Below is a detailed breakdown:
1. Market Opening Candle and Daily High/Low Levels:
Market Open Identification: The script identifies the first candle of the market session (using the user's local time settings), marking it as the reference point for further analysis.
High/Low for the First 18 Candles: The highest and lowest price points between the market open (first candle) and the 18th candle after it are tracked. This allows traders to observe key support and resistance levels based on the early price action.
Previous Day Close: The close of the previous day is plotted as a reference for comparing how the current session opens relative to the previous session's close.
2. Plotting Fibonacci Levels:
Fibonacci retracement levels are drawn based on the previous day’s price action. The key Fibonacci levels, such as 50% and 70.5%, are used to identify possible support and resistance zones. These levels are crucial for predicting potential price retracements or reversals.
3. Swing Highs and Lows:
Swing Highs and Swing Lows are detected automatically. These points are marked on the chart to help traders identify potential turning points in the market.
The Swing Highs and Lows give insights into where price may change direction and help traders understand the market’s overall trend.
4. RSI for Multiple Assets:
RSI (Relative Strength Index) indicators for Bitcoin, Ethereum, and the S&P 500 are plotted near the chart. This allows traders to compare the relative strength of each asset and spot overbought or oversold conditions.
The RSI of each asset is displayed near the price chart, making it easier to track momentum shifts across different markets.
5. ADX for Trend Strength:
The ADX (Average Directional Index) indicator is used to gauge the strength of the trend. When the market is trending strongly, the candles change color to reflect this trend, signaling traders to align their trades with the prevailing market direction.
A strong trend is indicated by a high ADX value, while a weak or consolidating market shows a low ADX value.
6. Support/Resistance Levels Based on Market Structure:
The script automatically draws support and resistance lines based on recent price action and Fibonacci levels. These lines help traders quickly spot key levels for potential entries or exits, and provide an easy-to-follow roadmap for price targets.
By analyzing previous price highs and lows, the script adjusts support and resistance zones as the market evolves.
7. Stop-Hunt Zones:
The script identifies Stop-Hunt Zones, areas where the price is likely to trigger stop losses before reversing. These zones often represent areas where liquidity is hunted, providing traders with an opportunity to anticipate potential reversals or breakouts.
8. Cross-Asset Comparison:
By comparing multiple assets (such as Bitcoin, Ethereum, and S&P 500), traders can see how the performance of one asset correlates with others. This is particularly useful when trading cryptocurrencies or other assets that often correlate with each other.
Cross-asset analysis helps traders make decisions based not just on one asset but also considering broader market movements, leading to more informed trading decisions.
9. Daily High and Low Levels:
The script calculates and displays the high and low levels of the current trading day, as well as previous day's high/low levels. These levels provide insight into where the price might reverse or continue its movement.
Daily High/Low levels act as key support and resistance markers, helping traders make decisions based on how current prices compare to these critical price levels.
10. RSI Coloring:
The RSI value changes color based on its level: red when the RSI is nearing overbought (near 65), green when nearing oversold (near 35), and blue in neutral conditions. This provides traders with quick visual cues on the strength and direction of market momentum.
11. Additional Indicators for Enhanced Analysis:
Bollinger Bands: These are plotted with high contrast colors for clear visibility. Bollinger Bands help traders assess market volatility and overbought/oversold conditions.
Moving Averages (EMA50, SMA100, EMA200): These averages are plotted to identify the overall trend direction and to support entry and exit decisions based on crossovers.
Long/Short Labels: Small labels indicating Long or Short positions are shown on the chart, offering immediate trade setup insights.
Why This Script Is Valuable:
Efficient Decision-Making: The script helps traders save time by automatically identifying key levels such as the first candle's high/low, Fibonacci levels, and daily highs/lows. This allows for faster decision-making.
Comprehensive Market Overview: The multi-asset analysis (Bitcoin, Ethereum, S&P 500) provides traders with a broader view of market sentiment, enabling them to spot correlations and adjust their strategies accordingly.
Real-Time Intraday Analysis: This script is perfect for intraday traders, as it gives a real-time view of market movements, especially the first 18 candles after the market open.
Support for Volatile Markets: The script is well-suited for markets like cryptocurrencies, which are highly volatile. By marking key price levels, stop-hunt zones, and using momentum indicators like RSI and ADX, traders can adapt quickly to volatile conditions.
Trend Identification: The ADX indicator, combined with moving averages and RSI, makes it easier for traders to identify strong trends, giving them confidence in taking positions aligned with the prevailing market direction.
By incorporating analysis from the market opening candle through to daily high/low points, and considering Fibonacci levels, RSI, and ADX indicators, this script provides a robust and holistic view of the market, making it ideal for active traders in both volatile and trending markets.
N-Degree Moment-Based Adaptive Detection🙏🏻 N-Degree Moment-Based Adaptive Detection (NDMBAD) method is a generalization of MBAD since the horizontal line fit passing through the data's mean can be simply treated as zero-degree polynomial regression. We can extend the MBAD logic to higher-degree polynomial regression.
I don't think I need to talk a lot about the thing there; the logic is really the same as in MBAD, just hit the link above and read if you want. The only difference is now we can gather cumulants not only from the horizontal mean fit (degree = 0) but also from higher-order polynomial regression fit, including linear regression (degree = 1).
Why?
Simply because residuals from the 0-degree model don't contain trend information, and while in some cases that's exactly what you need, in other cases, you want to model your trend explicitly. Imagine your underlying process trends in a steady manner, and you want to control the extreme deviations from the process's core. If you're going to use 0-degree, you'll be treating this beautiful steady trend as a residual itself, which "constantly deviates from the process mean." It doesn't make much sense.
How?
First, if you set the length to 0, you will end up with the function incrementally applied to all your data starting from bar_index 0. This can be called the expanding window mode. That's the functionality I include in all my scripts lately (where it makes sense). As I said in the MBAD description, choosing length is a matter of doing business & applied use of my work, but I think I'm open to talk about it.
I don't see much sense in using degree > 1 though (still in research on it). If you have dem curves, you can use Fourier transform -> spectral filtering / harmonic regression (regression with Fourier terms). The job of a degree > 0 is to model the direction in data, and degree 1 gets it done. In mean reversion strategies, it means that you don't wanna put 0-degree polynomial regression (i.e., the mean) on non-stationary trending data in moving window mode because, this way, your residuals will be contaminated with the trend component.
By the way, you can send thanks to @aaron294c , he said like mane MBAD is dope, and it's gonna really complement his work, so I decided to drop NDMBAD now, gonna be more useful since it covers more types of data.
I wanned to call it N-Order Moment Adaptive Detection because it abbreviates to NOMAD, which sounds cool and suits me well, because when I perform as a fire dancer, nomad style is one of my outfits. Burning Man stuff vibe, you know. But the problem is degree and order really mean two different things in the polynomial context, so gotta stay right & precise—that's the priority.
∞
Multi-Strategy Profit SeekerThe Multi-Strategy Profit Seeker™ indicator is a powerful and flexible TradingView tool designed to help traders optimize their strategies across different market conditions. With adjustable modes for Scalping, Swing Trading, and Long-Term Investing, this indicator provides tailored insights for traders of all styles.
joes this indicator uses ema's to show the distances between price using colours to show how greatly price action has changed
London Breakout Scalping StrategyThis strategy is designed to capture price movements during the early London session (00:00-03:00 UTC) using Bollinger Bands and support/resistance levels. It implements a systematic approach to scalping with defined entry, exit, and risk management rules.
Key Features:
• Time-based filtering (00:00-03:00)
• Dynamic support and resistance levels
• Bollinger Bands (20, 2) for volatility-based entries
• 2:1 reward-to-risk ratio (10 pips target, 5 pips stop loss)
Entry Conditions:
Long: Price breaks above upper Bollinger Band while respecting support level
Short: Price breaks below lower Bollinger Band while respecting resistance level
Exit Rules:
• Take Profit: 2x the stop loss distance
• Stop Loss: 5 pips from entry
• Additional exit: Middle Bollinger Band crossover
Risk Management:
• Fixed position sizing (1% of account equity)
• Precise stop loss and take profit levels
• Early session trading only to capture optimal volatility
Recommended Timeframe: 1-5 minute charts
Best Suited For: Major forex pairs
You can modify the code below to select your own breakout window
// Time window settings for session (00:00 - 03:00)
inTradeWindow = (hour >= 0 and hour < 3)
Note: Past performance is not indicative of future results. Always test the strategy thoroughly on your chosen instrument and timeframe before trading live.
Adaptive Kalman filter - Trend Strength Oscillatortrend finder thats about it, used for identifying trends
EMA Trend Signal5 EMAs, um einen kompletten Trend zu signalisieren.
Im Chart farblich ausgefüllt, wenn der Trend komplett ist
Die EMA-Plos sind rot odcer grün- je nach bullischer oder bärischer Lage der einzelnen EMA
Es können feste Zeiten eingetragen werden, wann ein Signal erwünscht ist, das es ertönt.
Per Alarm kann dann auch ein Webhook hinterlegt werden, automatisch einen Trade auszulösen.
Der Signalgeber wurde für TradeAutomationToolbox für den 0DTE SPX-Handel gecodet.
Good Luck !
BTC - Power Law Oscillator with Dynamic Bands# BTC - Power Law Oscillator with Dynamic Bands
Introducing the **BTC - Power Law Oscillator with Dynamic Bands**, a cutting-edge TradingView indicator designed to help traders identify key market conditions for Bitcoin using mathematical modeling and statistical insights. Here's everything you need to know:
## 🎯 Key Features:
1. **Power Law Oscillator**: Tracks Bitcoin's deviation from an exponential growth model since its inception (January 3, 2009). This oscillator provides insights into BTC's price positioning relative to historical trends.
2. **Dynamic Bands**: Automatically calculates upper and lower percentile bands to identify overbought and oversold conditions dynamically, based on recent oscillator values.
3. **Customizable Percentiles**: Users can adjust the upper and lower percentile thresholds to fine-tune the overbought/oversold zones according to their trading strategy.
4. **Visual Highlights**: Easily spot key zones with color-coded background highlighting:
- 🔴 **Overbought**: Oscillator exceeds the upper band.
- 🟢 **Oversold**: Oscillator falls below the lower band.
## 📈 How It Works:
- The indicator computes Bitcoin's model price using an **exponential growth formula**:
\
- The **Power Law Oscillator** measures the percentage deviation of the actual BTC price from this model.
- Upper and lower bands are derived from the oscillator's historical percentiles, dynamically adjusting based on the last 200 bars (default setting).
## 🛠️ Customization Options:
- **Percentile Calculation Period**: Set the number of bars used for percentile calculations.
- **Upper Percentile**: Default at 95% for identifying extreme overbought conditions.
- **Lower Percentile**: Default at 45% for pinpointing oversold conditions.
## 📊 Use Cases:
- Spot reversal points in extreme market conditions.
- Monitor Bitcoin's behavior relative to long-term growth trends.
- Enhance your trading strategy with dynamic overbought/oversold zones.
Samadhaan All in OneSamadhaan all in one indicator works in all time frame.
Trade samadhaan with buy and sell signal.
Short Term Stop Loss Clusters
The script identifies potential stop-loss clusters by analyzing swing points and volume
Uses a dynamic strength calculation based on volume and recency of the level
Visualizes clusters using horizontal lines with varying opacity
Implements efficient array management to prevent memory issues
Uses input parameters for customization
Chiến lược của tôi//@version=5
indicator('RSI Lạc Quan Tếu 2.2', 'R 2.2', format=format.price, max_bars_back=252)
// Input
group_rsi1 = 'Thông số RSI "tăng động"'
group_rsi2 = 'Thông số RSI "bình tĩnh"'
group_tinhieu = 'Thông số tín hiệu quán tính'
rsic=input.source(close, title="Nguồn giá trị RSI")
//RSI "tăng động"
lenrsi = input.int(14, minval=1, title='RSI "tăng động"', group = group_rsi1)
rsi = ta.rsi(rsic, lenrsi)
lenwma = input.int(45, minval=1, title='WMA-Trung bình chậm', group = group_rsi1)
wma_45 = ta.wma(rsi, lenwma)
lenema = input.int(9, minval=1, title='EMA-Trung bình nhanh', group = group_rsi1)
ema_9 = ta.ema(rsi, lenema)
//RSI "bình tĩnh"
lenma = input.int(3, minval=1, title='RSI "bình tĩnh"', group = group_rsi2)
smooth = input.int(4, 'Hệ số làm mượt', minval=2, group = group_rsi2)
rsic2= ta.sma(rsi, lenma)
rsi2 = ta.linreg(rsic2, smooth, 0)
displacement = input.int(2, minval=1, title='Mức độ "bình tĩnh"', group = group_rsi2)
//tin hieu
//////////////////////////////////////////////////
nguontinhieu = input.string('RSI tăng động', 'Nguồn tín hiệu', options= , group = group_tinhieu)
float rsix = switch nguontinhieu
'RSI tăng động' => ta.rsi(rsic, lenrsi)
'RSI bình tĩnh' => ta.linreg(rsic2, smooth, 0)
///////////////////////////////////////////////////////////////////
overboughtlevel = input.int(75 ,title='Ngưỡng quá mua', group = group_tinhieu)
oversoldlevel = input.int(25 ,title='Ngưỡng quá bán', group = group_tinhieu)
heso = input.int(3, title = 'Độ chính xác', group = group_tinhieu)
upBar = close > open
downBar = close < open
threeUpBars = math.sum(upBar ? 1 : 0, heso) == heso
threeDownBars = math.sum(downBar ? 1 : 0, heso) == heso
overbought = rsix > overboughtlevel and threeUpBars
oversold = rsix < oversoldlevel and threeDownBars
// isup = (ta.crossover(rsi2, overboughtlevel))
// isdn = (ta.crossunder(rsi2, oversoldlevel))
// overboughtcolor = isup ? #ffd90050 :na
// oversoldcolor = isdn ? #ffd90050 :na
//bool isup = (ta.crossover(rsi, ema_9) or ta.crossover(rsi, wma_45)) and (rsi > ema_9) and (rsi > wma_45)
//bool isdn = (ta.crossunder(rsi, ema_9) or ta.crossunder(rsi, wma_45)) and (rsi < ema_9) and (rsi < wma_45)
// isup = rsi > ema_9 and rsi > wma_45
// isdn = rsi < ema_9 and rsi < wma_45
// -Plot ======================================================================================== //
// Duong ke ngang
p1 = hline(80, color=color.red, title='Vùng mua mạnh', linestyle=hline.style_dotted, linewidth=1)
p2 = hline(70, color=color.rgb(255, 82, 82, 30), title='Vùng mua yếu', linestyle=hline.style_dotted, linewidth=1)
l50 = hline(50, color=color.rgb(255, 251, 0), title='Line 50', linestyle=hline.style_dashed, linewidth=1)
p3 = hline(30, color=color.rgb(255, 82, 82, 30), title='Vùng bán yếu', linestyle=hline.style_dotted, linewidth=1) p4 = hline(20, color=color.red, title='Vùng bán mạnh', linestyle=hline.style_dotted, linewidth=1)
fa1 = hline(90, color=color.rgb(255, 255, 255), linestyle=hline.style_dotted, linewidth=1, title='Line tùy chọn 1', display=display.none)
fa2 = hline(66.66, color=color.rgb(0, 89, 255, 30), linestyle=hline.style_dotted, linewidth=1, title='Line tùy chọn 2')
fa3 = hline(60, color=color.rgb(0, 89, 255), linestyle=hline.style_dotted, linewidth=1, title='Line tùy chọn 3')
fa4 = hline(40, color=color.rgb(0, 89, 255), linestyle=hline.style_dotted, linewidth=1, title='Line tùy chọn 4')
fa5 = hline(33.33, color=color.rgb(0, 89, 255, 30), linestyle=hline.style_dotted, linewidth=1, title='Line tùy chọn 5')
fa6 = hline(10, color=color.rgb(255, 255, 255), linestyle=hline.style_dotted, linewidth=1, title='Line tùy chọn 6', display=display.none)
// RSI
prsi = plot(rsi, color=color.new(#a0a0a0, 30), style=plot.style_line, linewidth=1, title='RSI "tăng động"')
prsi2 = plot(rsi2, offset = -displacement +1, color=color.new(#dbb300, 20), style=plot.style_line, linewidth=2, title='RSI "bình tĩnh"')
h_50 = plot(50, color=color.new(#4caf4f, 50), style=plot.style_line, linewidth=1, title='Line 50', display=display.none)
p45 = plot(wma_45, color=color.rgb(179, 0, 0), style=plot.style_line, linewidth=1, title='WMA - Trung bình chậm')
p9 = plot(ema_9, color=color.new(#00b906, 0), style=plot.style_line, linewidth=1, title='EMA - Trung bình nhanh')
//mau tich luy
fill(prsi2, p45, color = rsi2 > wma_45 ? color.rgb(255, 82, 82, 60) : color.rgb(0, 187, 212, 60), title='Màu tích lũy')
fill(p1, p2, color= color.rgb(255, 230, 0, 90) , title='Màu vùng mua')
fill(p3, p4, color= color.rgb(255, 230, 0, 90) , title='Màu vùng bán')
//mau tin hieu
plotshape(series = overbought , style=shape.diamond, location=location.top,
color=color.rgb(0, 255, 115, 20), size=size.tiny, title = 'Tín hiệu tăng')
plotshape(series = oversold , style=shape.diamond, location=location.bottom,
color=color.rgb(255, 0, 43, 20), size=size.tiny, title = 'Tín hiệu giảm')
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// POSITION AND SIZE
PosTable = input.string(defval="Middle Left", title="Vị trí bảng",
options= ,
group="Thông số bảng RSI")
SizTable = input.string(defval="Small", title="Kích thước", options= , group="Thông số bảng RSI")Pos1Table = PosTable == "Top Right" ? position.top_right : PosTable == "Middle Right" ? position.middle_right : PosTable == "Bottom Right" ? position.bottom_right : PosTable == "Top Center" ? position.top_center : PosTable == "Middle Center" ? position.middle_center : PosTable == "Bottom Center" ? position.bottom_center : PosTable == "Top Left" ? position.top_left : PosTable == "Middle Left" ? position.middle_left : position.bottom_left
Siz1Table = SizTable == "Auto" ? size.auto : SizTable == "Huge" ? size.huge : SizTable == "Large" ? size.large : SizTable == "Normal" ? size.normal : SizTable == "Small" ? size.small : size.tiny
tablecellcolor = input.color (color.rgb(0, 0, 0), title = 'Màu nền bảng')
tableframecolor = input.color (color.rgb(0, 0, 0), title = 'Màu khung bảng')
tableupcolor = input.color (color.rgb(7, 85, 0), title = 'Màu nền tăng')
tabledowncolor = input.color (color.rgb(110, 0, 0), title = 'Màu nền giảm')
textupcolor = input.color (color.rgb(0, 155, 0), title = 'Màu chữ tăng')
textdowncolor = input.color (color.rgb(185, 0, 0), title = 'Màu chữ giảm')
tbl = table.new(Pos1Table, 2, 8, frame_width=2, frame_color = tableframecolor, border_width=1, border_color = tableframecolor)
// TIMEFRAMES OPTIONS
box01 = input.bool(true, "Khung ", inline = "01", group="Chon Khung Thoi Gian")
Khung01 = input.timeframe("1", "", inline = "01", group="Chon Khung Thoi Gian")
box02 = input.bool(true, "Khung ", inline = "02", group="Chon Khung Thoi Gian")
Khung02 = input.timeframe("5", "", inline = "02", group="Chon Khung Thoi Gian")
box03 = input.bool(true, "Khung ", inline = "03", group="Chon Khung Thoi Gian")
Khung03 = input.timeframe("15", "", inline = "03", group="Chon Khung Thoi Gian")
box04 = input.bool(true, "Khung ", inline = "04", group="Chon Khung Thoi Gian")
Khung04 = input.timeframe("60", "", inline = "04", group="Chon Khung Thoi Gian")
box05 = input.bool(true, "Khung ", inline = "05", group="Chon Khung Thoi Gian")
Khung05 = input.timeframe("240", "", inline = "05", group="Chon Khung Thoi Gian")
box06 = input.bool(true, "Khung ", inline = "06", group="Chon Khung Thoi Gian")
Khung06 = input.timeframe("1D", "", inline = "06", group="Chon Khung Thoi Gian")
box07 = input.bool(true, "Khung ", inline = "07", group="Chon Khung Thoi Gian")
Khung07 = input.timeframe("1W", "", inline = "07", group="Chon Khung Thoi Gian")
// DEFINITION OF VALUES
symbol = ticker.modify(syminfo.tickerid, syminfo.session)
KhungArr = array.new(na)
rsiArr = array.new(na)
wmaArr = array.new(na)
emaArr = array.new(na)
// DEFINITIONS OF RSI & WMA & WMA APPENDED IN THE TIMEFRAME OPTIONS
rsiNmaFun(Khung, flg) =>
= request.security(symbol, Khung, )
// if flg and (barstate.isrealtime ? true : timeframe.in_seconds(timeframe.period) <= timeframe.in_seconds(Khung))if flg ? true : timeframe.in_seconds(timeframe.period) <= timeframe.in_seconds(Khung)
// array.push(KhungArr, na(Khung) ? timeframe.period : Khung)
array.push(KhungArr, Khung)
array.push(rsiArr, rsit)
array.push(wmaArr, wmat)
array.push(emaArr, emat)
rsiNmaFun(Khung01, box01), rsiNmaFun(Khung02, box02), rsiNmaFun(Khung03, box03), rsiNmaFun(Khung04, box04),
rsiNmaFun(Khung05, box05), rsiNmaFun(Khung06, box06), rsiNmaFun(Khung07, box07)
// TABLE AND CELLS CONFIG
// Post Timeframe in format
KhungTxt(x)=>
out = x
if not str.contains(x, "S") and not str.contains(x, "M") and
not str.contains(x, "W") and not str.contains(x, "D")
if str.tonumber(x)%60 == 0
out := str.tostring(str.tonumber(x)/60)+"H"
else
out := x + "m"
out
if barstate.islast
// table.clear(tbl, 0, 0, 2, 7)
// TITLES
// table.cell(tbl, 0, 0, "⏱", text_color=#FFFFFF, text_size=Siz1Table, bgcolor=#000000)
// table.cell(tbl, 0, 1, "RSI", text_color=#FFFFFF, text_size=Siz1Table, bgcolor=#000000)
// table.cell(tbl, 0, 2, "%K", text_color=#FFFFFF, text_size=Siz1Table, bgcolor=#000000)
j = 1
if array.size(rsiArr) > 0
for i = 0 to array.size(rsiArr) - 1
if not na(array.get(rsiArr, i))
//config values in the cells
Khung_VALUE = array.get(KhungArr,i)
RSI_VALUE = array.get(rsiArr, i)
WMA_VALUE = array.get(wmaArr, i)
EMA_VALUE = array.get(emaArr, i)
// SIGNAL =
AynetBox 2 Timeframe StrategyThis Pine Script code defines a strategy called "AynetBox 2 Timeframe Strategy".
1. Timeframe Inputs
The user can manually select two different timeframes (tf1 and tf2).
These inputs are minute-based, with the following options: 1, 3, 5, 15, 30, 60, 120, 240, 360, 720.
2. AynetBox Calculation
AynetBox tracks price movements within a specific range (e.g., 125 USD).
The function compares the current price with the previous AynetBox level to check if the price has moved up or down by at least the specified box_size.
If the price exceeds this threshold:
A new AynetBox level is set.
The trend (current_trend) is assigned as upward (+1) or downward (-1).
3. Date and Time Filtering
The user can manually configure the start (fromDay, fromMonth, fromYear) and end dates (toDay, toMonth, toYear).
The time_cond variable ensures the strategy operates only within the specified date range.
4. Multi-Timeframe Calculation
Based on the timeframes selected by the user (e.g., tf1 = 60, tf2 = 240), separate AynetBox calculations are performed for each timeframe.
tf1Counter and tf2Counter:
These counters track the elapsed time in each timeframe.
When the counter reaches the length of the specified timeframe, it resets, and the AynetBox level is updated.
5. Plotting and Visualization
The plot() function draws the AynetBox levels for both timeframes:
The first timeframe is plotted in light blue (#3C8CE0), and the second in dark red (#FF4A68).
fill() function:
Fills the area between the two timeframes.
If tf1 value is greater than tf2, the fill is in blue shades; otherwise, it is in red shades.
6. Signals and Trading Logic
Long Signal:
Triggered when tf1AynetBox crosses above tf2AynetBox.
Short Signal:
Triggered when tf1AynetBox crosses below tf2AynetBox.
Small dots (plotchar) mark the signal points on the chart.
The strategy automatically enters positions based on the signal (strategy.entry):
strategy.long for long signals and strategy.short for short signals.
7. Visual Additions
A title is added to the top-right corner using a table:
It displays "AynetBox 2 Timeframe Strategy."
This code allows users to track price movements within specified date ranges and two different timeframes, using the AynetBox logic. The intersections between the two timeframes form the basis for generating signals.
RVWAP ENHANCED**Rolling VWAP with Alerts and Markers**
This Pine Script indicator enhances the traditional Rolling VWAP (Relative Volume Weighted Average Price) by adding dynamic features for improved visualization and alerting.
### Features:
1. **Dynamic VWAP Line Coloring**:
- The VWAP line changes color based on the relationship with the closing price:
- **Green** when the price is above the VWAP.
- **Red** when the price is below the VWAP.
2. **Candle and Background Coloring**:
- **Candles**: Colored green if the close is above the VWAP and red if below.
- **Background**: Subtle green or red shading indicates the price’s position relative to the VWAP.
3. **Alerts**:
- Alerts notify users when the VWAP changes direction:
- "VWAP Turned Green" for price crossing above the VWAP.
- "VWAP Turned Red" for price crossing below the VWAP.
4. **Small Dot Markers**:
- Tiny dots are plotted below the candles to mark VWAP state changes:
- **Green dot** for VWAP turning green.
- **Red dot** for VWAP turning red.
5. **Custom Time Period**:
- Users can select either a dynamic time period based on the chart's timeframe or a fixed time period (customizable in days, hours, and minutes).
6. **Standard Deviation Bands (Optional)**:
- Standard deviation bands around the VWAP can be enabled for further analysis.
This script is designed to provide clear and actionable insights into market trends using the RVWAP, making it an excellent tool for traders who rely on volume-based price action analysis.
Consecutive Up/Down Strategy//@version=5
strategy("Consecutive Up/Down Strategy", overlay=true)
// Parameters to set the number of consecutive candles
consecutive_up = input.int(3, title="Consecutive Up Candles", minval=1)
consecutive_down = input.int(3, title="Consecutive Down Candles", minval=1)
// Define the up and down candles
up_candle = close > open
down_candle = close < open
// Count consecutive up and down candles
up_count = 0
down_count = 0
// Loop through past bars to count consecutive up and down candles
if up_candle
up_count := up_count + 1
down_count := 0
else
up_count := 0
if down_candle
down_count := down_count + 1
up_count := 0
else
down_count := 0
// Define the conditions for the strategy
long_condition = up_count >= consecutive_up
short_condition = down_count >= consecutive_down
// Enter trades based on conditions
if long_condition
strategy.entry("Long", strategy.long)
if short_condition
strategy.entry("Short", strategy.short)
// Plot signals on the chart
plotshape(series=long_condition, title="Long Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=short_condition, title="Short Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")