One-Minute Pivot Trading SystemOne-Minute Pivot Trading System for TradingView
This indicator calculates and displays pivot points based on the last 100 one-minute candles. It is designed for scalping and short-term trading, helping traders identify key price levels efficiently.
Features:
✅ Dynamic Pivot Calculation:
The pivot point is calculated based on the previous candle's high, low, and close values.
Updates every new 1-minute candle to reflect the latest market conditions.
✅ Pivot Point Display:
Only the last 100 pivot points are stored and plotted to keep the chart clean.
Automatically removes old pivot points beyond the last 100 candles.
✅ Efficient Line Management:
Uses dynamic line handling to delete outdated pivot lines.
Ensures a clear and updated visual representation of pivot levels.
Usage:
This indicator is ideal for traders who rely on short-term support and resistance levels.
It helps in scalping strategies by marking key price levels in real time.
Can be used in combination with trend indicators to refine trade entries and exits.
💡 Best for traders looking for real-time pivot point tracking on a 1-minute timeframe. 🚀
This description is optimized for TradingView. Let me know if you need any modifications! 😊
المؤشرات والاستراتيجيات
DMI (ADX, DI+ & DI-) with Buy SignalThere is the signal generating using adx. where we are using di- and di+ parameters and also using adx with certaing crossover.
RoGr75 - EMA 50/8 Cross With Buy/Sell Signals RoGr75 - EMA 50/8 Cross With Buy/Sell Signals
---
**Overview:**
This script is designed to generate **Buy** and **Sell** signals based on the crossover and crossunder of two Exponential Moving Averages (EMAs): **EMA 8** (green line) and **EMA 50** (blue line). The signals are plotted at a user-defined distance from the candles, ensuring clear visibility and adaptability to market volatility.
---
**Key Features:**
1. **EMA Cross Signals**:
- A **Buy Signal** is generated when the **EMA 8** crosses above the **EMA 50**.
- A **Sell Signal** is generated when the **EMA 8** crosses below the **EMA 50**.
2. **Variable Signal Distance**:
- The distance of the Buy and Sell signals from the candles is controlled by a **user-defined input** (`signal_distance`).
- The distance is calculated using the **Average True Range (ATR)** to adapt to market volatility.
3. **Customizable Parameters**:
- `signal_distance`: Adjust the distance of the signals from the candles (default: 2.0).
- ATR period: Fixed at 14 but can be modified in the script.
4. **Visual Enhancements**:
- Buy signals are displayed as green labels below the candles.
- Sell signals are displayed as red labels above the candles.
- Optional background highlighting for Buy and Sell signals.
---
**How It Works:**
- The script calculates the **EMA 8** and **EMA 50** and plots them on the chart.
- When a crossover or crossunder occurs, a label is placed at a distance determined by the formula:
- **Buy Signal Position**: `low - (signal_distance * ATR(14))`
- **Sell Signal Position**: `high + (signal_distance * ATR(14))`
- The signals are clearly visible and adapt to the volatility of the asset.
---
**Input Parameters:**
- `signal_distance` (type: input float): Controls the distance of the Buy and Sell signals from the candles. Default value is `2.0`.
---
**Usage:**
1. Add the script to your chart in TradingView.
2. Adjust the `signal_distance` input to set the desired distance of the signals from the candles.
3. Monitor the Buy and Sell signals generated by the script for potential trading opportunities.
---
**Example:**
- If `signal_distance` is set to `2.0`, the Buy signal will appear **2x ATR** below the candle's low, and the Sell signal will appear **2x ATR** above the candle's high.
---
**Customization:**
- Modify the ATR period or replace it with a fixed value for static distance.
- Adjust the colors, styles, and sizes of the labels and EMAs to suit your preferences.
---
**Ideal For:**
- Traders looking for a simple and effective EMA crossover strategy.
- Users who want customizable signal placement for better visibility.
- Those who prefer volatility-adjusted signal distances.
---
**Note:**
This script is for educational and informational purposes only. Always backtest and validate strategies before using them in live trading.
Enhanced Buy/Sell Signals with Confirmation(Bobbin Thomas)Usage Notes:
Buy Signals (Green Triangles) appear when:
Fast EMA crosses above Slow EMA
RSI crosses back above 30 (oversold recovery)
MACD line crosses above signal line
Price is above both EMAs (uptrend confirmation)
Sell Signals (Red Triangles) appear when:
Fast EMA crosses below Slow EMA
RSI crosses below 70 (overbought rejection)
MACD line crosses below signal line
Price is below both EMAs (downtrend confirmation)
This conservative approach helps filter out false signals by requiring alignment between trend direction (EMAs), momentum (MACD), and market strength (RSI). For best results, use on daily or weekly charts and combine with fundamental analysis.
Z RSI Trendlines BreakoutThe RSI Trendline Breakout Indicator is a technical analysis tool designed to identify potential trend reversals and breakout opportunities using Relative Strength Index (RSI) trendlines. This indicator automatically plots trendlines on RSI based on pivot highs and lows and provides breakout signals when RSI crosses these trendlines.
Support, Resistance and Median with Trend"This Pine Script indicator, 'Support, Resistance and Median with Trend', offers traders a comprehensive view of market dynamics using key technical analysis principles.
Key Features:
Dynamic Support and Resistance: The script calculates and plots support and resistance levels based on the highest highs and lowest lows over a customizable historical period.
Median Line: A median line is plotted between support and resistance, serving as a key reference for price action.
Trend Detection: The indicator determines the current trend by comparing the closing price to the median line, offering a simple yet effective trend identification method.
Visual Trend Indicator: A color-coded box in the top-right corner displays the current trend (Uptrend, Downtrend, or Neutral), providing at-a-glance trend information.
Level Projections: The script projects support, resistance, and median levels into future periods, helping traders anticipate potential price movements.
Customization: Users can adjust the historical length for calculations, allowing for fine-tuning based on individual trading styles and timeframes.
withoutfaking Advanced charts readerFeatures:
1. Multi-Timeframe Adaptive:
- Triple EMA system (21/50/200) identifies macro/micro trends
- ADX filter ensures trades only in strong momentum phases
2. Elliott Wave Integration:
- Proprietary EWO (Elliott Wave Oscillator) with signal line
- Detects wave 3 acceleration and wave 5 exhaustion
3. Smart Money Detection:
- Volume-weighted MFI filters false breakouts
- Combined with Stochastic for precision timing
4. Adaptive Alerts:
- Multi-condition confluence required for signals
- Self-adjusting to any timeframe (1m - monthly)
Usage:
- Day Trading: Use on 5-15m charts with tighter EMA settings
- Swing Trading: Apply on 1H-4H with default parameters
- Investing: Weekly/Monthly charts with 50/200 EMA cross
Signal Logic:
- Entries require 5/34 EWO cross + EMA alignment + volume confirmation
- Exits trigger at opposing MFI extreme + EMA flip
Risk Management:
- Bullish signals invalidate below 21 EMA
- Bearish signals cancel above 50 EMA
This system combines institutional flow analysis with technical patterns, designed to adapt to both mean-reverting and trending markets.
Simplified MA Crossover Strategy with toggle RSI/ATR options1. Strategy Overview
MA Crossover Logic: The strategy uses two simple moving averages (short and long) to generate buy/sell signals.
Buy Signal: When the short MA crosses above the long MA.
Sell Signal: When the short MA crosses below the long MA.
Filters: The strategy includes optional RSI and ATR filters to refine entry conditions.
Risk Management: Includes stop-loss, take-profit, and position sizing based on a percentage of equity.
2. Inputs
MA Lengths:
shortLength: Length of the short MA (default: 9).
longLength: Length of the long MA (default: 21).
RSI Filter:
enableRSI: Toggle to enable/disable the RSI filter.
rsiLength: RSI calculation period (default: 14).
rsiOverbought: Overbought threshold (default: 70).
rsiOversold: Oversold threshold (default: 30).
ATR Filter:
enableATR: Toggle to enable/disable the ATR filter.
atrLength: ATR calculation period (default: 14).
minATR: Minimum ATR threshold for trade entry (default: 0.005).
Risk Management:
stopLossPerc: Stop-loss percentage (default: 0.5%).
riskRewardRatio: Risk-reward ratio for take-profit calculation (default: 2).
riskPercentage: Percentage of equity to risk per trade (default: 2%).
3. Indicators
Moving Averages:
shortMA: Short-term simple moving average.
longMA: Long-term simple moving average.
RSI: Relative Strength Index for filtering overbought/oversold conditions.
ATR: Average True Range for volatility filtering.
4. Trade Conditions
Long Condition:
Short MA crosses above the long MA.
RSI is below the overbought level (if RSI filter is enabled).
ATR is above the minimum threshold (if ATR filter is enabled).
Short Condition:
Short MA crosses below the long MA.
RSI is above the oversold level (if RSI filter is enabled).
ATR is above the minimum threshold (if ATR filter is enabled).
5. Risk Management
Position Sizing:
positionSize: Calculated based on the percentage of equity to risk and the stop-loss level.
Take-Profit and Stop-Loss:
takeProfitLevel: Calculated using the risk-reward ratio.
stopLossLevel: Calculated using the stop-loss percentage.
6. Trade Execution
Long Entry:
Triggers when the long condition is met.
Sets a take-profit and stop-loss level.
Short Entry:
Triggers when the short condition is met.
Sets a take-profit and stop-loss level.
7. Plotting
Moving Averages:
Short MA (blue) and Long MA (red) are plotted on the chart.
RSI Levels:
Overbought (red) and oversold (green) levels are plotted as horizontal lines.
ATR:
ATR is plotted in orange.
Trade Signals:
Buy signals are marked with a green "BUY" label below the bar.
Sell signals are marked with a red "SELL" label above the bar.
8. Customization
You can adjust the input parameters (e.g., MA lengths, RSI/ATR settings, risk management values) to suit your trading preferences.
Disable/enable filters (RSI and ATR) using the enableRSI and enableATR inputs.
9. Notes
This strategy is designed for educational purposes and should be thoroughly tested before use in live trading.
Consider optimizing the parameters (e.g., MA lengths, RSI/ATR thresholds) for specific markets or timeframes.
Ensure proper backtesting and forward testing to evaluate performance under different market conditions.
Support and Resistance Levels with RSI BlackBoxMix Support and Resistance Levels with RSI
Этот индикатор предназначен для отображения уровней поддержки и сопротивления на графике, а также использования индикатора RSI (Relative Strength Index) для оценки состояния рынка (перекупленность или перепроданность). Он помогает трейдерам принимать обоснованные решения на основе важных технических уровней и анализа силы тренда.
Pro Scalper Indicator//@version=5
indicator("Pro Scalper Indicator", overlay=true)
// Parameters
fastEMA = input(9, title="Fast EMA")
slowEMA = input(21, title="Slow EMA")
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought")
rsiOversold = input(30, title="RSI Oversold")
volFilter = input(false, title="Enable Volume Filter")
// Calculations
emaFast = ta.ema(close, fastEMA)
emaSlow = ta.ema(close, slowEMA)
rsi = ta.rsi(close, rsiLength)
volumeAvg = ta.sma(volume, 20)
// Buy & Sell Conditions
buySignal = ta.crossover(emaFast, emaSlow) and rsi < rsiOverbought
sellSignal = ta.crossunder(emaFast, emaSlow) and rsi > rsiOversold
// Apply volume filter if enabled
buySignal := volFilter ? buySignal and volume > volumeAvg : buySignal
sellSignal := volFilter ? sellSignal and volume > volumeAvg : sellSignal
// Plot Buy & Sell Signals
plotshape(buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
plotshape(sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")
// Plot EMAs
plot(emaFast, color=color.blue, title="Fast EMA")
plot(emaSlow, color=color.orange, title="Slow EMA")
// Alerts
alertcondition(buySignal, title="Buy Signal", message="Pro Scalper: Buy Signal!")
alertcondition(sellSignal, title="Sell Signal", message="Pro Scalper: Sell Signal!")
Cripto🟢🟠Veterano v1.0"Cripto🟢🟠Veterano v1.0 es un indicador que te ayuda a identificar entradas y salidas en el mercado de criptomonedas. usando estadísticas e inteligencia artificial.
Solo funciona en temporalidades de 5 minutos. El usuario solo debe esperar las entradas y tomarlas, basándose en señales precisas de soporte, resistencia, RSI y EMAs. Además, el indicador se actualizará a medida que pasa el tiempo.
Si deseas hacer una donación, esta es la dirección de TRON EN USDT:
TVdQYjPr11j3PLSTx7KQcCH4abRFqPLEUE
CONFIGURACIÓN:
Vela Izquierda y Derecha: 73
Extensión de Soporte y Resistencia: 0
Número Máximo de Soporte y Resistencia: 8
Colores:
Rectángulo (0.20): Rosado
Rectángulo (-0120): Rosado
Condiciones:
Caída Extrema: Caída extrema
Cambio de Texto: Subida extrema
Colores de Caída y Subida Extrema: Gris
EMA:
Período de EMA 1: 200
Desactivar las demás EMAs
Kalman Filter Trend BreakersKalman filter is a recursive algorithm that has been invented in the 1960s to track a moving target, remove any noisy measurements of its position and predict its future position.
In trading, KF might be a good replacement for a moving average, as it reacts to price changes in a different way. Not only it follows price direction, but can also track the velocity of price changes. This specific behaviour of KF is used in this indicator to track changes in trends.
Trend is characterized by price moving directionally, however, any trend comes to pause or complete stop and reversal, as the price changes more slowly (a trend fades into a sideways movement for a while) or the price movement changes direction, thus making a reversal.
This indicator detects the points where such changes occur (trend breaker points), and produces signals, which serve as points of current trend pausing or reversing. By applying different settings for KF calculation, you can produce less or more signals that indicate change in trend character, and either detect only significant trends changes, or less and shorter trends changes as well.
The signals do not differentiate the exact type of a trend change (it can be a brief trend pause followed by a continuation, as well as a complete reversal). However, once you are in a trend, the significant velocity change indicates a change in trend structure. In this sense, trend breaker signals should not be followed blindly, and can be used only as trend (and position) exit confirmations, but not the entry contrarian confirmations.
For better visual representation, you can use chart signals attached to bars, and additionally a vertical gradient which shows significant trend velocity change.
Triple Trend Indicator [BigBeluga]Triple Trend Indicator is a versatile trend-following tool designed to help traders identify trend strength and potential pullback levels using a three-band system. Each band represents a varying degree of price deviation from the mean, providing progressively stronger trend signals.
🔵 Key Features:
Three Adaptive Bands:
The indicator dynamically calculates three bands (1, 2, and 3) based on moving averages (SMA, EMA, WMA) and ATR multipliers.
Bands are positioned below the price in an uptrend and above the price in a downtrend, offering clear trend direction visualization.
Signal System:
Signals are generated when price interacts with the bands:
Signal 1: Triggered when the price touches Band 1, indicating a minor pullback within the trend.
Signal 2: Triggered at Band 2, showing a stronger price deviation and trend confirmation.
Signal 3: Triggered at Band 3, representing the most significant price deviation and strongest trend signal.
The further the price deviates from the mean, the stronger the trend signal, with Signal 3 being the most robust.
Color-Coded Bands:
Bands dynamically change color based on the trend direction:
Green bands signify an uptrend.
Brown bands signify a downtrend.
Dynamic Trend Line Changes:
Dashed lines highlight trend changes, helping traders visualize key turning points in the market.
🔵 Usage:
Use the bands to identify trend direction and strength.
Monitor the signal system to assess the level of price deviation and potential pullback strength.
Combine Signal 1, 2, and 3 to confirm trend momentum:
Signal 1 suggests a weaker pullback and continuation.
Signal 2 indicates a stronger trend confirmation.
Signal 3 highlights the strongest momentum and potential exhaustion points.
Utilize the color-coded bands for an intuitive understanding of current market conditions.
The Triple Trend Indicator is an ideal tool for trend traders looking for structured signals and dynamic support and resistance levels to optimize entries and exits.
Timeframe Levels for Price Action📖 Introduction
Timeframe Levels Indicator is a powerful tool for identifying key support and resistance zones based on historical price action. By plotting weekly, daily, and 4-hour closing levels, this indicator helps traders understand where price is likely to:
✅ Range & Consolidate – Identify congestion zones where price action stalls.
✅ Break & Expand – Spot areas where price can rapidly move to the next level.
✅ Form MMXM Structures – Find market maker expansion and distribution levels.
These levels are critical for traders looking to anticipate price action, identify high-probability trade setups, and manage risk effectively.
The indicator dynamically plots historical close price levels across three key timeframes:
✅ Weekly Close Levels – Identify key levels based on weekly closes.
✅ Daily Close Levels – Spot daily open/close levels for refined entries.
✅ 4-Hour Close Levels – Track intra-day significant price points.
⚙️ How It Works
This indicator retrieves and displays the past 10 close levels for each selected timeframe using request.security().
🔹 Lines are customizable – Adjust the number of lines per timeframe (0-10).
🔹 Dynamic styling – Choose colors and line styles (solid, dashed, or dotted).
🔹 Extend historical levels – Lines extend across the chart for easy visualization.
🎨 Customization Options
🔧 Timeframe Selection: Choose how many weekly, daily, and 4-hour levels to display.
🎨 Color Settings: Customize the colors for each timeframe.
📏 Line Styles: Select between solid, dashed, or dotted lines for better visibility.
📊 Why Use This Indicator?
✅ Identify Key Support & Resistance Zones – Track where price has historically reacted.
✅ Adapt to Any Trading Style – Works for scalping, swing trading, and long-term investing.
✅ Enhance Multi-Timeframe Analysis – Quickly compare price action across different timeframes.
📊 How This Helps You Trade
✔ Pinpoint Key Trading Levels – Use past close levels to identify major market turning points.
✔ Confirm Ranges & Expansions – Understand whether price is likely to consolidate or break into a new trend by evaluating the next level above or below.
✔ Optimize Entries & Exits – Avoid getting trapped in congestion zones and capitalize on breakout opportunities. The more overlapping lines, the more congestion.
✔ Backtest Historical Reactions – See how price has responded to these levels in the past to refine your strategy. As price breaks out, any daily or 4 hour level will slow down the continued momentum.
🛠 How to Use
1️⃣ Add the indicator to your TradingView chart.
2️⃣ Adjust the number of levels per timeframe (Weekly, Daily, 4-Hour).
3️⃣ Customize the line colors and styles to match your chart preferences.
4️⃣ Observe how price reacts to historical levels and plan your trades accordingly.
📜 Code Highlights : What Makes This Indicator Powerful?
This Multi-Timeframe Open/Close Levels Indicator is built with dynamic customization, efficiency, and structured market insights in mind. Here are some key highlights of the code:
The script fetches historical closing prices from three critical timeframes:
✅ Weekly Close Levels (W) – Major swing levels for long-term positioning.
✅ Daily Close Levels (D) – Useful for intraday and swing trading.
✅ 4-Hour Close Levels (240) – Ideal for short-term traders and scalpers.
Each timeframe’s close levels act as dynamic support and resistance zones, helping traders spot key areas for price reactions and liquidity grabs.
The indicator retrieves and stores up to 10 past close levels using request.security(), making it easy to track key price points without lagging the chart.
✅ Uses bar_index to extend levels both left and right.
✅ Ensures proper deletion and redrawing of lines to prevent clutter.
✅ Automatically updates levels as new bars print.
Instead of storing all lines at once, the script:
⚡ Deletes old lines before redrawing new ones.
⚡ Uses var line to ensure memory efficiency.
⚡ Prevents exceeding TradingView's 10,000-cell limit by limiting the number of stored lines.
This results in a smooth, non-laggy experience even with multiple timeframes displayed.
The levels plotted by this indicator help traders:
📊 Identify consolidation zones where price might range.
🚀 Spot breakout areas where price expands to the next key level.
📉 Recognize market maker structures (MMXM) to predict liquidity grabs.
These insights give traders a strategic edge in planning their entries, exits, and trade management.
Final Thoughts
This indicator is a powerful tool for traders looking to integrate historical price levels into their strategy.
Whether you’re a scalper, a day trader, or a swing trader, this indicator provides valuable insights into where price is likely to range, reverse, or break out.
Don’t trade blind—trade with structure. Use this tool to refine your entries, exits, and risk management, and start making more confident trading decisions today!
📌 Interested in accessing this indicator? 📩 Contact me for details!
Ayebale - Trading - Bot (5min Tune)This Pine Script v5 strategy is designed to trade on a 5‑minute timeframe using a combination of technical indicators and session filtering, with enhanced visual feedback through on‐chart tables. Here’s an overview of its main components and functionality:
Input Settings and Visuals:
The script defines color inputs for bullish and bearish signals as well as for fair value gap (FVG) markings.
Parameters such as the ATR period, ATR multiplier for stop-loss, and a series of take-profit (TP) multipliers are adjustable to fine-tune the strategy for short-term (5‑minute) trading.
ATR and Price Levels:
A shorter ATR period is used to calculate volatility, which then determines the stop-loss distance and take-profit levels.
The highest high and lowest low over the last 20 bars are computed to help generate entry signals.
Fair Value Gap (FVG) Detection:
The script checks for conditions where a “gap” exists between previous bars (a bullish or bearish fair value gap).
If a fair value gap is detected, it can trigger entry signals. FVG zones are drawn on the chart with high transparency for subtle visual reference.
Session Timing Based on Nairobi Time (UTC+3):
Session start and end times for London, New York, and Tokyo are defined using the "Africa/Nairobi" timezone.
A helper function determines whether each session is “Ongoing,” “Not Started,” or “Ended” based on the current time, and calculates the remaining time until the next session start.
Trading is enabled only when at least one of these sessions is “Ongoing,” and the strategy is further restricted to weekdays (Monday to Friday).
Entry and Exit Logic:
The strategy generates buy signals when the close crosses over the recent low or when a bullish FVG is identified; conversely, it generates sell signals when the close crosses under the recent high or a bearish FVG is detected.
For each trade signal, the code enters 5 orders (each with varying TP levels calculated using the ATR and TP multipliers) and sets the stop-loss based on the ATR multiplied by the user-defined multiplier.
Trade Information Table (Bottom Right):
A trade information table is created with 2 columns by 9 rows.
Each row is dedicated to a specific trade metric:
Row 0: Trade side (e.g., “BUY NOW” or “SELL NOW”)
Row 1: Entry price
Rows 2–6: Five TP levels (TP1 to TP5)
Row 7: Stop-loss level
Row 8: Timer showing the elapsed time since the trade entry
The table updates dynamically based on trade executions and includes conditional cell background colors (for example, highlighting TP levels when certain conditions are met).
Session Information Table (Top Right):
A separate table displays session information, including the session name, its current status (with dynamic background colors: red for “Ended,” orange for “Not Started,” and dark green for “Ongoing”), and the time remaining in the session.
Overall Strategy Behavior:
The strategy only executes trades when the market is active during one or more of the specified sessions and only on trading days (Monday to Friday).
It is tuned for a 5‑minute chart, with more reactive ATR and TP levels suitable for short-term trading.
This comprehensive script not only defines a technical trading strategy but also provides real-time visual feedback and session-based filtering, making it a robust tool for traders who operate on short timeframes and need clear, dynamic information on trade performance and market sessions.
Enhanced Fibonacci Growth Strategy with 20% Target in 5 DaysSummary: Enhanced Fibonacci Growth Strategy with 20% Target in 5 Days
The Enhanced Fibonacci Growth Strategy is a trading script designed to help traders grow their initial capital by 20% over a span of 5 consecutive days. This strategy is based on the Fibonacci retracement levels, moving average trend confirmation, and dynamic risk management using ATR (Average True Range). The script is optimized for a long-only approach, focusing on identifying buy opportunities that align with Fibonacci retracement levels and confirmed trends, while managing risk through stop loss, take profit, and daily drawdown limits.
Key Features:
1. Fibonacci Retracement & Extension Levels:
• The strategy uses Fibonacci levels (38.2%, 50%, 61.8%, and 161.8%) to identify entry points. The script calculates these levels based on the highest high and lowest low over the last 100 bars, plotting the key retracement levels for easy visualization.
2. Moving Average (MA) for Trend Confirmation:
• The strategy ensures that trades are in line with the prevailing market trend by using a simple moving average (SMA). Only positions that are above the moving average are considered, ensuring that the market is trending upwards.
3. Risk Management with ATR:
• Stop loss and take profit levels are dynamically set using ATR, adjusting for volatility. The stop loss is multiplied by a user-defined multiplier, and the take profit level is similarly adjusted, providing efficient risk-reward ratios based on market conditions.
4. Position Sizing:
• Position size is calculated dynamically based on the trader’s equity and the distance to the stop loss. This allows for scalable risk management, where the amount risked per trade is a percentage of the trader’s total equity.
5. Daily Drawdown Limit:
• The strategy includes a daily drawdown limit of $1,500 to protect capital. If the drawdown exceeds this threshold, all positions are closed to prevent further losses on that day.
6. Targeted Account Growth:
• The primary goal is to grow the initial capital by 20% over 5 consecutive trading days. The script tracks daily equity growth and ensures that once the target is achieved, all positions are closed, and a message is displayed to notify the trader that the goal has been reached.
7. Trade Frequency:
• To avoid overtrading, the strategy limits the number of trades per day to a user-defined maximum (e.g., 5 trades), helping to focus on high-quality setups.
8. Exit Strategy:
• Trades are exited either when the take profit or stop loss levels are hit. If the trade drawdown exceeds the specified amount, the trade is closed early to minimize potential losses.
How to Use:
• Inputs: The strategy offers several adjustable inputs:
• Fibonacci Levels: Adjust the retracement and extension levels to customize the Fibonacci tool.
• Risk Settings: Fine-tune position sizing, stop loss, take profit, and daily drawdown limits to align with your risk tolerance.
• Equity Growth Target: Set the desired daily percentage target for account growth.
• Execution: Once the strategy is activated, it will automatically identify potential buy signals based on Fibonacci levels, moving averages, and the ATR-based risk management system. It will execute trades accordingly, managing risk dynamically and protecting capital.
Benefits:
• Automated Risk Management: By using ATR for stop loss and take profit, this strategy adapts to changing market conditions.
• Scalable: The script adjusts position sizes based on your equity and risk factors, allowing for flexibility.
• Growth Focused: The 20% growth target over 5 days ensures a disciplined approach to growing capital while limiting excessive risk.
Best For:
• Traders who want to use Fibonacci retracements as a foundation for trading strategies.
• Those seeking a structured approach to growing a trading account with controlled risk management.
• Traders who prefer automated solutions for dynamic position sizing, exit strategies, and daily drawdown protection.
By following this strategy, traders can focus on high-quality setups while letting the script handle risk management, position sizing, and capital growth targets.
Nextone Daily RangeShow daily range in lower timeframes.
It shows a box for the high and low of the day and an arrow for the open and close of the day with green and red colours.
MACD with Candle DisplayMACD Calculation:
Uses user-defined Fast Length, Slow Length, and Signal Smoothing parameters to compute MACD.
Supports SMA (Simple Moving Average) or EMA (Exponential Moving Average) for the MACD line and signal line
Histogram-Based Candle Coloring:
The script categorizes histogram bars into four states:
0 (Very Bullish) → Green
1 (Likely Bearish) → Blue
2 (Likely Bullish) → Orange
3 (Very Bearish) → Red
Histogram Plot:
Displays histogram bars with distinct colors based on price momentum changes.
Market Sentiment Display in Status Line & Price Scale:
Instead of adding a label on the chart (which could obstruct candles), a text display is shown in the price scale and status line:
"0 Very Bullish"
"1 Likely Bearish"
"2 Likely Bullish"
"3 Very Bearish"
The text appears in the top-right corner with white font on a black background.
Purpose:
This indicator enhances the standard MACD by incorporating candle coloring and a cleaner sentiment display in the price scale, helping traders quickly interpret market momentum without cluttering the chart.
Bull vs Bear CandlesThe Bull vs Bear Candles indicator helps you analyze market sentiment by counting and comparing bullish and bearish candles. It tracks the number of bullish candles and calculates their percentage, then does the same for bearish candles. Based on this data, the indicator determines whether bulls or bears are in control. Additionally, it counts the total number of candles within the selected range, giving you a clearer picture of price action. Use this tool to quickly assess market trends and make more informed trading decisions. 🚀
Smart Money Concepts [Nitin]//@version=5
indicator("Smart Money Concepts ", "Smart Money Concepts "
, overlay = true
, max_labels_count = 500
, max_lines_count = 500
, max_boxes_count = 500
, max_bars_back = 500)
//-----------------------------------------------------------------------------{
//Constants
//-----------------------------------------------------------------------------{
color TRANSP_CSS = #ffffff00
//Tooltips
string MODE_TOOLTIP = 'Allows to display historical Structure or only the recent ones'
string STYLE_TOOLTIP = 'Indicator color theme'
string COLOR_CANDLES_TOOLTIP = 'Display additional candles with a color reflecting the current trend detected by structure'
string SHOW_INTERNAL = 'Display internal market structure'
string CONFLUENCE_FILTER = 'Filter non significant internal structure breakouts'
string SHOW_SWING = 'Display swing market Structure'
string SHOW_SWING_POINTS = 'Display swing point as labels on the chart'
string SHOW_SWHL_POINTS = 'Highlight most recent strong and weak high/low points on the chart'
string INTERNAL_OB = 'Display internal order blocks on the chart Number of internal order blocks to display on the chart'
string SWING_OB = 'Display swing order blocks on the chart Number of internal swing blocks to display on the chart'
string FILTER_OB = 'Method used to filter out volatile order blocks It is recommended to use the cumulative mean range method when a low amount of data is available'
string SHOW_EQHL = 'Display equal highs and equal lows on the chart'
string EQHL_BARS = 'Number of bars used to confirm equal highs and equal lows'
string EQHL_THRESHOLD = 'Sensitivity threshold in a range (0, 1) used for the detection of equal highs & lows Lower values will return fewer but more pertinent results'
string SHOW_FVG = 'Display fair values gaps on the chart'
string AUTO_FVG = 'Filter out non significant fair value gaps'
string FVG_TF = 'Fair value gaps timeframe'
string EXTEND_FVG = 'Determine how many bars to extend the Fair Value Gap boxes on chart'
string PED_ZONES = 'Display premium, discount, and equilibrium zones on chart'
//-----------------------------------------------------------------------------{
//Settings
//-----------------------------------------------------------------------------{
//General
//----------------------------------------{
mode = input.string('Historical'
, options =
, group = 'Smart Money Concepts'
, tooltip = MODE_TOOLTIP)
style = input.string('Colored'
, options =
, group = 'Smart Money Concepts'
, tooltip = STYLE_TOOLTIP)
show_trend = input(false, 'Color Candles'
, group = 'Smart Money Concepts'
, tooltip = COLOR_CANDLES_TOOLTIP)
//----------------------------------------}
//Internal Structure
//----------------------------------------{
show_internals = input(true, 'Show Internal Structure'
, group = 'Real Time Internal Structure'
, tooltip = SHOW_INTERNAL)
show_ibull = input.string('All', 'Bullish Structure'
, options =
, inline = 'ibull'
, group = 'Real Time Internal Structure')
swing_ibull_css = input(#089981, ''
, inline = 'ibull'
, group = 'Real Time Internal Structure')
//Bear Structure
show_ibear = input.string('All', 'Bearish Structure'
, options =
, inline = 'ibear'
, group = 'Real Time Internal Structure')
swing_ibear_css = input(#f23645, ''
, inline = 'ibear'
, group = 'Real Time Internal Structure')
ifilter_confluence = input(false, 'Confluence Filter'
, group = 'Real Time Internal Structure'
, tooltip = CONFLUENCE_FILTER)
//----------------------------------------}
//Swing Structure
//----------------------------------------{
show_Structure = input(true, 'Show Swing Structure'
, group = 'Real Time Swing Structure'
, tooltip = SHOW_SWING)
//Bull Structure
show_bull = input.string('All', 'Bullish Structure'
, options =
, inline = 'bull'
, group = 'Real Time Swing Structure')
swing_bull_css = input(#089981, ''
, inline = 'bull'
, group = 'Real Time Swing Structure')
//Bear Structure
show_bear = input.string('All', 'Bearish Structure'
, options =
, inline = 'bear'
, group = 'Real Time Swing Structure')
swing_bear_css = input(#f23645, ''
, inline = 'bear'
, group = 'Real Time Swing Structure')
//Swings
show_swings = input(false, 'Show Swings Points'
, inline = 'swings'
, group = 'Real Time Swing Structure'
, tooltip = SHOW_SWING_POINTS)
length = input.int(50, ''
, minval = 10
, inline = 'swings'
, group = 'Real Time Swing Structure')
show_hl_swings = input(true, 'Show Strong/Weak High/Low'
, group = 'Real Time Swing Structure'
, tooltip = SHOW_SWHL_POINTS)
//----------------------------------------}
//Order Blocks
//----------------------------------------{
show_iob = input(true, 'Internal Order Blocks'
, inline = 'iob'
, group = 'Order Blocks'
, tooltip = INTERNAL_OB)
iob_showlast = input.int(5, ''
, minval = 1
, inline = 'iob'
, group = 'Order Blocks')
show_ob = input(false, 'Swing Order Blocks'
, inline = 'ob'
, group = 'Order Blocks'
, tooltip = SWING_OB)
ob_showlast = input.int(5, ''
, minval = 1
, inline = 'ob'
, group = 'Order Blocks')
ob_filter = input.string('Atr', 'Order Block Filter'
, options =
, group = 'Order Blocks'
, tooltip = FILTER_OB)
ibull_ob_css = input.color(color.new(#3179f5, 80), 'Internal Bullish OB'
, group = 'Order Blocks')
ibear_ob_css = input.color(color.new(#f77c80, 80), 'Internal Bearish OB'
, group = 'Order Blocks')
bull_ob_css = input.color(color.new(#1848cc, 80), 'Bullish OB'
, group = 'Order Blocks')
bear_ob_css = input.color(color.new(#b22833, 80), 'Bearish OB'
, group = 'Order Blocks')
//----------------------------------------}
//EQH/EQL
//----------------------------------------{
show_eq = input(true, 'Equal High/Low'
, group = 'EQH/EQL'
, tooltip = SHOW_EQHL)
eq_len = input.int(3, 'Bars Confirmation'
, minval = 1
, group = 'EQH/EQL'
, tooltip = EQHL_BARS)
eq_threshold = input.float(0.1, 'Threshold'
, minval = 0
, maxval = 0.5
, step = 0.1
, group = 'EQH/EQL'
, tooltip = EQHL_THRESHOLD)
//----------------------------------------}
//Fair Value Gaps
//----------------------------------------{
show_fvg = input(false, 'Fair Value Gaps'
, group = 'Fair Value Gaps'
, tooltip = SHOW_FVG)
fvg_auto = input(true, "Auto Threshold"
, group = 'Fair Value Gaps'
, tooltip = AUTO_FVG)
fvg_tf = input.timeframe('', "Timeframe"
, group = 'Fair Value Gaps'
, tooltip = FVG_TF)
bull_fvg_css = input.color(color.new(#00ff68, 70), 'Bullish FVG'
, group = 'Fair Value Gaps')
bear_fvg_css = input.color(color.new(#ff0008, 70), 'Bearish FVG'
, group = 'Fair Value Gaps')
fvg_extend = input.int(1, "Extend FVG"
, minval = 0
, group = 'Fair Value Gaps'
, tooltip = EXTEND_FVG)
//----------------------------------------}
//Previous day/week high/low
//----------------------------------------{
//Daily
show_pdhl = input(false, 'Daily'
, inline = 'daily'
, group = 'Highs & Lows MTF')
pdhl_style = input.string('⎯⎯⎯', ''
, options =
, inline = 'daily'
, group = 'Highs & Lows MTF')
pdhl_css = input(#2157f3, ''
, inline = 'daily'
, group = 'Highs & Lows MTF')
//Weekly
show_pwhl = input(false, 'Weekly'
, inline = 'weekly'
, group = 'Highs & Lows MTF')
pwhl_style = input.string('⎯⎯⎯', ''
, options =
, inline = 'weekly'
, group = 'Highs & Lows MTF')
pwhl_css = input(#2157f3, ''
, inline = 'weekly'
, group = 'Highs & Lows MTF')
//Monthly
show_pmhl = input(false, 'Monthly'
, inline = 'monthly'
, group = 'Highs & Lows MTF')
pmhl_style = input.string('⎯⎯⎯', ''
, options =
, inline = 'monthly'
, group = 'Highs & Lows MTF')
pmhl_css = input(#2157f3, ''
, inline = 'monthly'
, group = 'Highs & Lows MTF')
//----------------------------------------}
//Premium/Discount zones
//----------------------------------------{
show_sd = input(false, 'Premium/Discount Zones'
, group = 'Premium & Discount Zones'
, tooltip = PED_ZONES)
premium_css = input.color(#f23645, 'Premium Zone'
, group = 'Premium & Discount Zones')
eq_css = input.color(#b2b5be, 'Equilibrium Zone'
, group = 'Premium & Discount Zones')
discount_css = input.color(#089981, 'Discount Zone'
, group = 'Premium & Discount Zones')
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
n = bar_index
atr = ta.atr(200)
cmean_range = ta.cum(high - low) / n
//HL Output function
hl() =>
//Get ohlc values function
get_ohlc()=> [close , open , high, low, high , low ]
//Display Structure function
display_Structure(x, y, txt, css, dashed, down, lbl_size)=>
structure_line = line.new(x, y, n, y
, color = css
, style = dashed ? line.style_dashed : line.style_solid)
structure_lbl = label.new(int(math.avg(x, n)), y, txt
, color = TRANSP_CSS
, textcolor = css
, style = down ? label.style_label_down : label.style_label_up
, size = lbl_size)
if mode == 'Present'
line.delete(structure_line )
label.delete(structure_lbl )
//Swings detection/measurements
swings(len)=>
var os = 0
upper = ta.highest(len)
lower = ta.lowest(len)
os := high > upper ? 0 : low < lower ? 1 : os
top = os == 0 and os != 0 ? high : 0
btm = os == 1 and os != 1 ? low : 0
//Order block coordinates function
ob_coord(use_max, loc, target_top, target_btm, target_left, target_type)=>
min = 99999999.
max = 0.
idx = 1
ob_threshold = ob_filter == 'Atr' ? atr : cmean_range
//Search for highest/lowest high within the structure interval and get range
if use_max
for i = 1 to (n - loc)-1
if (high - low ) < ob_threshold * 2
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
else
for i = 1 to (n - loc)-1
if (high - low ) < ob_threshold * 2
min := math.min(low , min)
max := min == low ? high : max
idx := min == low ? i : idx
array.unshift(target_top, max)
array.unshift(target_btm, min)
array.unshift(target_left, time )
array.unshift(target_type, use_max ? -1 : 1)
//Set order blocks
display_ob(boxes, target_top, target_btm, target_left, target_type, show_last, swing, size)=>
for i = 0 to math.min(show_last-1, size-1)
get_box = array.get(boxes, i)
box.set_lefttop(get_box, array.get(target_left, i), array.get(target_top, i))
box.set_rightbottom(get_box, array.get(target_left, i), array.get(target_btm, i))
box.set_extend(get_box, extend.right)
color css = na
if swing
if style == 'Monochrome'
css := array.get(target_type, i) == 1 ? color.new(#b2b5be, 80) : color.new(#5d606b, 80)
border_css = array.get(target_type, i) == 1 ? #b2b5be : #5d606b
box.set_border_color(get_box, border_css)
else
css := array.get(target_type, i) == 1 ? bull_ob_css : bear_ob_css
box.set_border_color(get_box, css)
box.set_bgcolor(get_box, css)
else
if style == 'Monochrome'
css := array.get(target_type, i) == 1 ? color.new(#b2b5be, 80) : color.new(#5d606b, 80)
else
css := array.get(target_type, i) == 1 ? ibull_ob_css : ibear_ob_css
box.set_border_color(get_box, css)
box.set_bgcolor(get_box, css)
//Line Style function
get_line_style(style) =>
out = switch style
'⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
//Set line/labels function for previous high/lows
phl(h, l, tf, css)=>
var line high_line = line.new(na,na,na,na
, xloc = xloc.bar_time
, color = css
, style = get_line_style(pdhl_style))
var label high_lbl = label.new(na,na
, xloc = xloc.bar_time
, text = str.format('P{0}H', tf)
, color = TRANSP_CSS
, textcolor = css
, size = size.small
, style = label.style_label_left)
var line low_line = line.new(na,na,na,na
, xloc = xloc.bar_time
, color = css
, style = get_line_style(pdhl_style))
var label low_lbl = label.new(na,na
, xloc = xloc.bar_time
, text = str.format('P{0}L', tf)
, color = TRANSP_CSS
, textcolor = css
, size = size.small
, style = label.style_label_left)
hy = ta.valuewhen(h != h , h, 1)
hx = ta.valuewhen(h == high, time, 1)
ly = ta.valuewhen(l != l , l, 1)
lx = ta.valuewhen(l == low, time, 1)
if barstate.islast
ext = time + (time - time )*20
//High
line.set_xy1(high_line, hx, hy)
line.set_xy2(high_line, ext, hy)
label.set_xy(high_lbl, ext, hy)
//Low
line.set_xy1(low_line, lx, ly)
line.set_xy2(low_line, ext, ly)
label.set_xy(low_lbl, ext, ly)
//-----------------------------------------------------------------------------}
//Global variables
//-----------------------------------------------------------------------------{
var trend = 0, var itrend = 0
var top_y = 0., var top_x = 0
var btm_y = 0., var btm_x = 0
var itop_y = 0., var itop_x = 0
var ibtm_y = 0., var ibtm_x = 0
var trail_up = high, var trail_dn = low
var trail_up_x = 0, var trail_dn_x = 0
var top_cross = true, var btm_cross = true
var itop_cross = true, var ibtm_cross = true
var txt_top = '', var txt_btm = ''
//Alerts
bull_choch_alert = false
bull_bos_alert = false
bear_choch_alert = false
bear_bos_alert = false
bull_ichoch_alert = false
bull_ibos_alert = false
bear_ichoch_alert = false
bear_ibos_alert = false
bull_iob_break = false
bear_iob_break = false
bull_ob_break = false
bear_ob_break = false
eqh_alert = false
eql_alert = false
//Structure colors
var bull_css = style == 'Monochrome' ? #b2b5be
: swing_bull_css
var bear_css = style == 'Monochrome' ? #b2b5be
: swing_bear_css
var ibull_css = style == 'Monochrome' ? #b2b5be
: swing_ibull_css
var ibear_css = style == 'Monochrome' ? #b2b5be
: swing_ibear_css
//Swings
= swings(length)
= swings(5)
//-----------------------------------------------------------------------------}
//Pivot High
//-----------------------------------------------------------------------------{
var line extend_top = na
var label extend_top_lbl = label.new(na, na
, color = TRANSP_CSS
, textcolor = bear_css
, style = label.style_label_down
, size = size.tiny)
if top
top_cross := true
txt_top := top > top_y ? 'HH' : 'LH'
if show_swings
top_lbl = label.new(n-length, top, txt_top
, color = TRANSP_CSS
, textcolor = bear_css
, style = label.style_label_down
, size = size.small)
if mode == 'Present'
label.delete(top_lbl )
//Extend recent top to last bar
line.delete(extend_top )
extend_top := line.new(n-length, top, n, top
, color = bear_css)
top_y := top
top_x := n - length
trail_up := top
trail_up_x := n - length
if itop
itop_cross := true
itop_y := itop
itop_x := n - 5
//Trailing maximum
trail_up := math.max(high, trail_up)
trail_up_x := trail_up == high ? n : trail_up_x
//Set top extension label/line
if barstate.islast and show_hl_swings
line.set_xy1(extend_top, trail_up_x, trail_up)
line.set_xy2(extend_top, n + 20, trail_up)
label.set_x(extend_top_lbl, n + 20)
label.set_y(extend_top_lbl, trail_up)
label.set_text(extend_top_lbl, trend < 0 ? 'Strong High' : 'Weak High')
//-----------------------------------------------------------------------------}
//Pivot Low
//-----------------------------------------------------------------------------{
var line extend_btm = na
var label extend_btm_lbl = label.new(na, na
, color = TRANSP_CSS
, textcolor = bull_css
, style = label.style_label_up
, size = size.tiny)
if btm
btm_cross := true
txt_btm := btm < btm_y ? 'LL' : 'HL'
if show_swings
btm_lbl = label.new(n - length, btm, txt_btm
, color = TRANSP_CSS
, textcolor = bull_css
, style = label.style_label_up
, size = size.small)
if mode == 'Present'
label.delete(btm_lbl )
//Extend recent btm to last bar
line.delete(extend_btm )
extend_btm := line.new(n - length, btm, n, btm
, color = bull_css)
btm_y := btm
btm_x := n-length
trail_dn := btm
trail_dn_x := n-length
if ibtm
ibtm_cross := true
ibtm_y := ibtm
ibtm_x := n - 5
//Trailing minimum
trail_dn := math.min(low, trail_dn)
trail_dn_x := trail_dn == low ? n : trail_dn_x
//Set btm extension label/line
if barstate.islast and show_hl_swings
line.set_xy1(extend_btm, trail_dn_x, trail_dn)
line.set_xy2(extend_btm, n + 20, trail_dn)
label.set_x(extend_btm_lbl, n + 20)
label.set_y(extend_btm_lbl, trail_dn)
label.set_text(extend_btm_lbl, trend > 0 ? 'Strong Low' : 'Weak Low')
//-----------------------------------------------------------------------------}
//Order Blocks Arrays
//-----------------------------------------------------------------------------{
var iob_top = array.new_float(0)
var iob_btm = array.new_float(0)
var iob_left = array.new_int(0)
var iob_type = array.new_int(0)
var ob_top = array.new_float(0)
var ob_btm = array.new_float(0)
var ob_left = array.new_int(0)
var ob_type = array.new_int(0)
//-----------------------------------------------------------------------------}
//Pivot High BOS/CHoCH
//-----------------------------------------------------------------------------{
//Filtering
var bull_concordant = true
if ifilter_confluence
bull_concordant := high - math.max(close, open) > math.min(close, open - low)
//Detect internal bullish Structure
if ta.crossover(close, itop_y) and itop_cross and top_y != itop_y and bull_concordant
bool choch = na
if itrend < 0
choch := true
bull_ichoch_alert := true
else
bull_ibos_alert := true
txt = choch ? 'CHoCH' : 'BOS'
if show_internals
if show_ibull == 'All' or (show_ibull == 'BOS' and not choch) or (show_ibull == 'CHoCH' and choch)
display_Structure(itop_x, itop_y, txt, ibull_css, true, true, size.tiny)
itop_cross := false
itrend := 1
//Internal Order Block
if show_iob
ob_coord(false, itop_x, iob_top, iob_btm, iob_left, iob_type)
//Detect bullish Structure
if ta.crossover(close, top_y) and top_cross
bool choch = na
if trend < 0
choch := true
bull_choch_alert := true
else
bull_bos_alert := true
txt = choch ? 'CHoCH' : 'BOS'
if show_Structure
if show_bull == 'All' or (show_bull == 'BOS' and not choch) or (show_bull == 'CHoCH' and choch)
display_Structure(top_x, top_y, txt, bull_css, false, true, size.small)
//Order Block
if show_ob
ob_coord(false, top_x, ob_top, ob_btm, ob_left, ob_type)
top_cross := false
trend := 1
//-----------------------------------------------------------------------------}
//Pivot Low BOS/CHoCH
//-----------------------------------------------------------------------------{
var bear_concordant = true
if ifilter_confluence
bear_concordant := high - math.max(close, open) < math.min(close, open - low)
//Detect internal bearish Structure
if ta.crossunder(close, ibtm_y) and ibtm_cross and btm_y != ibtm_y and bear_concordant
bool choch = false
if itrend > 0
choch := true
bear_ichoch_alert := true
else
bear_ibos_alert := true
txt = choch ? 'CHoCH' : 'BOS'
if show_internals
if show_ibear == 'All' or (show_ibear == 'BOS' and not choch) or (show_ibear == 'CHoCH' and choch)
display_Structure(ibtm_x, ibtm_y, txt, ibear_css, true, false, size.tiny)
ibtm_cross := false
itrend := -1
//Internal Order Block
if show_iob
ob_coord(true, ibtm_x, iob_top, iob_btm, iob_left, iob_type)
//Detect bearish Structure
if ta.crossunder(close, btm_y) and btm_cross
bool choch = na
if trend > 0
choch := true
bear_choch_alert := true
else
bear_bos_alert := true
txt = choch ? 'CHoCH' : 'BOS'
if show_Structure
if show_bear == 'All' or (show_bear == 'BOS' and not choch) or (show_bear == 'CHoCH' and choch)
display_Structure(btm_x, btm_y, txt, bear_css, false, false, size.small)
//Order Block
if show_ob
ob_coord(true, btm_x, ob_top, ob_btm, ob_left, ob_type)
btm_cross := false
trend := -1
//-----------------------------------------------------------------------------}
//Order Blocks
//-----------------------------------------------------------------------------{
//Set order blocks
var iob_boxes = array.new_box(0)
var ob_boxes = array.new_box(0)
//Delete internal order blocks box coordinates if top/bottom is broken
for element in iob_type
index = array.indexof(iob_type, element)
if close < array.get(iob_btm, index) and element == 1
array.remove(iob_top, index)
array.remove(iob_btm, index)
array.remove(iob_left, index)
array.remove(iob_type, index)
bull_iob_break := true
else if close > array.get(iob_top, index) and element == -1
array.remove(iob_top, index)
array.remove(iob_btm, index)
array.remove(iob_left, index)
array.remove(iob_type, index)
bear_iob_break := true
//Delete internal order blocks box coordinates if top/bottom is broken
for element in ob_type
index = array.indexof(ob_type, element)
if close < array.get(ob_btm, index) and element == 1
array.remove(ob_top, index)
array.remove(ob_btm, index)
array.remove(ob_left, index)
array.remove(ob_type, index)
bull_ob_break := true
else if close > array.get(ob_top, index) and element == -1
array.remove(ob_top, index)
array.remove(ob_btm, index)
array.remove(ob_left, index)
array.remove(ob_type, index)
bear_ob_break := true
iob_size = array.size(iob_type)
ob_size = array.size(ob_type)
if barstate.isfirst
if show_iob
for i = 0 to iob_showlast-1
array.push(iob_boxes, box.new(na,na,na,na, xloc = xloc.bar_time))
if show_ob
for i = 0 to ob_showlast-1
array.push(ob_boxes, box.new(na,na,na,na, xloc = xloc.bar_time))
if iob_size > 0
if barstate.islast
display_ob(iob_boxes, iob_top, iob_btm, iob_left, iob_type, iob_showlast, false, iob_size)
if ob_size > 0
if barstate.islast
display_ob(ob_boxes, ob_top, ob_btm, ob_left, ob_type, ob_showlast, true, ob_size)
//-----------------------------------------------------------------------------}
//EQH/EQL
//-----------------------------------------------------------------------------{
var eq_prev_top = 0.
var eq_top_x = 0
var eq_prev_btm = 0.
var eq_btm_x = 0
if show_eq
eq_top = ta.pivothigh(eq_len, eq_len)
eq_btm = ta.pivotlow(eq_len, eq_len)
if eq_top
max = math.max(eq_top, eq_prev_top)
min = math.min(eq_top, eq_prev_top)
if max < min + atr * eq_threshold
eqh_line = line.new(eq_top_x, eq_prev_top, n-eq_len, eq_top
, color = bear_css
, style = line.style_dotted)
eqh_lbl = label.new(int(math.avg(n-eq_len, eq_top_x)), eq_top, 'EQH'
, color = #00000000
, textcolor = bear_css
, style = label.style_label_down
, size = size.tiny)
if mode == 'Present'
line.delete(eqh_line )
label.delete(eqh_lbl )
eqh_alert := true
eq_prev_top := eq_top
eq_top_x := n-eq_len
if eq_btm
max = math.max(eq_btm, eq_prev_btm)
min = math.min(eq_btm, eq_prev_btm)
if min > max - atr * eq_threshold
eql_line = line.new(eq_btm_x, eq_prev_btm, n-eq_len, eq_btm
, color = bull_css
, style = line.style_dotted)
eql_lbl = label.new(int(math.avg(n-eq_len, eq_btm_x)), eq_btm, 'EQL'
, color = #00000000
, textcolor = bull_css
, style = label.style_label_up
, size = size.tiny)
eql_alert := true
if mode == 'Present'
line.delete(eql_line )
label.delete(eql_lbl )
eq_prev_btm := eq_btm
eq_btm_x := n-eq_len
//-----------------------------------------------------------------------------}
//Fair Value Gaps
//-----------------------------------------------------------------------------{
var bullish_fvg_max = array.new_box(0)
var bullish_fvg_min = array.new_box(0)
var bearish_fvg_max = array.new_box(0)
var bearish_fvg_min = array.new_box(0)
float bullish_fvg_avg = na
float bearish_fvg_avg = na
bullish_fvg_cnd = false
bearish_fvg_cnd = false
=
request.security(syminfo.tickerid, fvg_tf, get_ohlc())
if show_fvg
delta_per = (src_c1 - src_o1) / src_o1 * 100
change_tf = timeframe.change(fvg_tf)
threshold = fvg_auto ? ta.cum(math.abs(change_tf ? delta_per : 0)) / n * 2
: 0
//FVG conditions
bullish_fvg_cnd := src_l > src_h2
and src_c1 > src_h2
and delta_per > threshold
and change_tf
bearish_fvg_cnd := src_h < src_l2
and src_c1 < src_l2
and -delta_per > threshold
and change_tf
//FVG Areas
if bullish_fvg_cnd
array.unshift(bullish_fvg_max, box.new(n-1, src_l, n + fvg_extend, math.avg(src_l, src_h2)
, border_color = bull_fvg_css
, bgcolor = bull_fvg_css))
array.unshift(bullish_fvg_min, box.new(n-1, math.avg(src_l, src_h2), n + fvg_extend, src_h2
, border_color = bull_fvg_css
, bgcolor = bull_fvg_css))
if bearish_fvg_cnd
array.unshift(bearish_fvg_max, box.new(n-1, src_h, n + fvg_extend, math.avg(src_h, src_l2)
, border_color = bear_fvg_css
, bgcolor = bear_fvg_css))
array.unshift(bearish_fvg_min, box.new(n-1, math.avg(src_h, src_l2), n + fvg_extend, src_l2
, border_color = bear_fvg_css
, bgcolor = bear_fvg_css))
for bx in bullish_fvg_min
if low < box.get_bottom(bx)
box.delete(bx)
box.delete(array.get(bullish_fvg_max, array.indexof(bullish_fvg_min, bx)))
for bx in bearish_fvg_max
if high > box.get_top(bx)
box.delete(bx)
box.delete(array.get(bearish_fvg_min, array.indexof(bearish_fvg_max, bx)))
//-----------------------------------------------------------------------------}
//Previous day/week high/lows
//-----------------------------------------------------------------------------{
//Daily high/low
= request.security(syminfo.tickerid, 'D', hl()
, lookahead = barmerge.lookahead_on)
//Weekly high/low
= request.security(syminfo.tickerid, 'W', hl()
, lookahead = barmerge.lookahead_on)
//Monthly high/low
= request.security(syminfo.tickerid, 'M', hl()
, lookahead = barmerge.lookahead_on)
//Display Daily
if show_pdhl
phl(pdh, pdl, 'D', pdhl_css)
//Display Weekly
if show_pwhl
phl(pwh, pwl, 'W', pwhl_css)
//Display Monthly
if show_pmhl
phl(pmh, pml, 'M', pmhl_css)
//-----------------------------------------------------------------------------}
//Premium/Discount/Equilibrium zones
//-----------------------------------------------------------------------------{
var premium = box.new(na, na, na, na
, bgcolor = color.new(premium_css, 80)
, border_color = na)
var premium_lbl = label.new(na, na
, text = 'Premium'
, color = TRANSP_CSS
, textcolor = premium_css
, style = label.style_label_down
, size = size.small)
var eq = box.new(na, na, na, na
, bgcolor = color.rgb(120, 123, 134, 80)
, border_color = na)
var eq_lbl = label.new(na, na
, text = 'Equilibrium'
, color = TRANSP_CSS
, textcolor = eq_css
, style = label.style_label_left
, size = size.small)
var discount = box.new(na, na, na, na
, bgcolor = color.new(discount_css, 80)
, border_color = na)
var discount_lbl = label.new(na, na
, text = 'Discount'
, color = TRANSP_CSS
, textcolor = discount_css
, style = label.style_label_up
, size = size.small)
//Show Premium/Discount Areas
if barstate.islast and show_sd
avg = math.avg(trail_up, trail_dn)
box.set_lefttop(premium, math.max(top_x, btm_x), trail_up)
box.set_rightbottom(premium, n, .95 * trail_up + .05 * trail_dn)
label.set_xy(premium_lbl, int(math.avg(math.max(top_x, btm_x), n)), trail_up)
box.set_lefttop(eq, math.max(top_x, btm_x), .525 * trail_up + .475*trail_dn)
box.set_rightbottom(eq, n, .525 * trail_dn + .475 * trail_up)
label.set_xy(eq_lbl, n, avg)
box.set_lefttop(discount, math.max(top_x, btm_x), .95 * trail_dn + .05 * trail_up)
box.set_rightbottom(discount, n, trail_dn)
label.set_xy(discount_lbl, int(math.avg(math.max(top_x, btm_x), n)), trail_dn)
//-----------------------------------------------------------------------------}
//Trend
//-----------------------------------------------------------------------------{
var color trend_css = na
if show_trend
if style == 'Colored'
trend_css := itrend == 1 ? bull_css : bear_css
else if style == 'Monochrome'
trend_css := itrend == 1 ? #b2b5be : #5d606b
plotcandle(open, high, low, close
, color = trend_css
, wickcolor = trend_css
, bordercolor = trend_css
, editable = false)
//-----------------------------------------------------------------------------}
//Alerts
//-----------------------------------------------------------------------------{
//Internal Structure
alertcondition(bull_ibos_alert, 'Internal Bullish BOS', 'Internal Bullish BOS formed')
alertcondition(bull_ichoch_alert, 'Internal Bullish CHoCH', 'Internal Bullish CHoCH formed')
alertcondition(bear_ibos_alert, 'Internal Bearish BOS', 'Internal Bearish BOS formed')
alertcondition(bear_ichoch_alert, 'Internal Bearish CHoCH', 'Internal Bearish CHoCH formed')
//Swing Structure
alertcondition(bull_bos_alert, 'Bullish BOS', 'Internal Bullish BOS formed')
alertcondition(bull_choch_alert, 'Bullish CHoCH', 'Internal Bullish CHoCH formed')
alertcondition(bear_bos_alert, 'Bearish BOS', 'Bearish BOS formed')
alertcondition(bear_choch_alert, 'Bearish CHoCH', 'Bearish CHoCH formed')
//order Blocks
alertcondition(bull_iob_break, 'Bullish Internal OB Breakout', 'Price broke bullish iternal OB')
alertcondition(bear_iob_break, 'Bearish Internal OB Breakout', 'Price broke bearish iternal OB')
alertcondition(bull_ob_break, 'Bullish OB Breakout', 'Price broke bullish iternal OB')
alertcondition(bear_ob_break, 'bearish OB Breakout', 'Price broke bearish iternal OB')
//EQH/EQL
alertcondition(eqh_alert, 'Equal Highs', 'Equal highs detected')
alertcondition(eql_alert, 'Equal Lows', 'Equal lows detected')
//FVG
alertcondition(bullish_fvg_cnd, 'Bullish FVG', 'Bullish FVG formed')
alertcondition(bearish_fvg_cnd, 'Bearish FVG', 'Bearish FVG formed')
//-----------------------------------
Custom Time K-barCustom Time K-bar Indicator
This custom indicator highlights specific times on the chart, helping traders identify key moments based on user-defined time intervals. The script is designed to highlight two distinct times with different colors, which can be customized to suit the trader's needs.
Features:
Custom Time Inputs: Set two specific times in hours and minutes (e.g., 09:00 and 22:30).
Highlighting on Chart: The chart background changes color when the current time matches the defined times. Green for the first time and red for the second time.
Dynamic Labels: Labels display the exact time at the lowest and highest points of the corresponding candles, showing the user-defined times in a clear and visible format.
Timezone Adjustment: The indicator is adjusted for the GMT+8 timezone.
Customization:
Easily adjust the two key times and customize the colors for highlighting.
The script allows for easy tracking of key time events, which can be crucial for strategies that rely on specific timings during market hours.
This indicator is ideal for traders who want to track and visualize important times dynamically on the chart. Whether you're focusing on specific market events or just want to see certain time intervals highlighted, this script can help streamline your analysis.
Rejet_Chandeliers [SOC]This script automatically detects Rejection Candlesticks (such as Pin Bars and Dojis) and highlights key support and resistance levels on the chart.
Features:
Automatic identification of rejection candles
Dynamic display of support and resistance zones
Helps visualize potential reversal areas
This tool is designed for traders who use price action to analyze market structure and key levels.
#TradingView #PriceAction #Forex #Crypto #Stocks #RejectionCandles #SupportResistance