Support, Resistance & OHLCUPDATE:
This Pine Script code is an indicator for TradingView that displays support, resistance, and OHLC (Open, High, Low, Close) data across various timeframes. The code is divided into two main sections: Support/Resistance and OHLC Data.
Support and Resistance:
Logic for Support and Resistance: The indicator draws support and resistance lines after 4 consecutive candles without forming new lows (for support) or new highs (for resistance). This means that a support or resistance level is created after 4 candles that don't set new extremes.
Support: When the last 3 candles have lower lows, and the current candle forms a higher low, the support level is set.
Resistance: When the last 3 candles have higher highs, and the current candle forms a lower high, the resistance level is set.
Drawing the Lines and Labels:
Once the support or resistance level is determined, a horizontal line is drawn that extends left and right from the candle.
Additionally, labels for support and resistance are shown if the corresponding settings are enabled. These labels appear at a distance from the line and display the current support or resistance value.
Deleting the Lines:
If the price falls below the support level or rises above the resistance level, the respective line is deleted. This means that the market has breached the support or resistance level, making the line invalid.
When the support or resistance line is breached, alerts can be triggered to notify the trader.
Alerts:
The script provides options to set alerts when a support or resistance line is created or broken. These alerts notify the trader when the price reaches an important level.
OHLC Data:
The code allows the display of the high, low, close, and open values of the last candles across different timeframes (hourly, daily, weekly, monthly).
Settings:
Options are available to show these values for the respective timeframes.
The user can also adjust the size of the labels.
Visualization: The indicator plots lines for the high, low, and close values for each timeframe and places labels showing the respective values.
In summary, the indicator provides a detailed view of support and resistance levels, which are based on a 4-candle logic, and displays important OHLC values across different timeframes. The indicator also allows setting alerts for specific price levels, so traders can quickly react to market movements.
Candlestick analysis
Custom Zig Zag with Absolute Price DifferenceThis Zig-Zag indicator visualizes the price movements of a financial instrument and highlights the relevant turning points (pivots) where the price has undergone a significant change. It uses a deviation threshold to mark only substantial movements and ignore minor fluctuations.
The input parameters allow the user to customize the indicator:
Deviation (%): Defines the minimum percentage deviation required to mark a turning point.
Depth: Specifies how many periods before and after a pivot are considered to determine whether it is a real high or low.
Line Color: Allows the user to change the color of the lines that connect the pivots.
Extend to Last Bar: If enabled, extends the last lines to the current bar.
Display Absolute Price Difference: If enabled, the indicator shows the absolute price difference between the current pivot and the previous one.
Label Size: Allows adjusting the font size of the displayed labels.
The logic of the indicator is based on calculating pivots (highs and lows) using price movements. The indicator then tracks the changes between successive pivots and represents them as lines. When the price shows a significant difference from the last pivot (measured in percentage), a line is drawn, and a label displaying the price difference is shown.
Additionally, the indicator uses the calc_dev function to compute the price deviation between the last pivot and the current price. This provides users with a clear visualization of price changes, helping to identify larger price movements.
BUY/SELL Timeframe ContinuityTime frame continuity refers to the alignment of price trends across multiple time frames. This means that the price movement is showing a consistent trend (either up or down) on various timeframes, like the 5-minute, 30-minute, hourly, and daily charts.
Why is it important?
Confirms Trend Strength: When multiple timeframes align, it indicates a strong and sustained trend.
Risk Management: Trading in the direction of the aligned trend can reduce risk.
This indicator checks if the current price of a selected timeframe is above or below its opening price. A buy/sell signal appears the second all bullish timeframes align (buy) or all bearish timeframes align. You can choose to paint the candles when the buy/sell conditions happen. You can select up to 10 different timeframes.
NOTE: With this indicator I prefer timeframes 15m, 30m, 1H, 4H, D, 5D, W - Together these timeframes are great for short-term trends on any stock.
Previous High and Low Count with Probabilities + Risk On/Off1. Purpose of the Script:
This trading script combines two important concepts:
Previous High and Low Count: It tracks whether the current price exceeds the previous day’s high or low and calculates probabilities for the next price movement (up or down).
Risk On / Risk Off Indicator: It evaluates market sentiment through various indicators (such as the Fear & Greed Index, VIX, and others) and shows whether the market is in a risk-on or risk-off state. This information impacts the probabilities of price movement.
2. How it Works:
Previous High and Low:
The script tracks how often the price exceeds the previous day’s high or low and calculates the probability of an upward or downward movement based on that. This gives you an idea of how often the market reacts at the previous day's high or low.
Risk On / Risk Off:
Based on various market factors (Fear & Greed Index, VIX, Put-Call Ratio, etc.), the script calculates the Risk On or Risk Off state.
In Risk On, the probability of an upward movement increases, and the probability of a downward movement decreases. In Risk Off, it’s the opposite.
Adjusted Probabilities:
The probabilities for an Up or Down movement are adjusted based on the current Risk On / Risk Off state. In a Risk On environment, the probability for an upward move increases, while in a Risk Off environment, the probability for a downward move increases.
3. How to Use the Script:
Add the Script in TradingView:
TradingView:
Click on "Add to Chart" to apply the script to your chart.
Manual Input of Indicators:
For the Fear & Greed Index, VIX, and other indicators, you need to manually enter the current values. You can get these values from various publicly available sources:
Fear & Greed Index: CNN Fear & Greed Index
VIX (Volatility Index): VIX Index
Other indicators like Put-Call Ratio, Bitcoin Volatility, Oil Prices, and US Dollar Index can also be manually inputted, and they can be found on finance websites like Yahoo Finance, MarketWatch, and Bloomberg.
Observe the Colors and Symbols:
If the market is in a Risk On state, the background will turn green, and a green triangle will appear below the candle.
If the market is in a Risk Off state, the background will turn red, and a red triangle will appear above the candle.
Track the Probabilities:
A label will appear on the chart showing the calculated probabilities for Up and Down movements. These probabilities are adjusted based on the current market state (Risk On/Off).
4. Meaning of the Probabilities:
Up Probability: Indicates the probability that the price will rise.
Down Probability: Indicates the probability that the price will fall.
The probabilities are dynamic and adjust based on the Risk On / Risk Off state, helping you make better decisions based on the current market conditions.
Fibonacci Rainbow Day Trade-AYNETSummary of the "Fibonacci Rainbow Day Trade"
This script dynamically calculates Fibonacci retracement levels based on the daily high and low and plots them as colorful lines on the chart. It is designed for day traders to visually identify potential support and resistance zones using Fibonacci levels.
Key Features:
Dynamic Fibonacci Levels:
Levels are calculated using the daily high (day_high) and low (day_low).
Default levels: 0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.
These levels represent key areas where price is likely to react.
Colorful Rainbow Visualization:
Each Fibonacci level is represented by a unique color.
Colors are defined in a rainbow_colors array: red, orange, yellow, green, blue, purple, teal.
Customizable Inputs:
Users can modify the Fibonacci levels, line thickness (fibo_line_width), and whether to show labels.
Labels display the level percentage (e.g., 0.236) at their respective lines.
Optional Labels:
The script includes labels that annotate each Fibonacci level on the chart.
Labels are placed beside the corresponding lines for clarity.
Works on Any Timeframe:
Although the levels are based on the daily high/low, the script can be applied to any intraday timeframe.
Use Case:
Identify Support and Resistance Zones:
Watch for price reactions near Fibonacci levels to determine potential entry/exit points.
Dynamic Updates:
Fibonacci levels are updated daily, ensuring they remain relevant for intraday trading.
Custom Visualization:
Adjust levels, colors, and display options to suit your trading style.
Example Calculation:
Daily High: $120
Daily Low: $100
Fibonacci 0.618 Level: $100 + ($120 - $100) * 0.618 = $111.36
This script provides a visually appealing and effective way to incorporate Fibonacci levels into day trading strategies. 🌈
Roman's Ranges(GOLD FUTURES)This indicator provides the user with Gold Future's previous day’s range and how long it took for the price to reach its first extreme for the day. This information is used to predict the most probable daily direction trend and estimate how long you should expect to hold your winning trade. The distance and time are based on the market open candle (6:30 am). It measures from the retracement wick of the candle to the last 5m close of the day’s first extreme low or high point. It also includes that distance in pts.
Previous market data does not guarantee future results, however, you can leverage the knowledge of the previous day’s ranges to set reasonable take profit levels and when your target is not met automatically, you know how long it took on the previous day to reach the day’s first low/high. If you are nearing that amount of time and your trade is not as profitable as expected, it is easier to get out with less profits using this estimated time rather than hoping the market closes in your favor.
Markets go through cycles and it can be difficult to trade them all if you have a fault expectation how how far the price is expected to move. Price tends to deviate slowly from the average ranges slightly day after day, but you can expect an average range to prevail throughout the week +/- 3 points. It can be very easy to be stuck on 5-point take-profit levels that you don’t pay attention to the average range being twice or three times that distance. The same can be said for the opposite scenario with having higher profit expectations than reasonably possible.
This indicator and my statements are not financial advice. This is meant for educational purposes only.
Formation Analysis TableThis code creates a pattern analysis table written in TradingView's Pine Script v5 language. The code analyzes specific candlestick patterns and displays the presence or absence of these patterns in a table. It also provides a brief description of each pattern.
Sections of the Code and Explanations:
1. Defining the Indicator
pinescript
Copy Code
//@version=5
indicator("Formation Analysis Table", overlay=true)
@version=5: Specifies that the code will work in Pine Script v5.
indicator: Specifies that this code is an indicator. The overlay=true parameter allows the table to be displayed above the price chart.
2. User Settings
pinescript
Copy the code
font_size = input.int(12, title="Font Size", minval=8, maxval=24)
position_option = input.string("Top Right", title="Table Position", options= )
font_size: Allows the user to choose the font size.
position_option: Provides the option to position the table in one of the four corners of the screen.
The table position is determined as follows:
pinescript
Copy the code
var table_position = position.top_right
if (position_option == "Top Right")
table_position := position.top_right
else if (position_option == "Top Left")
table_position := position.top_left
else if (position_option == "Bottom Right")
table_position := position.bottom_right
else if (position_option == "Bottom Left")
table_position := position.bottom_left
3. Creating the Table
pinescript
Copy the code
var table t1 = table.new(table_position, 3, 21, frame_color=color.white, border_width=1, border_color=color.white)
table.new: Creates a new table.
3: Specifies the number of columns (Formation, Status, Description).
21: Specifies the number of rows (20 patterns + title).
frame_color and border_color: Color of the chart frame.
4. Pattern Detection Functions
A function is defined for each pattern. For example:
Bullish Engulfing:
pinescript
Copy the code
bullish_engulfing() =>
close < open and close > open and close > open and open < close
Conditions for this pattern:
Previous candle must be a bearish candle (close < open ).
Current candle must be a bullish candle (close > open).
Current candle must "engulf" the entire previous candle (close > open and open < close ).
Bearish Engulfing Candle:
pinescript
Copy the code
bearish_engulfing() =>
close > open and close < open and close < open and open > close
Similarly, the conditions for the bearish engulfing candle are defined.
Similar logical checks are made for other formations (Doji, Hammer, Morning Star, etc.).
5. Table Headers
A header is added to the first row of the table:
pinescript
Copy the code
if (bar_index == 0)
table.cell(t1, 0, 0, text="Formation", bgcolor=color.blue, text_color=color.white, text_size=size.normal)
table.cell(t1, 1, 0, text="Status", bgcolor=color.blue, text_color=color.white, text_size=size.normal)
table.cell(t1, 2, 0, text="Description", bgcolor=color.blue, text_color=color.white, text_size=size.normal)
The "Formation", "Status", and "Description" headers are added to the table.
6. Formations, Statuses, and Descriptions
Formations, statuses, and descriptions are stored in separate arrays.
pinescript
Copy the code
formations = array.new_string(20)
array.set(formations, 0, "Bullish Engulfing")
Statuses are determined by whether each formation is detected:
pinescript
Copy the code
statuses = array.new_string(20)
array.set(statuses, 0, bullish_engulfing() ? "Detected" : "Not Detected")
If the formation is detected, "Detected" is written; otherwise, "Not Detected".
The descriptions tell what each pattern means:
pinescript
Copy the code
descriptions = array.new_string(20)
array.set(descriptions, 0, "Potential bullish trend.")
7. Filling the Table Cells
The table is filled for each pattern:
pinescript
Copy the code
for i = 0 to array.size(formations) - 1
table.cell(t1, 0, i + 1, text=array.get(formations, i), bgcolor=color.blue, text_color=color.white, text_size=text_size)
table.cell(t1, 1, i + 1, text=array.get(statuses, i), bgcolor=color.gray, text_color=color.white, text_size=text_size)
table.cell(t1, 2, i + 1, text=array.get(descriptions, i), bgcolor=color.white, text_color=color.black, text_size=text_size)
The name, status and description of each formation are written in the table with the appropriate color.
Output:
When this code is run, a table is displayed above the price chart:
Formation: Which formations are being analyzed.
Status: Which formations have been detected.
Description: What the formation means.
The table visualizes formation analysis in a user-friendly and dynamic way.
TraderRob 15M Rob Reversal StrategyTraderRob 15M Rob Reversal
The indicator is for a strategy I saw on YouTube. Check the link below to know the conditions and setup. I also added a threshold to exclude doji candles from signals, but you can adjust it to your liking.
www.youtube.com
[TheMandalor] Invert or Mirror Chart SUPPORT RESSISTANTThis is a new idea to find supports and resistant’s for any charts.
What is the concept of this indicator:
1. It is used close and inverted it on chart
2. When the real chart and the inverted chart is crossing together several times, this point will be important on this concept that means the price will care about this point again and again.
3. When you draw a horizontal line as support and resistance check it with this indicator too, if your support and resistance is touched with inverted chart, it will be more important than normal support/ resistance.
4. This indicator has plot candle too, it means you can compare regular chart with the inverted one at same time if you need.
Here is the steps:
1. When you add the indicator to your chart it will add your ticker as inverted.
2. Change your chart type to line chart.
3. Fix your scale in both sides left and right (the indicator's side is on the left).
4. Now you must have two type of line charts, one is yours (The blue one) and one is plotted with this indicator (The purple one).
5. Draw a horizontal line where these two lines have more crossing at the middle of chart, this line will be a powerful line later.
6. Find other more crossed points and draw horizontal line for them too.
7. Now you can see these indicator's support and resistant’s, now you can remove the indicator and watch how the price will touch, reverse, or stay on your new type of support and resistant’s lines.
PS: I have added candle plotting too if you need it.
Ichimoku Cloud with Buy/Sell Signalsbuy and sell signal with ichimoku cloud based on conversion line and base line crossover
Market Open Range Breakaway v1.2Script Name: Market Open Range Breakaway 1.2
This TradingView script, "Market Open Range Breakaway," highlights the market's opening range for a user-selected day of the week. It calculates the high and low prices during a specified period after the market opens, plots these levels, and tracks the opening price. The script dynamically adjusts for time zones and only displays data during market hours on the chosen day, with optional background shading for the defined range period.
Purpose: Identifies and highlights the market's opening range for a selected day of the week.
Features: Calculates and plots the high, low, and open price during the market's opening range.
Configurable range duration (e.g., 15, 30, or 60 minutes).
Automatically adjusts for different time zones.
Displays levels only during market hours on the target day.
Optional background shading for the opening range.
Inputs: Target day of the week.
Opening range duration.
Use Case: Ideal for traders looking to analyze breakout levels or price movements around the opening range.
DAVID AKONJANG FROM TIKO CAMEROON 2This Pine Script (version 5) is a technical analysis indicator for TradingView, created by "David Akonjang from Tiko, Cameroon." Here's a brief description:
1. **Indicator Settings**:
- The indicator is applied directly on the price chart (`overlay=true`).
- It uses the **Relative Strength Index (RSI)** to generate buy and sell signals.
2. **Inputs**:
- `rsi_length`: The RSI calculation period, which defaults to 14 but can be adjusted by the user.
- `source`: The data source for the RSI calculation, defaulting to the closing price.
3. **RSI Calculation**:
- The RSI is calculated using the `ta.rsi` function with the specified period (`rsi_length`) and data source.
4. **Signal Conditions**:
- **Buy Condition**: A "Buy" signal is triggered when the RSI crosses above 70 (indicating a potential overbought condition being breached).
- **Sell Condition**: A "Sell" signal is triggered when the RSI crosses below 30 (indicating a potential oversold condition being breached).
5. **Plotting Signals**:
- **Buy Signals**: Displayed as green upward labels below the price bars where the buy condition is met.
- **Sell Signals**: Displayed as red downward labels above the price bars where the sell condition is met.
### Key Usage:
- This script helps traders identify potential reversal points based on RSI thresholds (overbought and oversold regions).
Fractal Navigator -AynetConcept: Market Fractal Navigator 🚀
Imagine viewing the market as a living, breathing fractal that:
Dynamically unfolds patterns within patterns across price, time, and sentiment.
Incorporates advanced mathematics (e.g., chaos theory, fractals, Fourier transforms) to provide multi-dimensional insights.
Leverages adaptive visualizations—patterns evolve, colors shift, and zones expand/contract based on real-time market behavior.
Provides context-sensitive insights (alerts and visuals adapt depending on trend, volume, and volatility).
Core Features
Fractal Pattern Tracker:
Detects fractal structures dynamically on price movements.
Marks major patterns (e.g., tops, bottoms, triangles) and evolving structures.
Time-Weighted Heatmap:
Visualizes price density over time.
Areas of high trading activity glow brighter; low-activity zones fade into the background.
Fourier Momentum Spectrum:
Analyzes momentum frequencies using Fourier transforms to reveal cyclical behavior.
Visually shows the dominant momentum cycles as "waves."
Chaos Zones:
Highlights areas where market behavior is unstable, signaling caution.
How It Works
1. Fractal Patterns
What It Does:
Dynamically identifies fractal highs and lows.
Marks them with labels (⬆️ for tops, ⬇️ for bottoms).
What It Means:
Helps traders visualize turning points in market structure.
2. Time-Weighted Heatmap
What It Does:
Calculates areas of high/low trading activity using a normalized volume-weighted density.
The background changes dynamically: brighter zones = more trades.
What It Means:
Guides traders to areas of importance or zones to avoid.
3. Fourier Momentum Spectrum
What It Does:
Uses Fourier analysis to measure dominant momentum cycles in the market.
Plots the momentum spectrum dynamically as waves.
What It Means:
Helps traders identify recurring cycles and time their entries better.
4. Chaos Zones
What It Does:
Flags areas of extreme price behavior (large candles, volatility spikes).
Adds ⚠️ Chaos Zone labels for immediate caution.
What It Means:
Warns traders of unstable zones where risk is higher.
Why Is This Different?
Multi-Dimensional Visualization:
Combines fractals, heatmaps, momentum spectrums, and chaos zones into one cohesive indicator.
Mathematical Depth:
Incorporates Fourier transforms and normalized density metrics for deeper insights.
Actionable Clarity:
Fractal markers and chaos warnings give direct, easy-to-understand signals.
Art Meets Analysis:
Visually transforms the chart into something engaging and interactive, not just a flat analysis tool.
Next Steps
If this concept resonates with you, we can:
Expand fractal behavior with multi-timeframe overlays.
Add custom zones for identified patterns like triangles or head-and-shoulders.
Include machine learning elements to predict next likely fractal zones.
Let’s take this further—your feedback is the fuel for innovation!
Market Symbiosis - AynetConcept: Market Symbiosis Indicator
Why?
Most indicators are about reacting to the market.
What if we created a market prediction system that visualizes hidden relationships across assets, timeframes, and sentiment?
Features
Multi-Asset Correlation Map:
Create a dynamic "network" showing how USD/JPY, SPX, BTC, or other assets are correlated in real-time.
Strength and direction of relationships visualized with connection lines and nodes.
Trend Velocity Zones:
Highlight areas of price acceleration or deceleration (based on momentum, volume surges, or volatility).
Market Sentiment Meter:
Blend fear/greed metrics (e.g., RSI extremes, volume spikes, news sentiment) into a sentiment dial that adjusts live.
Predictive Heatwave Layer:
A heatmap overlay predicts where price might gravitate (support/resistance zones, liquidity pockets).
Key Features of This Indicator
Multi-Asset Correlation Map:
Dynamically tracks correlations between assets (USDJPY, SPX, BTC).
Provides real-time insights into the strength and direction of these relationships.
Trend Velocity Zones:
Measures how fast price is moving relative to ATR.
A purple zone visualizes velocity intensity directly on the chart.
Sentiment Meter:
Background color changes between Greed (green), Fear (red), and Neutral states based on RSI.
Predictive Heatwave Layer:
Projects dynamic support and resistance zones (based on ATR).
These zones are marked as dotted lines radiating outward from the current price.
Why Is This Unique?
Interconnected Insights:
Instead of focusing on one asset, this indicator tracks relationships between multiple markets.
Behavioral Edge:
Tracks both price velocity and sentiment for a complete market "feel."
Prediction Layer:
Heatwave zones give traders probable price levels, aiding decision-making.
Dynamic Visuals:
Real-time updates and clean, intuitive visuals make this indicator stand out.
Let me know if you’d like to enhance this further—such as adding machine learning models for anomaly detection or interactive sentiment dials.
Fibonacci Candlestick - AYNETHow It Works
Inputs:
ltf_timeframe: Specify the timeframe for candlestick data (e.g., 1H, 4H).
Fibonacci Levels:
Toggle Fibonacci level visibility (show_fib_levels).
Customize Fibonacci line color (fib_color) and width (fib_width).
Candlestick Data:
Fetches open, high, low, and close prices for the specified timeframe using request.security.
Fibonacci Levels:
Calculates standard Fibonacci retracement levels (0.0, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%) for each candle's high-low range.
Draws horizontal lines for each level using line.new.
Candlestick Visualization:
Plots lower timeframe candles with customizable bullish and bearish colors.
Key Features
Dynamic Fibonacci Levels:
Fibonacci levels are recalculated for each candlestick's high-low range.
Levels update dynamically with new candles.
Candlestick Overlay:
Visualizes candlestick data from the specified timeframe directly on the current chart.
Customizable Appearance:
Configure colors for Fibonacci levels, candlestick bodies, and wicks.
Use Cases
Microstructure Analysis:
Analyze individual candlesticks with their Fibonacci retracements for potential support/resistance zones.
Multi-Timeframe Trading:
Overlay candlestick and Fibonacci data from a lower timeframe onto a higher timeframe chart.
Let me know if you'd like further enhancements or explanations! 😊
Volume-Based Bar ColorThis indicator changes the bar color if the bar has more than a specified amount of volume. Best use case would be to apply it to a tick chart (ex: 500 Tick) and set the volume threshold to say 590-600 volume. This would show you visually where and when 18-20% more volume than required was in a candle. That candle can then be used to identify volume based zones where buys and sellers may be in control. Works well with volume profile.
Specific Time Candlesbelirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında belirli saat aralığında
SPX Open vs SMA AlertThis indicator is specifically designed to identify the first market-relevant candle of the S&P 500 (SPX) after the market opens. The opening price of the trading day is compared to a customizable simple moving average (SMA) period. A visual marker and an alert are triggered when the opening price is above the SMA. Perfect for traders seeking early market trends or integrating automated trading strategies.
Features:
Market Open: The indicator uses the New York market open time (09:30 ET), accounting for time zones and daylight saving time changes.
Flexible Time Offset: Users can set a time offset to trigger alerts after the market opens.
Customizable SMA: The SMA period is adjustable, with a default value of 10.
Visual Representation: A step-line SMA is plotted directly on the chart with subtle transparency and clean markers.
Alert Functionality: Alerts are triggered when conditions are met (opening price > SMA).
Usage:
This indicator is ideal for identifying relevant trading signals early in the session.
Alerts can also serve as triggers for automated trading, e.g., in conjunction with the Trading Automation Toolbox.
Supports both intraday and daily charts.
Alarm Settings:
Select the appropriate symbol (e.g., SPX) and the alert condition "SPX Open > SMA10".
Trigger Settings:
Choose "Once Per Bar Close" to ensure the condition is evaluated at the end of each candle.
If you prefer to evaluate the condition immediately when it becomes true, choose "Once Per Minute".
Duration:
Set the alarm to "Open-ended" if you want it to remain active indefinitely.
Alternatively, set a specific expiration date for the alarm.
Wick Detection (1 and 0) - AYNETDetailed Scientific Explanation
1. Wick Detection Logic
Definition of a Wick:
A wick, also known as a shadow, represents the price action outside the range of a candlestick's body (the region between open and close).
Upper Wick: Occurs when the high value exceeds the greater of open and close.
Lower Wick: Occurs when the low value is lower than the smaller of open and close.
Upper Wick Detection:
pinescript
Kodu kopyala
bool has_upper_wick = high > math.max(open, close)
This checks if the high price of the candle is greater than the maximum of the open and close prices. If true, an upper wick exists.
Lower Wick Detection:
pinescript
Kodu kopyala
bool has_lower_wick = low < math.min(open, close)
This checks if the low price of the candle is less than the minimum of the open and close prices. If true, a lower wick exists.
2. Binary Representation
The presence of a wick is encoded as a binary value for simplicity and computational analysis:
Upper Wick: Represented as 1 if present, otherwise 0.
pinescript
Kodu kopyala
float upper_wick_binary = has_upper_wick ? 1 : 0
Lower Wick: Represented as 1 if present, otherwise 0. This value is inverted (-1) for visualization purposes.
pinescript
Kodu kopyala
float lower_wick_binary = has_lower_wick ? 1 : 0
3. Visualization with Histograms
The plot function is used to create histograms for visualizing the binary wick data:
Upper Wicks: Plotted as positive values with green columns:
pinescript
Kodu kopyala
plot(upper_wick_binary, title="Upper Wick", color=color.new(color.green, 0), style=plot.style_columns, linewidth=2)
Lower Wicks: Plotted as negative values with red columns:
pinescript
Kodu kopyala
plot(lower_wick_binary * -1, title="Lower Wick", color=color.new(color.red, 0), style=plot.style_columns, linewidth=2)
Features and Applications
1. Wick Visualization:
Upper wicks are displayed as positive green columns.
Lower wicks are displayed as negative red columns.
This provides a clear visual representation of wick presence in historical data.
2. Technical Analysis:
Wick formations often indicate market sentiment:
Upper Wicks: Sellers pushed the price lower after buyers drove it higher, signaling rejection at the top.
Lower Wicks: Buyers pushed the price higher after sellers drove it lower, signaling rejection at the bottom.
3. Signal Generation:
Traders can use wick detection to build strategies, such as identifying key price levels or market reversals.
Enhancements and Future Improvements
1. Wick Length Measurement
Instead of binary detection, measure the actual length of the wick:
pinescript
Kodu kopyala
float upper_wick_length = high - math.max(open, close)
float lower_wick_length = math.min(open, close) - low
This approach allows for thresholds to identify significant wicks:
pinescript
Kodu kopyala
bool significant_upper_wick = upper_wick_length > 10 // For wicks longer than 10 units.
bool significant_lower_wick = lower_wick_length > 10
2. Alerts for Long Wicks
Trigger alerts when significant wicks are detected:
pinescript
Kodu kopyala
alertcondition(significant_upper_wick, title="Long Upper Wick", message="A significant upper wick has been detected.")
alertcondition(significant_lower_wick, title="Long Lower Wick", message="A significant lower wick has been detected.")
3. Combined Wick Analysis
Analyze both upper and lower wicks to assess volatility:
pinescript
Kodu kopyala
float total_wick_length = upper_wick_length + lower_wick_length
bool high_volatility = total_wick_length > 20 // Combined wick length exceeds 20 units.
Conclusion
This script provides a compact and computationally efficient way to detect candlestick wicks and represent them as binary data. By visualizing the data with histograms, traders can easily identify wick formations and use them for technical analysis, signal generation, and volatility assessment. The approach can be extended further to measure wick length, detect significant wicks, and integrate these insights into automated trading systems.
Daily Divider 1.0.1Daily Divider with Custom Day Labels is a visual indicator that places vertical dividers on TradingView charts at the start of each day. This indicator helps improve clarity in technical analysis by visually separating each trading session. Additionally, it allows for customization of the day labels with abbreviations (such as “Mon” for Monday, “Tue” for Tuesday, etc.), which are displayed alongside the divider lines.
Features:
• Day Dividers: Draws vertical lines at the start of each trading day to clearly separate daily sessions.
• Custom Day Labels: You can change the day abbreviations (e.g., “Sun” for Sunday, “Mon” for Monday) directly in the indicator settings.
• Style Options: The divider line style (solid, dashed, dotted) and its color can be adjusted to fit your preferences.
• Text Settings: Customize the color and size of the day labels, with the option to show or hide the labels.
• Timeframe Optimization: The divider lines are only drawn on daily or lower timeframes, ensuring they don’t appear on higher timeframes (weekly, monthly, etc.).
This indicator is ideal for traders who perform daily analysis and want a clearer view of the different days of the week on their charts, without the need to manually mark the day divisions.
BoS yellow candleThe "BoS Yellow Candle" indicator identifies and highlights the first candle that breaks a Break of Structure (BoS) in a given look-back period. A BoS occurs when the price either breaks above the highest high or below the lowest low within a user-defined look-back range (default set between 7 and 12 candles).
Bullish Break of Structure: The first candle to break above the previous high is marked with a yellow body.
Bearish Break of Structure: The first candle to break below the previous low is also marked with a yellow body.
This visual aid helps traders quickly identify potential structural breakouts for further analysis or strategy development.
tin hieu mua ban1.Tự động đánh dấu các tín hiệu mua/bán dựa trên điều kiện kỹ thuật
2.cảnh báo thị trường đạt ngưỡng quan trọng hoặc tín hiệu đảo chiều xuất hiện
3.giúp người dùng dễ dành theo dõi và quyết định nhanh chóng trên biểu đồ