GRID EXTENSIONGRID EXTENSION
Overview
The GRID EXTENSION is a simple grid-based indicator for TradingView, built with Pine Script v6. It plots horizontal price levels starting from a user-defined anchor price, with spacing set by a tick increment. Use it to identify key support, resistance, or price zones on charts for Crypto, Forex, or Futures.
Key Features
Custom Grid Levels: Plot up to 22 levels (e.g., 0, 0.25, 1.25, -2.50) with options to show/hide, set values, and choose colors.
Market-Specific Tick Increments: Select your asset type (Crypto, Forex, Futures) and choose from a range of tick increments tailored for each market:
Crypto: 1 to 5000 ticks (e.g., 100 ticks = $0.001 on ADA/USD, 5000 ticks = $50 on BTC/USD).
Forex: 5 to 5000 ticks (e.g., 100 ticks = 1 pip on EUR/USD, 5000 ticks = 50 pips).
Futures: 1 to 2500 ticks (e.g., 25 ticks = 6.25 points on E-mini S&P 500, $312.50 per contract).
Visual Options:
Extend lines to the right.
Show price and level labels (as values or percentages).
Place labels on the left or right.
Adjust background transparency for filled areas between levels.
How to Use
Set Asset Type: Choose "Crypto," "Forex," or "Futures" to match your chart.
Set Anchor Price: Enter a starting price for the grid.
Pick Tick Increment: Select a tick increment from the dropdown, following the guidance for your asset type (see Key Features).
Customize Levels: Turn levels on/off, set values, and pick colors.
Add to Chart: Apply the indicator to see the grid on your chart.
Tips
Use levels to mark support/resistance zones for entries or exits.
Extend lines to project future price zones.
Choose smaller increments (e.g., 5 ticks) for scalping, or larger ones (e.g., 1000 ticks) for swing trading.
Combine with indicators like moving averages for better signals.
Settings
Asset Type: Select "Crypto," "Forex," or "Futures" (default: "Crypto").
Anchor Price: Starting price for the grid (default: 0.0).
Tick Increment: Space between levels (options: 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000). Choose based on asset type.
Extend Right: Extend lines to the right (default: true).
Show Prices: Show price labels (default: true).
Show Levels: Show level values or percentages (default: true).
Format: Display levels as "Values" or "Percent" (default: "Values").
Labels Position: Place labels on "Left" or "Right" (default: "Left").
Background Transparency: Set transparency for filled areas (default: 100, range 0-100).
Level Options: Enable/disable levels, set values, and choose colors.
Notes
Set the anchor price to a key level (like a recent high or low) for best results.
Check the tick increment tooltip to ensure the spacing suits your market type.
Works on any chart, best for clear price trends or ranges.
Acknowledgments
Made with Pine Script v6 for TradingView. This is v1.0—feedback welcome for future updates!
Support-and-resistance
1H/3m Concept [RunRox]🕘 1H/3m Concept is a versatile trading methodology based on liquidity sweeps from fractal points identified on higher timeframes, followed by price reversals at these key moments.
Below, I will explain this concept in detail and provide clear examples demonstrating its practical application.
⁉️ WHAT IS A FRACTALS?
In trading, a fractal is a technical analysis pattern composed of five consecutive candles, typically highlighting local market turning points. Specifically, a fractal high is formed when a candle’s high is higher than the highs of the two candles on either side, whereas a fractal low occurs when a candle’s low is lower than the lows of the two adjacent candles on both sides.
Traders use fractals as reference points for identifying significant support and resistance levels, potential reversal areas, and liquidity zones within price action analysis. Below is a screenshot illustrating clearly formed fractals on the chart.
📌 ABOUT THE CONCEPT
The 1H/3m Concept involves marking Higher Timeframe (HTF) fractals directly onto a Lower Timeframe (LTF) chart. When a liquidity sweep occurs at an HTF fractal level, we remain on the same LTF chart (since all HTF fractals are already plotted on this lower timeframe) and wait for a clear Market Structure Shift (MSS) to identify our potential entry point.
Below is a schematic illustration clearly demonstrating how this concept works in practice.
Below is another 💡 real-chart example , showing liquidity in the form of a 1H fractal, swept by a rapid impulse move. Immediately afterward, a clear Market Structure Shift (MSS) occurs, signaling a potential entry point into the trade.
Another example is shown below, where we see our hourly fractal, from which price clearly reacts, providing an opportunity to search for an entry point.
As illustrated on the chart, the fractal levels from the higher timeframe are clearly displayed, but we’re working directly on the 5-minute chart. This allows us to remain on one timeframe without needing to switch back and forth between charts to spot such trading setups.
🔍 MTF FRACTALS
This concept can be applied across various HTF-LTF timeframe combinations. Although our examples illustrate 1H fractals used on a 5-minute chart, you can effectively utilize many other timeframe combinations, such as:
30m HTF fractals on 1m chart
1H HTF fractals on 3m chart
4H HTF fractals on 15m chart
1D HTF fractals on 1H chart
The key idea behind this concept is always the same: identify liquidity at fractal levels on the higher timeframe (HTF), then wait for a clear Market Structure Shift (MSS) on the lower timeframe (LTF) to enter trades.
⚙️ SETTINGS
🔷 Trade Direction – Select the preferred trading direction (Long, Short, or Both).
🔷 HTF – Choose the higher timeframe from which fractals will be displayed on the current chart.
🔷 HTF Period – Number of candles required on both sides of a fractal candle (before and after) to confirm fractal formation on the HTF.
🔷 Current TF Period – Sensitivity to the impulse that sweeps liquidity, used for identifying and forming the MSS line.
🔷 Show HTF – Enable or disable displaying HTF fractal lines on your chart. You can also customize line style and color.
🔷 Max Age (Bars) – Number of recent bars within which fractals from the selected HTF will be displayed.
🔷 Show Entry – Enable or disable displaying the MSS line on the chart.
🔷 Enable Alert – Activates TradingView alerts whenever the MSS line is crossed.
You can also enable 🔔 alerts, which notify you whenever price crosses the MSS line. This significantly simplifies the process of identifying these setups on your charts. Simply configure your preferred timeframes and wait for notifications when the MSS line is crossed.
🔶 We greatly appreciate your feedback and suggestions for improving the indicator!
Order Blocks-[B.Balaei]Order Blocks -
**Description:**
The Order Blocks - indicator is a powerful tool designed to identify and visualize Order Blocks on your chart. Order Blocks are key levels where significant buying or selling activity has occurred, often acting as support or resistance zones. This indicator supports multiple timeframes (MTF), allowing you to analyze Order Blocks from higher timeframes directly on your current chart.
**Key Features:**
1. **Multi-Timeframe Support**: Choose any timeframe (e.g., Daily, Weekly) to display Order Blocks from higher timeframes.
2. **Customizable Sensitivity**: Adjust the sensitivity to detect more or fewer Order Blocks based on market conditions.
3. **Bullish & Bearish Order Blocks**: Clearly distinguishes between bullish (green) and bearish (red) Order Blocks.
4. **Alerts**: Get notified when price enters a Bullish or Bearish Order Block zone.
5. **Customizable Colors**: Personalize the appearance of Order Blocks to match your chart style.
**How to Use:**
1. Add the indicator to your chart.
2. Select your desired timeframe from the "Multi-Timeframe" settings.
3. Adjust the sensitivity and colors as needed.
4. Watch for Order Blocks to form and use them as potential support/resistance levels.
**Ideal For:**
- Swing traders and position traders looking for key levels.
- Traders who use multi-timeframe analysis.
- Anyone interested in understanding market structure through Order Blocks.
**Note:**
This indicator is for educational and informational purposes only. Always conduct your own analysis before making trading decisions.
**Enjoy trading with Order Blocks - !**
Fibonacci Pivot Points & Previous D,W&M Highs/LowsIndicator Overview
This indicator combines Fibonacci Pivot Points with previous high and low levels for different timeframes (day, week, month). It plots these levels on the chart to provide traders with key support and resistance areas, making it easier to identify potential trading opportunities.
Features
Fibonacci Pivot Points:
The indicator calculates pivot points based on the high, low, and close prices.
Fibonacci levels are used to determine support (S1, S2, S3, S4, S5) and resistance (R1, R2, R3, R4, R5) levels.
Users can customize the Fibonacci levels for both support and resistance.
Previous Highs and Lows:
The indicator plots previous day, week, and month high and low levels.
Each of these lines can be customized in terms of visibility, color, and width.
This helps traders to see key historical levels that might act as support or resistance in the future.
Inputs and Customization:
Fibonacci Time Frame:
Users can select the timeframe for calculating the pivot points (Daily, Weekly, Monthly).
Fibonacci Levels:
Customizable input fields for each Fibonacci level (R1, R2, R3, R4, R5, S1, S2, S3, S4, S5).
Previous High/Low Lines:
Day Lines:
Options to show or hide previous day's high/low lines.
Customizable color and width for these lines.
Week Lines:
Options to show or hide previous week's high/low lines.
Customizable color and width for these lines.
Month Lines:
Options to show or hide previous month's high/low lines.
Customizable color and width for these lines.
Technical Calculations:
Fibonacci Pivot Points:
Calculated as:
pp = (High + Low + Close) / 3
S1 = pp - ((High - Low) * Fibonacci Level)
R1 = pp + ((High - Low) * Fibonacci Level)
Previous High/Low Levels:
Uses request.security to fetch previous high and low values for the selected timeframe.
Plotted using line.new to draw lines across the chart.
Plotting:
The indicator plots Fibonacci Pivot Points and previous high/low lines on the chart, using distinct colors for each level.
Customizable transparency and linewidths make it easier to visually interpret the levels.
This indicator is particularly useful for traders who rely on technical analysis to identify key support and resistance levels, offering a blend of historical data and Fibonacci-based predictions.
Feel free to ask if you have any specific questions or need further adjustments!
Support and Resistancelookback: This input allows you to specify the number of bars to look back to calculate the support and resistance levels.
support: This is calculated as the lowest low over the specified lookback period.
resistance: This is calculated as the highest high over the specified lookback period.
plot: The support and resistance levels are plotted on the chart with different colors.
bgcolor: This optional feature highlights the support and resistance zones with a semi-transparent background color.
Key Levels SetKey Levels Set allows to set key levels as comma separated values, and to detect breaks to the downside and/or upside, taking into account potential gaps between bars.
This indicator can be very handy if you, like me, rely on some key levels that you identified as potential support/resistance from some technical analysis.
Features
+ It allows for key levels to be set as comma separated values.
+ It draws key levels on chart.
+ On close, it identifies highest key level that has been broken to the upside, if any.
+ On close, it identifies lowest key level that has been broken to the downside, if any.
+ In Cross mode, as bar is printing, it also detects highest/lowest key levels being broken to the upside/downside between bar high and low, if any.
+ It plots and labels breaks with current level and next level information.
+ It includes alerts from breaks on close.
+ It includes turn on/off functionality.
Settings
+ {Prices} checkbox: turns on/off entire functionality
+ {Prices} text field: comma separated values for key levels
+ {Breaks on} checkbox: turns on/off breaks detection functionality
+ {Breaks on} options: selects Close or Cross mode
OrderBlock [kyleAlgo]The principle of this indicator
ATR (Average True Range) Setting: The code uses ATR to help calculate the Supertrend indicator.
Supertrend Trend Direction: Identify bullish and bearish trends with the Supertrend method.
Order Block Recognition: This part of the code recognizes and creates order blocks, visualizing them as boxes on the chart. If the number of blocks exceeds the maximum limit, old blocks will be deleted.
Function to prevent overlapping: check whether the new order block overlaps with the existing order block through the isOverlapping function.
Order block color setting: The code sets the color according to whether the block is bullish or bearish, and whether it breaks above or below. Afterwards the color of the existing order blocks will be updated.
Sensitivity settings: Through the input settings of factor and atrPeriod, the sensitivity of Supertrend and the detection of order blocks can be affected.
Visualization: Use TradingView's box.new function to draw and visualize order blocks on the chart.
Practicality:
Support and Resistance Levels: Order blocks may represent areas of support and resistance in the market. By visualizing these areas, traders can better understand when price reversals are likely to occur.
Trading Signals: Traders may be able to identify trading signals based on the color changes of blocks and price breakouts. For example, if the price breaks above a bullish block, this could be a signal to buy.
Risk Management: By using ATR to adjust the sensitivity of Supertrend, the symbol helps traders to adjust their strategies according to market volatility. This can be used as a risk management tool to help identify stop loss and take profit points.
Multi-timeframe analysis: Although the code itself does not implement multi-timeframe analysis directly, it can be done by applying this indicator on different timeframes. This helps to analyze the market from different angles.
Flexibility and Customization: Through sensitivity settings, traders can customize the indicator according to their needs and trading style.
Reduced screen clutter: By removing overlapping order blocks and limiting the maximum number of order blocks, this code helps reduce clutter on charts, allowing traders to analyze the market more clearly.
Overall, this "Pine Script" can be a powerful analytical tool for trend traders and those looking to improve their trading decisions by visualizing key market areas. It can be used alone or combined with other indicators and trading systems for enhanced functionality.
Divergence-Support/ResistenceAnother script based on zigzag, divergence, and to yield support and resistence levels.
This idea started with below two concepts:
▶ Support and resistence are simply levels where price has rejected to go further down or up. Usually, we can derive this based on pivots. But, if we start looking at every pivot, there will be many of them and may be confusing to understand which one to consider.
▶ Lot of people asked about one of my previous script on divergence detector on how to use it. I believe divergence should be considered as area of support and resistence because, they only amount to temporary weakness in momentum and nothing more. As per my understanding
Trend > Hidden Divergence > Divergence > Oscillator Levels of Overbought and Oversold
⬜ Process
▶ Now combining the above two concepts - what we are trying to do here is draw support resistence lines only on pivots which has observed either divergence or hidden divergence. Continuation and indecision pivots are ignored.
▶ Input requires only few parameters.
Zigzag lengths and oscillator to be used. Oscillator periods are automatically calculated based on zigzag length. Hence no other information required. You can also chose custom oscillator via external source.
▶ Display include horizontal lines of support/resistence which are drawn from the candle from where divergence or hidden divergence is detected.
▶ Support resistence lines are colored based on divergence. Green shades for bullish divergence and bullish hidden divergence whereas red shades for bearish divervence and bearish hidden divergence. Please note, red and green lines does not mean they only provide resistence or support. Any lines which are below the price should be treated as support and any line which are above the price should be treated as resistence.
▶ Divergence symbols are also printed on the bar from where divergence/hidden divergence is detected.
↗ - Bullish Hidden Divergence
↘ - Bearish Hidden Divergence
⤴ - Bullish Divergence
⤵ - Bearish Divergence
▶ Script also demonstrates usage of libraries effectively. I have used following libraries in this code.
import HeWhoMustNotBeNamed/ zigzag /2 as zg
import HeWhoMustNotBeNamed/enhanced_ta/8 as eta
import HeWhoMustNotBeNamed/ supertrend /4 as st
Can be good combination to use it with harmonic patterns.