[TehThomas] - ICT Volume ImbalanceThis script is a Volume Imbalance (VI) detector and visualizer for use on the TradingView platform. The goal of the script is to automatically identify areas where there are significant imbalances in the volume of trades between consecutive candlesticks and visually highlight these areas. These imbalances can provide traders with valuable insights about the market’s current condition, often signaling potential reversal or continuation points based on price and volume action.
ICT (Inner Circle Trader) Concept of Volume Imbalances
Volume imbalances are a critical concept in the ICT trading methodology. They refer to situations where there is an unusual or significant difference in volume between two consecutive candlesticks, which might indicate institutional or large player activity. According to ICT principles, these imbalances can show us areas of market inefficiency or potential price manipulation. By identifying these imbalances, traders can gain an edge in understanding where the market is likely to move next.
Bullish and Bearish Volume Imbalances:
Bullish Volume Imbalance: This occurs when there is a strong increase in buying pressure, typically indicated by a higher volume on a candle that closes significantly above the previous one, often leaving a gap or larger price movement. The market could be preparing to push higher, and the volume shows a clear shift in buying demand.
Bearish Volume Imbalance:
Conversely, a bearish imbalance occurs when there is a strong increase in selling pressure, typically signaled by a candle that closes significantly lower than the previous one, again with higher volume. This could indicate that large players are offloading positions, and the price is likely to drop further.
Key Features and Functions of the Script
The script automates the process of detecting these volume imbalances and visually marking them on a price chart. Let’s explore its functionality in detail.
1. Inputs Section
The script allows for significant customization through its input options, which help traders adjust the detection and visualization of volume imbalances based on their individual preferences and trading style. Below are the details:
lookback (250 bars): This input specifies the number of bars (or candles) the script should look back when analyzing the volume imbalance. By setting this to 250, the user is looking at the last 250 bars on the chart to detect any significant volume imbalances. This period is adjustable between 50 to 500 bars.
volumeThreshold (1.0 multiplier): This input helps set the sensitivity for identifying volume imbalances. The script compares the volume of the current candle with the previous one, and if the current volume exceeds the previous volume by this threshold multiplier (in this case, 1.0 means at least equal to the previous volume), then it triggers an imbalance. Users can adjust the multiplier to suit different market conditions.
showBoxes (true/false): This toggle determines whether the boxes representing volume imbalances are drawn on the chart. When enabled, the script visually highlights the imbalances with colored boxes.
fillBaseColor (orange with 80% opacity): This is the color setting for the background of the imbalance boxes. A softer color (like orange with opacity) ensures the imbalance is highlighted without obscuring the price action.
borderColor (gray): The color of the border around the imbalance boxes. This adds a visual distinction to make the imbalance areas more visible.
borderWidth (1 pixel): This controls the width of the box's border to adjust how prominent it appears.
rightOffset (30 bars): This input controls how far the imbalance box extends to the right on the chart. It helps users anticipate the potential continuation of the imbalance beyond the current candle.
allowWickOverlap (true/false): This setting allows imbalances to be identified even if the wicks of the two consecutive candlesticks overlap. If set to false, only imbalances where the bodies of the candlesticks don’t overlap are considered.
showBrokenBoxes (true/false): If enabled, once a volume imbalance no longer holds true (i.e., the price breaks through the box), the box is marked as "broken." If disabled, the box is deleted when the imbalance condition no longer applies.
brokenBoxColor (red): This controls the color of the box when it is broken, which can be used as a visual cue that the imbalance was invalidated or no longer valid for analysis.
2. Volume Imbalance Function
This is the core function of the script, where the logic to detect bullish and bearish volume imbalances is implemented.
Bullish Imbalance Condition:
The first condition checks if the low of the current candle is greater than the high of the previous candle. This suggests that the market is moving upward with buying pressure.
The second condition checks whether the volume of the current candle is higher than the previous candle by the volumeThreshold multiplier. If both conditions are satisfied, a bullish imbalance is detected.
Bearish Imbalance Condition:
The first condition checks if the high of the current candle is lower than the low of the previous candle. This suggests downward price action with selling pressure.
The second condition checks whether the current volume exceeds the previous volume by the threshold
Allow Wick Overlap: If allowWickOverlap is set to true, the script will still detect imbalances if the wicks of the two candles overlap (common in volatile markets). If false, imbalances are only considered if the wicks do not overlap.
3. Box Creation and Management
When a volume imbalance is detected, the script creates a box on the chart:
The bullish imbalance box is drawn using the minimum of the open and close of the current bar as the top boundary and the maximum of the open and close of the previous bar as the bottom boundary.
Conversely, the bearish imbalance box is drawn in reverse, using the maximum of the current bar’s open and close as the top boundary and the minimum of the previous bar’s open and close as the bottom boundary.
Once the box is created, it is displayed on the chart with the specified background color, border color, and width.
4. Processing Existing Boxes
After detecting a new imbalance and drawing a box, the script checks whether the box should still remain on the chart:
If the price moves beyond the boundaries of the imbalance box, the box is marked as broken (if showBrokenBoxes is enabled), and its color is changed to red, signifying that the imbalance is no longer valid.
If the box remains intact (i.e., the price has not broken the defined boundaries), the script keeps the box extended to the right as the market continues to evolve.
5. Removing Outdated Boxes
Lastly, the script removes boxes that are older than the specified lookback period. For example, if a box was created 250 bars ago, it will be deleted after that period. This ensures the chart stays clean and only focuses on relevant imbalances.
Why This Script is Useful for Traders
This script is extremely valuable for traders, especially those following the ICT methodology, because it automates the process of detecting market inefficiencies or imbalances that might signal future price action. Here’s why it’s particularly useful:
Identifying Key Areas of Interest: Volume imbalances often point to areas where institutional or large-scale traders have entered the market. These areas could provide clues about the next significant move in the market.
Visualizing Market Structure: By automatically drawing boxes around volume imbalances, the script helps traders visually identify potential areas of support, resistance, or turning points, enabling them to make informed trading decisions.
Time Efficiency: Instead of manually analyzing each candlestick and volume spike, this script does the heavy lifting, saving traders valuable time and allowing them to focus on other aspects of their strategy.
Enhanced Trade Entries and Exits: By understanding where volume imbalances are occurring, traders can time their entries (buying during bullish imbalances and selling during bearish ones) and exits (as imbalances break) more effectively, thus improving their chances of success.
Conclusion
In summary, this script is a powerful tool for traders looking to implement volume imbalance strategies based on the ICT methodology. It automates the identification and visualization of significant imbalances in price and volume, offering traders a clear visual representation of potential market turning points. By customizing the settings, traders can tailor the script to their preferred timeframes and sensitivity, making it a flexible and effective tool for any trading strategy.
__________________________________________
Thanks for your support!
If you found this idea helpful or learned something new, drop a like 👍 and leave a comment, I’d love to hear your thoughts! 🚀
Make sure to follow me for more price action insights, free indicators, and trading guides. Let’s grow and trade smarter together! 📈
インジケーターとストラテジー
Hierarchical + K-Means Clustering Strategy===== USER GUIDE =====
Hierarchical + K-Means Clustering Strategy
OVERVIEW:
This strategy combines hierarchical clustering and K-means algorithms to analyze market volatility patterns
and generate trading signals. It uses a modified SuperTrend indicator with ATR-based volatility clustering
to identify potential trend changes and market conditions.
KEY FEATURES:
- Advanced volatility analysis using hierarchical clustering and K-means algorithms
- Modified SuperTrend indicator for trend identification
- Multiple filter options including moving average and ADX trend strength
- Volume-based exit mechanism to protect profits
- Customizable appearance settings
SETTINGS EXPLANATION:
1. SuperTrend Settings:
- ATR Length: Period for ATR calculation (default: 11)
- SuperTrend Factor: Multiplier for ATR to determine trend bands (default: 3)
2. Hierarchical Clustering Settings:
- Training Data Length: Number of bars used for clustering analysis (default: 200)
3. Appearance Settings:
- Transparency 1 & 2: Control the opacity of trend lines and fills
- Bullish/Bearish Color: Colors for uptrend and downtrend visualization
4. Time Settings:
- Start Year/Month: Define when the strategy should start executing trades
5. Filter Settings:
- Moving Average Filter: Uses SMA to filter trades (only enter when price is on correct side of MA)
- Trend Strength Filter: Uses ADX to ensure trades are taken in strong trend conditions
6. Volume Stop Loss Settings:
- Volume Ratio Threshold: Controls sensitivity of volume-based exits
- Monitoring Delay Bars: Number of bars to wait before monitoring volume for exit signals
HOW TO USE:
1. Apply the indicator to your chart
2. Adjust settings according to your trading preferences and timeframe
3. Long signals appear when price crosses above the SuperTrend line (▲k marker)
4. Short signals appear when price crosses below the SuperTrend line (▼k marker)
5. The strategy automatically manages exits based on volume balance conditions
INTERPRETATION:
- Green line/area: Bullish trend - consider long positions
- Red line/area: Bearish trend - consider short positions
- Yellow line: Moving average for additional trend confirmation
- Volume balance exits occur when buying/selling pressure equalizes
RECOMMENDED TIMEFRAMES:
This strategy works best on 1H, 4H, and daily charts for most markets.
For highly volatile assets, shorter timeframes may also be effective.
RISK MANAGEMENT:
Always use proper position sizing and consider setting additional stop losses
beyond the strategy's built-in exit mechanisms.
===== END OF USER GUIDE =====
Avi - Live 20 ChecklistThis indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
1 hour ago
Release Notes
This indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
1 hour ago
Release Notes
This indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
7 minutes ago
Release Notes
This indicator, called "Live 20 Checklist", is a comprehensive TradingView tool that consolidates multiple technical analysis metrics into one dynamic display. It’s designed to help traders quickly assess market conditions by providing a real-time checklist of key indicators.
Key Features:
Moving Averages & Reversion Signals:
It calculates a primary moving average (with a customizable length and type, either SMA or EMA) and measures the percentage difference between the current price and this average. By comparing this difference over a lookback period, the script generates bullish or bearish reversion signals when the price deviates significantly from the average.
Trend Analysis:
The indicator uses linear regression over user-defined short-term and long-term periods to determine the overall price trend direction. This helps in identifying whether the market is in a bullish or bearish phase over different timeframes.
CCI (Commodity Channel Index):
It computes the CCI to gauge momentum and potential overbought/oversold conditions, with color-coded outputs reflecting the strength of the current momentum.
Volume Metrics:
Volume trends are analyzed by comparing current volume to both short-term and long-term moving averages. It also estimates the full-day volume based on the elapsed time in the trading session and compares it to the previous day’s volume, presenting this as a relative volume (RVOL) multiple.
Gap Detection:
The script scans historical bars to detect bullish and bearish gaps, drawing lines on the chart to visually highlight these gaps. It further identifies the “closest gap” relative to the current price.
Candlestick Pattern Recognition:
A variety of candlestick patterns (such as bullish/bearish engulfing, doji, hammers, marubozu, and more) are detected, with the current pattern highlighted in the table and background color adjusted accordingly.
Dynamic Table Display:
All these metrics are neatly organized in a customizable table on the chart. Traders can choose which rows to display (moving average info, trends, CCI, volume trends, gap details, candlestick patterns, ATR, RVOL, and open-close difference) and adjust the table’s position, text size, and color theme.
Additional Visual Tools:
Besides the main moving average, an extra moving average can be plotted for additional perspective. Pivot high/low labels are also available to mark key price levels, with colors that adjust based on the selected theme.
Overall, the Live 20 Checklist is a robust indicator that merges several analytical tools into one visual dashboard, enabling traders to quickly evaluate market conditions and make informed decisions.
Consolidation Zones [ActiveQuants]The Consolidation Zones indicator is an innovative tool designed to help traders pinpoint periods of low volatility and market balance . By dynamically plotting zones where price action remains confined within an ATR-defined range around a simple moving average (SMA), this indicator highlights periods of consolidation that often precede breakouts or reversals .
█ KEY FEATURES
Dynamic Zone Detection : Automatically identifies consolidation zones when the price remains within a tight range defined by the SMA and ATR over a specified number of bars, signaling balanced market conditions.
Customizable Parameters : Adjust key inputs such as Minimum Zone Length , ATR Length , the number of bars to display, and zone color, enabling you to tailor the indicator to various market conditions and trading styles.
Automated Zone Management : Efficiently plots consolidation zones and cleans up older ones to maintain a clear and focused chart, ensuring you always have an up-to-date view of recent market behavior.
Enhanced Market Analysis : By visualizing areas of price stability, the indicator aids in spotting potential breakout or reversal points, which can be critical for fine-tuning entry and exit strategies.
█ CONCLUSION
The Consolidation Zones indicator is an essential tool for traders who value volatility analysis and precision timing. By marking key periods of price consolidation, it enhances your market analysis, helping you anticipate potential moves and refine your trading strategy.
█ IMPORTANT
⚠ Consolidation signals should be used alongside other technical indicators or analysis techniques such as trend lines, support/resistance levels, or volume to confirm trading decisions.
⚠ Adjust the indicator’s settings based on your preferred timeframe and asset class to achieve the best results.
█ RISK DISCLAIMER
Trading involves significant risk, and you may lose capital. Past performance is not indicative of future results. This tool provides informational signals only and does not constitute financial advice. Use it at your own risk and consult a qualified financial professional before making trading decisions.
Incorporate this indicator into your trading workflow to improve market timing and optimize your entry and exit strategies.
📈 Happy trading! 🚀
Time Box Breakout IndicatorPlots Boxes with breakout signals on whatever timeframe the user selects.
Allows for users to see higher timeframe ranges on lower timeframes.
Useful for scalpers taking advantage of momentum, combined with support and resistance on higher timeframes.
Aids in visualizing risk, ranges and trends.
MTF Fast Trend Information v.9.1pMulti Time Frame Fast Trend Information (MTF FTI).
The indicator uses Super Trend and Moving Averages to display trend information.
In addition, it shows information based on standard TradingView indicators - RSI, MFI, CCI, OBV, and TSI (The Trend Strength Index indicator measures the tendency of a symbol to either trend steadily or to revert to its mean. The core idea behind TSI is that the more momentum a symbol has relative to its volatility, the more likely it is to follow a trend and the less likely it is to revert to its mean. It analyzes price momentum using the Pearson correlation coefficient, a normalized measure of the linear relationship between time series. Its output shows the correlation between the chart's closing prices and bar index values over a defined number of bars).
Also it shows Chop Zone and ER.
Efficiency Ratio (ER) - It measures the efficiency of price movements. It quantifies how much the price has moved in a given direction relative to its overall volatility. A high ER indicates a strong trend, while a low ER suggests choppy, sideways movement.
ER values scale: H (high), M (medium), L (low).
For more information above ER google KAMA (Kaufman's Adaptive Moving Average).
The Chop Zone indicator allows one to determine whether a market is choppy, showcasing a sideways trend, or not choppy, showcasing a directional trend.
CZ values scale - Red (high values) for the choppy market and Green (low values) for the dominant trend.
CZ can be displayed above or below candles or at the top or bottom of the screen (or turned off). It acts like the standard Chop Zone indicator.
Trend values scale: Up, Down, UP+, Down+. Plus means stronger movement.
TSI values scale: SU (strong up), UP, WU (week up), N+ (above neutral), N (neutral), N- (below neutral), WD (weak down), DN (down), SD (strong down).
CCI, RSI, MFI values scale: OB (over bought), NB (near overbought), WB(weak overbought), N+ (above neutral), N (neutral), N- (below neutral), WO (weak oversold), NO (near oversold), OS (over sold).
VW shows whether the price is above (A) or below (B) VWAP (VWAP is irrelevant for daily or higher time frames).
OBV values scale: BEAR for bearish, BULL for bullish, and NTRL for neutral.
OBV divergence valies scale: HBL (hidden bullish), HBR (hidden bearish), NTR (neutral), RBR/RBL (regular bearich/bullish)
The indicator supports up to seven Time Frames. The more Time Frames it uses, the lower the response time. Five enabled Time Frames are more than enough. You can turn on and off any Time Frame you define.
You can switch between Super Trend and Moving Averages for trend direction detection.
If you encounter a loading problem, refresh the browser and use less enabled Time Frames.
Trend Structure Shift By BCB Elevatebcbelevate.gumroad.com
Trend Structure Shift By BCB Elevate
Overview:
This indicator is a streamlined tool designed to assess the market’s trend structure by pinpointing key price swings. By detecting higher highs and lower lows, the indicator categorizes the market as Bullish, Bearish, or Neutral. Developed by BCB Elevate, it serves as an educational tool for traders seeking to enhance their technical analysis toolkit.
Script Details:
Swing Length Input:
The user can define the “Swing Length” (default is 10 bars) to set the period over which the indicator calculates price extremes.
The script determines the highest high (hh) and the lowest low (ll) within this defined period using ta.highest and ta.lowest functions.
Comparison With Previous Swings:
The script calculates the previous swing’s high (prev_hh) and low (prev_ll) over a period of twice the swing length (using a one-bar offset) to provide a basis for comparison.
If the current highest high exceeds the previous swing’s high, the market is flagged as Bullish.
Conversely, if the current lowest low falls below the previous swing’s low, the market is flagged as Bearish.
If neither condition is met, the market remains Neutral.
Trend Variable and Logical Flow:
A persistent variable trend is declared to store the current trend state.
Using the conditional operator (?:), the script assigns a value of 1 for Bullish, -1 for Bearish, or maintains the previous trend if no new swing condition is met.
Visual Table Display:
The indicator creates a table on the chart to display the current trend status.
The user can choose the table’s position from four options (Top Right, Top Left, Bottom Right, or Bottom Left) to ensure the display aligns with their chart layout.
The table updates dynamically with the text “Bullish,” “Bearish,” or “Neutral” and uses corresponding colors (green for bullish, red for bearish, and gray for neutral) for easy visual interpretation.
Usage & Interpretation:
Input Customization:
Adjust the Swing Length to either capture more granular swings or to smooth out the noise for longer-term trends.
Choose your preferred table position to integrate the indicator seamlessly into your existing chart setup.
Trend Signals:
Bullish Trend: Displayed when a new higher high is identified compared to the previous swing period. This suggests that buyers are in control.
Bearish Trend: Displayed when a new lower low is observed relative to the prior period, indicating selling pressure.
Neutral: Indicates that no significant new swing has been detected, meaning the market may be in a consolidation phase.
Important Notices and Compliance:
Educational Purpose:
This indicator is provided for educational and informational purposes only. It is not intended as financial advice.
Always perform your own analysis or consult with a professional advisor before making any trading decisions.
Final Thoughts:
The "Trend Structure Shift By BCB Elevate" indicator offers a clear, customizable method for evaluating market trends based on price swings. Whether you are a beginner or an experienced trader, understanding these key swing dynamics can enhance your market perspective and assist in making more informed trading decisions.
Happy Trading!
UT Bot Alerts – Time Filtered with ExitsThis indicator combines several technical approaches to generate precise entry and exit signals, while incorporating time filters that ensure signals are sent only during desired time windows and with defined cooldown periods. It is based on the original idea by QuantNomad.
Main Components:
ATR-based Trailing Stop:
Using the Average True Range (ATR) and an adjustable multiplier ("Key Value"), a dynamic trailing stop is calculated that adapts to the current price. This trailing stop forms the basis for the signal generation.
EMA-based Entry Signals:
A very short exponential moving average (EMA, period 1) is used in combination with the trailing stop to identify clear buy (long) and sell (short) signals via crossovers. An additional buffer zone helps reduce false signals.
Persistent Trade State:
The current state (long, short, or neutral) is maintained so that the system remains in the trend until a new signal is generated.
Linear Regression as Reference:
A linear regression line computed over a defined period serves as a reference for determining exit levels.
Exit Signals with Delay:
Exit signals are generated when the price deviates from the linear regression line by a defined percentage (Exit Signal Deviation) and the condition persists for at least a specified number of bars (Exit Signal Delay). Only one exit signal is issued per trade to avoid excessive exits.
Time Filters and Cooldown:
Session Filter: A user-defined session (e.g., "2200-0500") can disable signals during specified periods.
Cooldown Period: After a signal is triggered, a cooldown phase (in minutes) can be set during which no new signals are sent.
Visual Display and Alerts:
Entry Signals: Buy and sell signals are displayed as labels (green for long, red for short).
Exit Signals: Exit signals appear as triangles, with the exit long signal text displayed in white.
Reference Lines:
The upper exit level (Exit Short Level) is drawn as a solid line in turquoise (color.aqua).
The lower exit level (Exit Long Level) is drawn as a solid line in yellow.
Additionally, the ATR trailing stop and the linear regression line are clearly plotted on the chart.
Alerts can be configured for all signal types.
In Summary:
The indicator delivers precise entry signals based on an ATR trailing stop and a short EMA, supplemented by dynamic exit levels determined via linear regression. With integrated time filters (session and cooldown) and a flexible exit mechanism, this indicator offers controlled trade management—ideal for traders who wish to receive signals only during desired time periods.
Original Author: QuantNomad
VSA Volume + Fibonacci (Volunacci)This indicator is used to draw fibo levels on the VSA volume candles
Bullish Strategy SignalOverview
This TradingView Pine Script is a bullish strategy signal based on a combination of several technical indicators. It identifies potential buy signals when multiple conditions are met, ensuring higher probability trades by reducing false signals. The strategy combines trend-following , momentum , volume , and breakout indicators.
Features
- Configurable Inputs : All key parameters, such as moving average lengths, MACD settings, RSI thresholds, Bollinger Bands settings, and volume averages, can be adjusted by the user. The default values are pre-set based on typical configurations for a bullish strategy.
- Bullish Signal Generation : A buy signal is triggered when the following conditions are met:
1. Trend Confirmation : Price is above the 200-period moving average (indicating an uptrend).
2. Momentum Confirmation : The MACD line crosses above the signal line, indicating bullish momentum.
3. Strength Confirmation : RSI crosses above a user-defined threshold (default is 50), indicating upward momentum.
4. Breakout Confirmation : Price breaks above the middle Bollinger Band, signaling potential continuation of the trend.
5. Volume Confirmation : The trading volume is above its 20-period average, suggesting strong market participation.
Technical Indicators Used
- 50/200 Moving Averages : To determine the long-term and short-term trend.
- MACD (Moving Average Convergence Divergence) : Used for identifying momentum shifts.
- RSI (Relative Strength Index) : To evaluate if the stock is in an overbought or oversold condition.
- Bollinger Bands : Used to track price volatility and confirm breakouts.
- Volume : To ensure that the price movement is supported by significant trading activity.
How It Works
The script will generate green "BUY" labels below bars when all the following conditions are true:
1. The 50-day moving average is above the 200-day moving average, confirming a bullish trend.
2. A MACD crossover occurs, signaling increasing momentum.
3. The RSI crosses above the user-defined threshold, confirming strength.
4. The price breaks above the middle Bollinger Band, indicating the start of a potential breakout.
5. The trading volume exceeds its 20-period average, ensuring that the breakout is supported by sufficient buying interest.
User Configuration
- Moving Average Periods : Length for the short-term (50) and long-term (200) moving averages.
- MACD Settings : Fast length (12), slow length (26), and signal length (9).
- RSI Settings : Length (14) and threshold (default 50).
- Bollinger Bands Settings : Length (20) and standard deviation (2).
- Volume Settings : Length (20) for the volume moving average.
How to Use
1. Open TradingView and navigate to the Pine Editor .
2. Copy and paste the provided script into the editor.
3. Click on Add to Chart to display the strategy on your chart.
4. Adjust the input parameters as needed to fit your trading style or time frame.
5. Look for green “BUY” labels below the price bars, which indicate a bullish signal.
Conclusion
This script combines multiple technical indicators to ensure that each buy signal is supported by trend, momentum, volume, and breakout confirmations. By configuring key settings, traders can fine-tune the strategy to match their trading preferences and time frames.
Rolling Cumulative Volume DeltaRolling CVD is your market’s lie detector no resets, just raw volume truth! checks: close > open? Add volume (buyers flexing). Close < open? Subtract it (sellers sulking). Ties = zero. It rolls forever, plotting the vibe.
Use it when price fakes you out rising but CVD dips? Trouble. Dropping but CVD climbs? Sneaky strength. Perfect for scalpers sniffing momentum, swing traders riding waves, or that volume-obsessed buddy who overanalyses everything!
Shines best on timeframes under 15m to catch those sneaky price fibs in action!
Don’t bet your lunch money on Rolling CVD alone, you wild child! Pair it with your fave indicators RSI, moving averages, tea leaves, whatever because confluence is king. It’s a sly hint, not a crystal ball, so trade smart or the market’ll spank ya!
NDX Scalping StrategySignals Long and Short Entries using moving averages with profit targets on NDX
Dynamic Timeframe Trend AnalyzerPurpose and Core Logic
This indicator automatically adjusts its calculations based on the current chart’s timeframe, allowing traders to analyze trends, momentum, and mean reversion opportunities without manually changing indicator settings for each interval. It detects potential long or short setups by combining several techniques:
Dynamic Timeframe Factor
The script compares the current timeframe to a base (e.g., 5 minutes) and calculates a “factor” to scale certain parameters, such as EMA lengths or ATR settings. This reduces the need to reconfigure indicators when switching timeframes.
Regime Detection
It uses ADX (Average Directional Index) to classify the market as strongly trending, moderately trending, choppy, or in a potential mean-reversion phase.
RSI (Relative Strength Index) is also monitored for extreme levels (e.g., overbought/oversold) to detect potential reversal zones.
Volume is compared to a moving average to confirm or refute volatility conditions.
Trend & Mean Reversion Signals
EMA Alignment (8/21/55) helps identify bullish or bearish phases (strong bull if all EMAs align upward, strong bear if aligned downward).
For mean reversion opportunities, the script checks if ADX is sufficiently low (indicating weak or no trend) while price and RSI are at extreme levels—suggesting a snapback or countertrend move may occur.
Dynamic Stop Loss & Take Profit
Uses ATR (Average True Range) to set initial stop-loss (SL) and take-profit (TP) levels, then adjusts these levels further with “regime multipliers” based on whether the market is in a high-volatility trend or a quieter mean-reversion environment.
This approach aims to place stops and targets in a more adaptive way, reflecting current market conditions rather than a one-size-fits-all approach.
Visual Aids
Color-coded chart backgrounds (e.g., greenish for bullish trend, red for bearish, yellow/orange for mean reversion).
Triangles to show recent bullish/bearish signals.
A status table in the top-right corner (optional) displaying key metrics like ADX, RSI, dynamic thresholds, current SL/TP levels, and whether a stop loss has been hit.
How It Works Internally
ADX & Dynamic Thresholds:
A moving average (adx_mean) and standard deviation (adx_std) of the ADX are calculated over a lookback period to define “strong” vs. “weak” ADX thresholds.
This allows the script to adapt to changing volatility and trend strength in different markets or timeframes.
Mean Reversion Criteria:
The indicator checks if price deviates significantly from its own moving average, alongside RSI extremes. If ADX suggests no strong directional push (i.e., the market is “quiet”), it may classify conditions as mean-reverting.
Regime Multipliers:
Once the script identifies the market regime (e.g., strong uptrend, choppy, mean reversion), it applies different multipliers to the user-defined base values for stop-loss and take-profit. For instance, strong trending conditions might allow for wider stops to handle volatility, while mean reversion signals use tighter exits to capture quick reversals.
How to Use It
Timeframe Agnostic
Simply apply it to any timeframe (from 1-minute up to daily or weekly). The “Dynamic Timeframe Factor” will scale the indicator parameters automatically.
Look for Buy/Sell Triangles
When the script detects a valid bullish trend shift or a mean-reversion long setup, it plots a green triangle under the price bar. Conversely, it plots a red triangle above the price bar for bearish or mean-reversion short setups.
Check the Status Table
The table in the top-right corner summarizes the indicator’s current readings: ADX, RSI, volume trends, and the market regime classification.
The table also shows if a stop loss has been hit (SL Hit) and displays recommended SL/TP levels if a signal is active.
Stop Loss & Take Profit
The script plots lines for SL and TP on your chart after a new signal. These lines are automatically adjusted based on ATR, volume conditions, and ADX-derived multipliers.
Mean Reversion vs. Trend-Following
If you see a “Mean Rev” state in the table or the background turning yellow/orange, it suggests potential countertrend trades. Conversely, “STRONG BULL” or “STRONG BEAR” states favor momentum-based entries in the prevailing direction.
Originality & Benefits
Adaptive to Timeframe: Many indicators require reconfiguration when switching from short to long timeframes. This script automates that process using the “timeframe factor” logic.
Regime-Based SL/TP: Instead of fixed risk parameters, the script dynamically tunes stop and target levels depending on whether the market is trending or reverting.
Comprehensive Market View: It combines multiple factors—ADX, RSI, volume, moving averages, and volatility measurements—into a single, integrated framework that categorizes the market regime in real time.
Best Practices & Notes
Timeframes: It typically performs well on intraday timeframes (5m, 15m, 1H) but can also be used for swing trading on 4H or Daily charts.
Settings: The defaults are a good starting point, but you can adjust the base ATR multiplier or ADX lookbacks if you prefer a different balance between sensitivity and stability.
Risk Management: This indicator is not a guarantee of any specific results. Always use proper risk management (position sizing, stop-losses, and diversified strategies).
Alert Conditions: Built-in alert conditions can notify you when a new long or short signal appears, or when a stop loss is triggered.
EMA Cross🔥EMA Cross – Multi-Timeframe Trend & Crossover Indicator⚡
📌 Overview
The EMA Cross Indicator is a trend-following tool designed to help traders identify market trends and potential trade opportunities using Exponential Moving Averages (EMAs). It provides clear crossover signals, allowing traders to spot trend reversals and momentum shifts with precision.
📌 Concept & Working Mechanism
1. Multi-Timeframe EMAs:
- Plots two customizable EMAs (Fast EMA & Slow EMA) that can be set to any timeframe.
- Helps traders determine short-term and long-term trend direction.
2. EMA Crossover Signals:
- Golden Cross (Bullish Signal): Occurs when the fast EMA crosses above the slow EMA, indicating a potential uptrend.
- Death Cross (Bearish Signal): Occurs when the fast EMA crosses below the slow EMA, signaling a possible downtrend.
3. Customizable Crossover Alerts:
- Choose from different shapes (arrow, triangle, circle, cross) to highlight EMA crossovers for better visualization.
- Helps traders quickly recognize trend shifts on the chart.
4. Dynamic Trend Adaptation:
- Supports timeframe selection to analyze trends from different perspectives.
- Works across all asset classes, including Forex, Crypto, Stocks, and Commodities.
📌 How to Use
1- Trend Confirmation: Use the EMA direction and crossover signals to validate trend strength.
2- Entry & Exit Strategy:
3- Enter long trades after a Golden Cross, indicating bullish momentum.
4- Enter short trades after a Death Cross, signaling bearish pressure.
5- Custom Alerts & Visuals: Customize crossover signals for clear trade identification.
📌 Why Use This Indicator?
✅ Multi-timeframe EMAs for accurate trend analysis.
✅ Clear crossover signals for easy trade execution.
✅ Customizable shapes for crossover visualization.
✅ Works on all markets and trading styles.
Pivot Boss IndicatorsThese are the indicators described in the book - Secrets Of A Pivot Boss, by Franklin Ochoa.
FinFluential Global M2 Money Supply // Days Offset =The "Global M2 Money Supply" indicator calculates and visualizes the combined M2 money supply from multiple countries and regions worldwide, expressed in trillions of USD.
M2 is a measure of the money supply that includes cash, checking deposits, and easily convertible near-money assets. This indicator aggregates daily M2 data from various economies, converts them into a common USD base using forex exchange rates, and plots the total as a single line on the chart.
It is designed as an overlay indicator aligned to the right scale, making it ideal for comparing global money supply trends with price action or other market data.
Key Features
Customizable Time Offset: Users can adjust the number of days to shift the M2 data forward or backward (from -1000 to +1000 days) via the indicator settings. This allows for alignment with historical events or forward-looking analysis.
Global Coverage Includes:
Eurozone: Eurozone M2 (converted via EUR/USD)
North America: United States, Canada
Non-EU Europe: Switzerland, United Kingdom, Finland, Russia
Pacific: New Zealand
Asia: China, Taiwan, Hong Kong, India, Japan, Philippines, Singapore
Latin America: Brazil, Colombia, Mexico
Middle East: United Arab Emirates, Turkey
Africa: South Africa
Global Futures Market Sessions & Key LevelsAutomatically marks time zones, and levels for global market sessions
asia london new york
high and low
prior day high and low
imbalance (1st hour orb)
etc
Spekulator Maliyet Analizi Pro V4//@version=6
indicator('Spekulator Maliyet Analizi Pro V4', overlay = true, max_labels_count = 500, max_lines_count = 500)
// =================== GLOBAL DEĞİŞKENLER ===================
// Trend değişkenleri
var bool uptrend = false
var float last_swing_low = na
var float last_swing_high = na
var int last_swing_low_index = na
var int last_swing_high_index = na
// Maliyet değişkenleri
var float alis_maliyeti = na
var float satis_maliyeti = na
var float alis_maliyeti_alt = na
var float alis_maliyeti_ust = na
var float satis_maliyeti_alt = na
var float satis_maliyeti_ust = na
// Pozisyon değişkenleri
var bool pozisyonda = false
var bool son_islem_alis = false
var float giris_fiyati = na
var float cikis_fiyati = na
var int son_giris_cikis_zamani = 0
var float max_kar = 0.0
var float max_zarar = 0.0
var float curr_kar = 0.0
var bool olasi_alis = false
var bool olasi_satis = false
var bool alis_sinyal = false
var bool satis_sinyal = false
var float trailing_stop_seviyesi = na
var float trailing_stop_max = na
var float trailing_stop_min = na
var bool alis_yapildi = false
var bool satis_yapildi = false
// Sinyal kosullari
var bool alis_kosul_1 = false
var bool satis_kosul_1 = false
var bool alis_filtre = false
var bool satis_filtre = false
var bool alis_ek_kosul = false
var bool satis_ek_kosul = false
var bool alis_pozisyon_kosul = false
var bool satis_pozisyon_kosul = false
var bool pozisyon_kisitlama_alis = false
var bool pozisyon_kisitlama_satis = false
var bool alis_crossover = false
var bool satis_crossunder = false
var float olasi_alis_seviyesi = na
var float olasi_satis_seviyesi = na
// Crossover/Crossunder değişkenleri
var bool alis_tp_crossover = false
var bool satis_tp_crossunder = false
var bool alis_sl_crossunder = false
var bool satis_sl_crossover = false
var bool trailing_stop_crossunder = false
// Pre-calculated check variables
var bool alis_tp_crossover_check = false
var bool alis_sl_crossunder_check = false
var bool satis_tp_crossunder_check = false
var bool satis_sl_crossover_check = false
var bool trailing_stop_crossunder_check = false
// POC değişkenleri (Point of Control)
var float poc_fiyat = na
var float poc_hacim = 0.0
var float poc_yuzde = 0.0
var float rsi = na
var float rsi_deger = na
var bool rsi_alis_kosul = true
var bool rsi_satis_kosul = true
var float alis_sl = na
var float alis_tp = na
var float satis_sl = na
var float satis_tp = na
var color poc_renk = color.white
var string poc_metin = ""
// Volatilite değişkenleri
var float volatilite = na
var float volatilite_ort = na
var float fiyat_degisim_yuzde = 0.0
var bool siradisi_fiyat = false
var bool siradisi_hacim = false
var bool siradisi_volatilite = false
var bool siradisi_hareket = false
var bool siradisi_alis = false
var bool siradisi_satis = false
var bool yukselen_mumlar = false
var bool dusen_mumlar = false
var float swing_yuksek = na
var float swing_dusuk = na
var float hacim_orani = 0.0
var float vol_sma = 0.0
var bool yuksek_hacim = false
var table table_obj = na
// VPVR Değişkenleri
var float vpvr_poc_fiyat = na
var bool vpvr_ustunde = false
var color vpvr_poc_renk = color.gray
var string vpvr_poc_metin = ""
var float vpvr_poc_hacim = 0.0
var float vpvr_poc_yuzde = 0.0
// Histogram veri dizileri
var float vpvr_histogram_alt_liste = array.new_float()
var float vpvr_histogram_ust_liste = array.new_float()
var float vpvr_histogram_fiyat_liste = array.new_float()
var float vpvr_histogram_alim_hacmi_liste = array.new_float()
var float vpvr_histogram_satim_hacmi_liste = array.new_float()
var float vpvr_histogram_hacim_yuzde_liste = array.new_float()
// Görsel objeler için diziler
var box vpvr_alim_kutulari = array.new_box()
var box vpvr_satim_kutulari = array.new_box()
var line vpvr_cizgiler = array.new_line()
// =================== GORSEL AYARLAR ===================
g_grup1 = "Gorsel Ayarlar - Renkler"
i_alis_renk = input.color(color.green, "Alis Bölgesi Rengi", group=g_grup1)
i_satis_renk = input.color(color.red, "Satis Bölgesi Rengi", group=g_grup1)
i_ok_renk_alis = input.color(color.green, "Alis Ok Rengi", group=g_grup1)
i_ok_renk_satis = input.color(color.red, "Satis Ok Rengi", group=g_grup1)
i_olasi_alis_renk = input.color(color.new(color.green, 50), "Olası Alış Rengi", group=g_grup1)
i_olasi_satis_renk = input.color(color.new(color.red, 50), "Olası Satış Rengi", group=g_grup1)
i_sl_renk = input.color(color.red, "Stop Loss Rengi", group=g_grup1)
i_tp_renk = input.color(color.green, "Take Profit Rengi", group=g_grup1)
i_panel_yazi_renk = input.color(color.white, "Panel Yazı Rengi", group=g_grup1)
i_panel_baslik_renk = input.color(color.yellow, "Panel Başlık Rengi", group=g_grup1)
i_panel_renk = input.color(color.new(color.black, 90), "Panel Arka Plan Rengi", group=g_grup1)
g_grup2 = "Gorsel Ayarlar - Stil"
i_cizgi_kalinlik = input.int(2, "Ana Çizgi Kalınlığı", minval=1, maxval=4, group=g_grup2)
i_sl_tp_kalinlik = input.int(1, "SL/TP Çizgi Kalınlığı", minval=1, maxval=4, group=g_grup2)
i_panel_konum = input.string("Sag Üst", "Panel Konumu", options= , group=g_grup2)
i_panel_saydamlik = input.int(50, "Panel Saydamlığı", minval=0, maxval=100, group=g_grup2)
g_grup3 = "Hesaplama - Swing Ayarları"
i_swing_periyot = input.int(10, "Swing Periyodu", minval=5, maxval=50, group=g_grup3, tooltip="Swing noktalarını belirlemek için kullanılacak periyot")
i_swing_yuzde = input.float(1.5, "Min. Swing (%)", minval=0.5, step=0.1, group=g_grup3, tooltip="Minimum swing hareketi yüzdesi")
i_swing_onay = input.int(3, "Swing Onay Mumu", minval=1, maxval=5, group=g_grup3, tooltip="Swing noktasının onaylanması için gereken mum sayısı")
i_pivot_lookback = input.int(10, "Pivot Lookback", minval=5, maxval=50, group=g_grup3, tooltip="Pivot noktalarını belirlemek için kullanılacak periyot")
g_grup4 = "Hesaplama - Fibonacci Ayarları"
i_fib_seviye = input.float(0.618, "Ana Fibonacci Seviyesi", minval=0.1, maxval=1.0, step=0.001, group=g_grup4)
i_fib_alt = input.float(0.5, "Alt Fibonacci Seviyesi", minval=0.1, maxval=1.0, step=0.001, group=g_grup4)
i_fib_ust = input.float(0.786, "Üst Fibonacci Seviyesi", minval=0.1, maxval=1.0, step=0.001, group=g_grup4)
g_grup5 = "Risk Yönetimi"
i_sl_yuzde = input.float(1.5, "Stop Loss (%)", minval=0.5, step=0.1, group=g_grup5)
i_tp_yuzde = input.float(3.0, "Take Profit (%)", minval=1.0, step=0.1, group=g_grup5)
i_trailing_stop = input.bool(false, "Trailing Stop Kullan", group=g_grup5)
i_trailing_yuzde = input.float(1.0, "Trailing Stop (%)", minval=0.5, step=0.1, group=g_grup5)
g_grup6 = "Filtreler"
i_rsi_aktif = input.bool(false, "RSI Filtresini Kullan", group=g_grup6)
i_rsi_period = input.int(14, "RSI Periyodu", minval=1, group=g_grup6)
i_rsi_ust = input.int(70, "RSI Üst Sınır", minval=50, maxval=100, group=g_grup6)
i_rsi_alt = input.int(30, "RSI Alt Sınır", minval=0, maxval=50, group=g_grup6)
i_hacim_aktif = input.bool(false, "Hacim Filtresini Kullan", group=g_grup6)
i_hacim_period = input.int(20, "Hacim Ortalama Periyodu", minval=1, group=g_grup6)
i_hacim_carpan = input.float(1.5, "Hacim Çarpanı", minval=1.0, step=0.1, group=g_grup6)
g_grup7 = "Sinyal Ayarları"
i_alis_sinyal_seviyesi = input.float(0.0, "Alış Sinyal Seviyesi (%)", minval=-100, maxval=100, step=0.1, group=g_grup7)
i_satis_sinyal_seviyesi = input.float(0.0, "Satış Sinyal Seviyesi (%)", minval=-100, maxval=100, step=0.1, group=g_grup7)
i_sinyal_tetik_yuzde = input.float(2.0, "Sinyal Mesafesi (%)", minval=0.1, maxval=10.0, step=0.1, group=g_grup7, tooltip="Maliyet seviyesine göre sinyal mesafesi")
i_sinyal_ters_yon = input.bool(true, "Sadece Ters Yön Sinyalleri", group=g_grup7, tooltip="Aktif olduğunda, sadece önceki sinyalin tersi yönünde sinyal üretir")
i_sinyal_pozisyon_kontrol = input.bool(true, "Pozisyon Kontrolü", group=g_grup7, tooltip="Aktif olduğunda, pozisyondayken aynı yönde sinyal üretmez")
g_grup8 = "Olası Sinyal Ayarları"
i_olasi_sinyal_hassasiyeti = input.float(0.5, "Olası Sinyal Hassasiyeti (%)", minval=0.1, maxval=5.0, step=0.1, group=g_grup8)
// =================== YENİ EKLENTİ: SIRA DIŞI HAREKET ALGILAMA ===================
g_grup10 = "Sıra Dışı Hareket Algılama"
i_siradisi_fiyat_yuzde = input.float(3.0, "Ani Fiyat Değişimi (%)", minval=0.5, step=0.1, group=g_grup10, tooltip="Bu yüzdenin üzerindeki ani fiyat değişimleri anormal hareket olarak işaretlenir")
i_siradisi_hacim_carpan = input.float(2.5, "Hacim Artış Çarpanı", minval=1.5, step=0.1, group=g_grup10, tooltip="Normal hacimin bu katı üzerindeki hacimler anormal olarak kabul edilir")
i_siradisi_volatilite_carpan = input.float(2.0, "Volatilite Artış Çarpanı", minval=1.2, step=0.1, group=g_grup10, tooltip="Normal volatilitenin bu katı üzerindeki değerler anormal olarak kabul edilir")
// =================== VOLUME PROFILE VISIBLE RANGE AYARLAR ===================
g_grup_vpvr = "Volume Profile Ayarları"
i_vpvr_aktif = input.bool(false, "VPVR Göster", group=g_grup_vpvr, tooltip="Volume Profile Visible Range özelliğini etkinleştirir")
i_line_renk = input.color(color.new(color.gray, 25), "Üst/Alt Çizgi Rengi", group=g_grup_vpvr)
i_alis_bar_renk = input.color(color.new(color.green, 25), "Alış Bar Rengi", group=g_grup_vpvr)
i_satis_bar_renk = input.color(color.new(color.red, 25), "Satış Bar Rengi", group=g_grup_vpvr)
i_bar_sayisi = input.int(90, "Bar Sayısı", minval=14, maxval=365, group=g_grup_vpvr)
i_son_mumdan_mesafe = input.int(2, "Son Mumdan Mesafe", minval=2, maxval=20, group=g_grup_vpvr)
i_histogram_sayisi = input.int(50, "Histogram Sayısı", minval=10, maxval=200, group=g_grup_vpvr)
i_poc_genislik = input.int(50, "PoC Genişliği", minval=20, maxval=100, group=g_grup_vpvr)
// =================== FONKSİYONLAR ===================
isSwingHigh(index) =>
high > high and high > high and high > high and high > high
isSwingLow(index) =>
low < low and low < low and low < low and low < low
// Olası sinyal fonksiyonları
getOlasiAlisSinyali(curr_close, prev_close, maliyet) =>
result = false
if not na(maliyet)
fark_yuzde = math.abs((curr_close - maliyet) / maliyet * 100)
result := curr_close > prev_close and fark_yuzde <= i_olasi_sinyal_hassasiyeti
result
getOlasiSatisSinyali(curr_close, prev_close, maliyet) =>
result = false
if not na(maliyet)
fark_yuzde = math.abs((curr_close - maliyet) / maliyet * 100)
result := curr_close < prev_close and fark_yuzde <= i_olasi_sinyal_hassasiyeti
result
// Olası sinyal seviyelerini hesaplama fonksiyonları
getOlasiAlisSeviyesi(maliyet) =>
float sonuc = na
if not na(maliyet)
sonuc := maliyet * (1 - i_olasi_sinyal_hassasiyeti/100)
sonuc
getOlasiSatisSeviyesi(maliyet) =>
float sonuc = na
if not na(maliyet)
sonuc := maliyet * (1 + i_olasi_sinyal_hassasiyeti/100)
sonuc
// =================== TEKNİK GÖSTERGELER ===================
// RSI Hesaplama
rsi := ta.rsi(close, i_rsi_period)
rsi_deger := rsi
rsi_alis_kosul := i_rsi_aktif ? rsi < i_rsi_alt : true
rsi_satis_kosul := i_rsi_aktif ? rsi > i_rsi_ust : true
// Hacim Analizi
vol_sma := ta.sma(volume, i_hacim_period)
float yerel_hacim_orani = volume / vol_sma
hacim_orani := yerel_hacim_orani
yuksek_hacim := i_hacim_aktif ? yerel_hacim_orani > i_hacim_carpan : true
// Sıra dışı hareket hesaplamaları
volatilite := ta.atr(14)
volatilite_ort := ta.sma(volatilite, 20)
// Fiyat değişimi hesaplama
fiyat_degisim_yuzde := math.abs((close - close ) / close * 100)
// Sıra dışı hareket sinyalleri
siradisi_fiyat := fiyat_degisim_yuzde > i_siradisi_fiyat_yuzde
siradisi_hacim := hacim_orani > i_siradisi_hacim_carpan
siradisi_volatilite := volatilite > volatilite_ort * i_siradisi_volatilite_carpan
// Genel sıra dışı hareket tespiti (en az ikisi doğru olmalı)
siradisi_hareket := (siradisi_fiyat and siradisi_hacim) or (siradisi_fiyat and siradisi_volatilite) or (siradisi_hacim and siradisi_volatilite)
// Alış veya satış yönünü belirle
siradisi_alis := siradisi_hareket and close > open
siradisi_satis := siradisi_hareket and close < open
// =================== HESAPLAMALAR ===================
// Trend değişkenleri
yukselen_mumlar := close > open
dusen_mumlar := close < open
// =================== SWING HIGH/LOW HESABI ===================
// Swing High/Low hesaplama
swing_yuksek := ta.pivothigh(i_pivot_lookback, i_pivot_lookback)
swing_dusuk := ta.pivotlow(i_pivot_lookback, i_pivot_lookback)
// Son swing high/low güncelleme
if not na(swing_yuksek)
last_swing_high := swing_yuksek
if not na(swing_dusuk)
last_swing_low := swing_dusuk
// Trend belirleme
if not na(last_swing_high) and not na(last_swing_low)
if high > last_swing_high and not uptrend
uptrend := true
if low < last_swing_low and uptrend
uptrend := false
// =================== MALİYET HESABI ===================
// Maliyet değişkenleri daha önce tanımlandı
// Alış maliyeti hesaplama
if uptrend and not na(last_swing_low) and not na(last_swing_high)
fib_range = last_swing_high - last_swing_low
alis_maliyeti := last_swing_high - fib_range * i_fib_seviye
alis_maliyeti_alt := last_swing_high - fib_range * i_fib_alt
alis_maliyeti_ust := last_swing_high - fib_range * i_fib_ust
// Satış maliyeti hesaplama
if not uptrend and not na(last_swing_low) and not na(last_swing_high)
fib_range = last_swing_high - last_swing_low
satis_maliyeti := last_swing_low + fib_range * i_fib_seviye
satis_maliyeti_alt := last_swing_low + fib_range * i_fib_alt
satis_maliyeti_ust := last_swing_low + fib_range * i_fib_ust
// =================== POZİSYON YÖNETİMİ ===================
// Pozisyon değişkenleri zaten daha önce tanımlandı, tekrar etmiyoruz
// Stop ve hedef seviyeleri artık başlangıçta tanımlandığı için yeniden tanımlamıyoruz, sadece değer atıyoruz
alis_sl := na
alis_tp := na
satis_sl := na
satis_tp := na
if not na(alis_maliyeti)
alis_sl := alis_maliyeti * (1 - i_sl_yuzde/100)
alis_tp := alis_maliyeti * (1 + i_tp_yuzde/100)
if not na(satis_maliyeti)
satis_sl := satis_maliyeti * (1 + i_sl_yuzde/100)
satis_tp := satis_maliyeti * (1 - i_tp_yuzde/100)
// =================== SİNYAL HESAPLAMA ===================
var float last_signal_price = na
var int last_signal_type = 0 // 1 = alis, -1 = satis, 0 = sinyal yok
var string last_signal_time = na
var bool last_signal_success = false
var int win_count = 0
var int loss_count = 0
var int total_signals = 0
var string status_text = ""
var color status_color = color.gray
var float profit_pct = 0.0
var float loss_pct = 0.0
var float trail_level = na
// Alış ve satış sinyalleri
alis_crossover := ta.crossover(close, alis_maliyeti * (1 + i_alis_sinyal_seviyesi/100))
satis_crossunder := ta.crossunder(close, satis_maliyeti * (1 + i_satis_sinyal_seviyesi/100))
// Olası sinyal seviyeleri
olasi_alis_seviyesi := getOlasiAlisSeviyesi(alis_maliyeti)
olasi_satis_seviyesi := getOlasiSatisSeviyesi(satis_maliyeti)
// Sinyal koşulları
alis_kosul_1 := alis_crossover
satis_kosul_1 := satis_crossunder
// Sinyal filtreleme
alis_filtre := rsi_alis_kosul and yuksek_hacim
satis_filtre := rsi_satis_kosul and yuksek_hacim
// Ek sinyal kontrolü
alis_ek_kosul := i_sinyal_ters_yon ? last_signal_type <= 0 or not pozisyonda : true
satis_ek_kosul := i_sinyal_ters_yon ? last_signal_type >= 0 or not pozisyonda : true
alis_pozisyon_kosul := i_sinyal_pozisyon_kontrol ? not pozisyonda or not son_islem_alis : true
satis_pozisyon_kosul := i_sinyal_pozisyon_kontrol ? not pozisyonda or son_islem_alis : true
// Pozisyon-bazlı sinyal kısıtlaması (Bu kısıtlama her zaman aktif olacak)
pozisyon_kisitlama_alis := not (pozisyonda and son_islem_alis) // Zaten alis pozisyonundaysak yeni alis sinyali verme
pozisyon_kisitlama_satis := not (pozisyonda and not son_islem_alis) // Zaten satis pozisyonundaysak yeni satis sinyali verme
// Final sinyaller
alis_sinyal := alis_kosul_1 and alis_filtre and alis_ek_kosul and alis_pozisyon_kosul and pozisyon_kisitlama_alis
satis_sinyal := satis_kosul_1 and satis_filtre and satis_ek_kosul and satis_pozisyon_kosul and pozisyon_kisitlama_satis
// Olası sinyaller
olasi_alis := getOlasiAlisSinyali(close, close , alis_maliyeti) and not alis_yapildi and rsi_alis_kosul and not (pozisyonda and son_islem_alis)
olasi_satis := getOlasiSatisSinyali(close, close , satis_maliyeti) and not satis_yapildi and rsi_satis_kosul and not (pozisyonda and not son_islem_alis)
// Sinyal yönetimi
if alis_sinyal
total_signals := total_signals + 1
last_signal_type := 1
last_signal_price := close
last_signal_time := str.format("{0}", timeframe.period)
last_signal_success := false
pozisyonda := true
son_islem_alis := true
giris_fiyati := close
max_kar := 0.0
max_zarar := 0.0
trailing_stop_seviyesi := close * (1 - i_trailing_yuzde/100)
alis_yapildi := true
satis_yapildi := false
status_text := "Alış Sinyali - " + str.tostring(math.round(close, 2))
status_color := i_alis_renk
if satis_sinyal
total_signals := total_signals + 1
last_signal_type := -1
last_signal_price := close
last_signal_time := str.format("{0}", timeframe.period)
last_signal_success := false
pozisyonda := true
son_islem_alis := false
giris_fiyati := close
max_kar := 0.0
max_zarar := 0.0
trailing_stop_seviyesi := close * (1 + i_trailing_yuzde/100)
satis_yapildi := true
alis_yapildi := false
status_text := "Satış Sinyali - " + str.tostring(math.round(close, 2))
status_color := i_satis_renk
// Trailing Stop güncelleme
if i_trailing_stop and pozisyonda
if son_islem_alis
trail_level := close * (1 - i_trailing_yuzde/100)
trailing_stop_seviyesi := math.max(trailing_stop_seviyesi, trail_level)
else
trail_level := close * (1 + i_trailing_yuzde/100)
trailing_stop_seviyesi := math.min(trailing_stop_seviyesi, trail_level)
// TP/SL için crossover/crossunder hesaplamaları
// Calculate crossover/crossunder variables once per bar
alis_tp_crossover_check := ta.crossover(close, alis_tp)
alis_sl_crossunder_check := ta.crossunder(close, alis_sl)
satis_tp_crossunder_check := ta.crossunder(close, satis_tp)
satis_sl_crossover_check := ta.crossover(close, satis_sl)
trailing_stop_crossunder_check := i_trailing_stop and ta.crossunder(close, trailing_stop_seviyesi)
// Update global crossover/crossunder variables
alis_tp_crossover := alis_tp_crossover_check
satis_tp_crossunder := satis_tp_crossunder_check
alis_sl_crossunder := alis_sl_crossunder_check
satis_sl_crossover := satis_sl_crossover_check
trailing_stop_crossunder := trailing_stop_crossunder_check
// Pozisyon takibi
if pozisyonda
if son_islem_alis
curr_kar := (close - giris_fiyati) / giris_fiyati * 100
max_kar := math.max(max_kar, curr_kar)
max_zarar := math.min(max_zarar, curr_kar)
// TP veya SL - Use the check variables
if (alis_tp_crossover_check or (i_trailing_stop ? trailing_stop_crossunder_check : alis_sl_crossunder_check))
pozisyonda := false
alis_yapildi := false
last_signal_type := 0 // Pozisyondan çıkışta signal type'ı sıfırla
if close >= alis_tp
win_count := win_count + 1
last_signal_success := true
profit_pct := profit_pct + i_tp_yuzde
status_text := "Alış TP - Kar: " + str.tostring(math.round(i_tp_yuzde, 2)) + "%"
status_color := i_tp_renk
else
loss_count := loss_count + 1
last_signal_success := false
loss_pct := loss_pct + i_sl_yuzde
status_text := "Alış SL - Zarar: " + str.tostring(math.round(i_sl_yuzde, 2)) + "%"
status_color := i_sl_renk
else
curr_kar := (giris_fiyati - close) / giris_fiyati * 100
max_kar := math.max(max_kar, curr_kar)
max_zarar := math.min(max_zarar, curr_kar)
// TP veya SL
if (satis_tp_crossunder_check or (i_trailing_stop ? trailing_stop_crossunder_check : satis_sl_crossover_check))
pozisyonda := false
satis_yapildi := false
last_signal_type := 0 // Pozisyondan çıkışta signal type'ı sıfırla
if close <= satis_tp
win_count := win_count + 1
last_signal_success := true
profit_pct := profit_pct + i_tp_yuzde
status_text := "Satış TP - Kar: " + str.tostring(math.round(i_tp_yuzde, 2)) + "%"
status_color := i_tp_renk
else
loss_count := loss_count + 1
last_signal_success := false
loss_pct := loss_pct + i_sl_yuzde
status_text := "Satış SL - Zarar: " + str.tostring(math.round(i_sl_yuzde, 2)) + "%"
status_color := i_sl_renk
// =================== GÖRSEL ELEMANLARI ===================
// Maliyet çizgileri
plot(alis_maliyeti, "Alış Maliyeti", color=color.new(i_alis_renk, 0), linewidth=i_cizgi_kalinlik, style=plot.style_linebr)
plot(satis_maliyeti, "Satış Maliyeti", color=color.new(i_satis_renk, 0), linewidth=i_cizgi_kalinlik, style=plot.style_linebr)
// Alt ve üst maliyet seviyeleri
plot(alis_maliyeti_alt, "Alış Alt Seviye", color=color.new(i_alis_renk, 70), linewidth=1, style=plot.style_linebr)
plot(alis_maliyeti_ust, "Alış Üst Seviye", color=color.new(i_alis_renk, 70), linewidth=1, style=plot.style_linebr)
plot(satis_maliyeti_alt, "Satış Alt Seviye", color=color.new(i_satis_renk, 70), linewidth=1, style=plot.style_linebr)
plot(satis_maliyeti_ust, "Satış Üst Seviye", color=color.new(i_satis_renk, 70), linewidth=1, style=plot.style_linebr)
// Stop loss ve take profit çizgileri
plot(alis_sl, "Alış Stop Loss", color=color.new(i_sl_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
plot(alis_tp, "Alış Take Profit", color=color.new(i_tp_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
plot(satis_sl, "Satış Stop Loss", color=color.new(i_sl_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
plot(satis_tp, "Satış Take Profit", color=color.new(i_tp_renk, 0), linewidth=i_sl_tp_kalinlik, style=plot.style_circles)
// Trailing Stop çizgisi
plot(i_trailing_stop and pozisyonda ? trailing_stop_seviyesi : na, "Trailing Stop", color=color.new(i_sl_renk, 30), linewidth=1, style=plot.style_stepline)
// Ana sinyal okları
plotshape(alis_sinyal, "Alış Sinyali", style=shape.triangleup, location=location.belowbar, color=i_ok_renk_alis, size=size.normal)
plotshape(satis_sinyal, "Satış Sinyali", style=shape.triangledown, location=location.abovebar, color=i_ok_renk_satis, size=size.normal)
// Olası sinyal okları ve seviyeleri
plotshape(olasi_alis, "Olası Alış", style=shape.circle, location=location.belowbar, color=i_olasi_alis_renk, size=size.tiny)
plotshape(olasi_satis, "Olası Satış", style=shape.circle, location=location.abovebar, color=i_olasi_satis_renk, size=size.tiny)
// Sıra dışı hareket okları
plotshape(siradisi_alis, "Sıra Dışı Yükseliş", style=shape.diamond, location=location.belowbar, color=color.new(i_alis_renk, 0), size=size.large)
plotshape(siradisi_satis, "Sıra Dışı Düşüş", style=shape.diamond, location=location.abovebar, color=color.new(i_satis_renk, 0), size=size.large)
// =================== VOLUME PROFILE VISIBLE RANGE ===================
// VPVR Hesaplama ve Çizim
if barstate.islast
// Sadece son barda VPVR hesaplamaları yap
if i_vpvr_aktif
// VPVR aktif ise
// Değişkenleri tanımla
float aralik_ust = ta.highest(high, i_bar_sayisi)
float aralik_alt = ta.lowest(low, i_bar_sayisi)
float aralik_yukseklik = aralik_ust - aralik_alt
float poc_fiyat_temp = na
float histogram_yukseklik = aralik_yukseklik / i_histogram_sayisi
// Histogram dizilerini yeniden ayarla
array.clear(vpvr_histogram_alt_liste)
array.clear(vpvr_histogram_ust_liste)
array.clear(vpvr_histogram_fiyat_liste)
array.clear(vpvr_histogram_alim_hacmi_liste)
array.clear(vpvr_histogram_satim_hacmi_liste)
array.clear(vpvr_histogram_hacim_yuzde_liste)
// Histogram dizilerini doldur
for i = 0 to i_histogram_sayisi - 1
float histogram_alt = aralik_alt + histogram_yukseklik * i
float histogram_ust = aralik_alt + histogram_yukseklik * (i + 1)
array.push(vpvr_histogram_alt_liste, histogram_alt)
array.push(vpvr_histogram_ust_liste, histogram_ust)
array.push(vpvr_histogram_fiyat_liste, (histogram_alt + histogram_ust) / 2)
array.push(vpvr_histogram_alim_hacmi_liste, 0.0)
array.push(vpvr_histogram_satim_hacmi_liste, 0.0)
array.push(vpvr_histogram_hacim_yuzde_liste, 0.0)
// Bar'ların hacimlerini histogramlara ata
for i = 0 to i_bar_sayisi - 1
float mevcut_bar_yukseklik = high - low
if mevcut_bar_yukseklik > 0
float mevcut_alim_hacmi = volume * (close - low ) / mevcut_bar_yukseklik
float mevcut_satim_hacmi = volume * (high - close ) / mevcut_bar_yukseklik
// Mevcut hacim yüzdesini histogramlara dağıt
for j = 0 to i_histogram_sayisi - 1
if j < array.size(vpvr_histogram_alt_liste) and j < array.size(vpvr_histogram_ust_liste)
float h_alt = array.get(vpvr_histogram_alt_liste, j)
float h_ust = array.get(vpvr_histogram_ust_liste, j)
// Bar ve histogram arasındaki kesişim hesapla
float hedef = math.max(h_ust, high ) - math.min(h_alt, low )
- math.max(0, math.max(h_ust, high ) - math.min(h_ust, high ))
- math.max(0, math.max(h_alt, low ) - math.min(h_alt, low ))
float hacim_yuzde = hedef / mevcut_bar_yukseklik
if hacim_yuzde > 0
float h_alim = array.get(vpvr_histogram_alim_hacmi_liste, j)
float h_satim = array.get(vpvr_histogram_satim_hacmi_liste, j)
array.set(vpvr_histogram_alim_hacmi_liste, j, h_alim + mevcut_alim_hacmi * hacim_yuzde)
array.set(vpvr_histogram_satim_hacmi_liste, j, h_satim + mevcut_satim_hacmi * hacim_yuzde)
// En yüksek hacimli histogramı bul (POC - Point of Control)
float en_yuksek_hacim = 0.0
for i = 0 to i_histogram_sayisi - 1
if i < array.size(vpvr_histogram_alim_hacmi_liste) and i < array.size(vpvr_histogram_satim_hacmi_liste)
float h_alim = array.get(vpvr_histogram_alim_hacmi_liste, i)
float h_satim = array.get(vpvr_histogram_satim_hacmi_liste, i)
float h_toplam = h_alim + h_satim
if h_toplam > en_yuksek_hacim
en_yuksek_hacim := h_toplam
poc_fiyat_temp := array.get(vpvr_histogram_fiyat_liste, i)
// POC değerlerini güncelle
vpvr_poc_fiyat := poc_fiyat_temp
vpvr_poc_hacim := en_yuksek_hacim
if not na(vpvr_poc_fiyat)
vpvr_poc_yuzde := (close - vpvr_poc_fiyat) / vpvr_poc_fiyat * 100
// Kapanış fiyatı POC'un üzerinde mi kontrol et
vpvr_ustunde := close > vpvr_poc_fiyat
// POC metni ve rengini ayarla
if vpvr_poc_yuzde > 0
vpvr_poc_renk := color.green
vpvr_poc_metin := str.tostring(vpvr_poc_fiyat, "#.00") + " ↑"
else
vpvr_poc_renk := color.red
vpvr_poc_metin := str.tostring(vpvr_poc_fiyat, "#.00") + " ↓"
// Önceki kutuları ve çizgileri temizle
if array.size(vpvr_alim_kutulari) > 0
for i = 0 to array.size(vpvr_alim_kutulari) - 1
box.delete(array.get(vpvr_alim_kutulari, i))
if array.size(vpvr_satim_kutulari) > 0
for i = 0 to array.size(vpvr_satim_kutulari) - 1
box.delete(array.get(vpvr_satim_kutulari, i))
if array.size(vpvr_cizgiler) > 0
for i = 0 to array.size(vpvr_cizgiler) - 1
line.delete(array.get(vpvr_cizgiler, i))
array.clear(vpvr_alim_kutulari)
array.clear(vpvr_satim_kutulari)
array.clear(vpvr_cizgiler)
// Aralık üst ve alt sınırlarını çiz
int zaman_birimi = int(time - time )
line ust_cizgi = line.new(time , aralik_ust, time + i_son_mumdan_mesafe * zaman_birimi, aralik_ust,
xloc=xloc.bar_time, color=i_line_renk, width=2)
line alt_cizgi = line.new(time , aralik_alt, time + i_son_mumdan_mesafe * zaman_birimi, aralik_alt,
xloc=xloc.bar_time, color=i_line_renk, width=2)
// Çizgileri diziye ekle
array.push(vpvr_cizgiler, ust_cizgi)
array.push(vpvr_cizgiler, alt_cizgi)
// Histogramları çiz
// Önce maksimum hacmi bul
float max_hacim = en_yuksek_hacim
if max_hacim > 0
for i = 0 to i_histogram_sayisi - 1
if i < array.size(vpvr_histogram_alt_liste) and i < array.size(vpvr_histogram_ust_liste) and i < array.size(vpvr_histogram_alim_hacmi_liste) and i < array.size(vpvr_histogram_satim_hacmi_liste)
float h_alt = array.get(vpvr_histogram_alt_liste, i)
float h_ust = array.get(vpvr_histogram_ust_liste, i)
float h_alim = array.get(vpvr_histogram_alim_hacmi_liste, i)
float h_satim = array.get(vpvr_histogram_satim_hacmi_liste, i)
float h_toplam = h_alim + h_satim
if h_toplam > 0
float genislik = i_poc_genislik * h_toplam / max_hacim
float alim_genislik = math.floor(genislik * h_alim / h_toplam)
float satim_genislik = math.floor(genislik * h_satim / h_toplam)
// Alım ve satım histogramlarını çiz
if alim_genislik > 0
box alim_kutu = box.new( left=int(bar_index + i_son_mumdan_mesafe), top=h_ust, right=int(bar_index + i_son_mumdan_mesafe + alim_genislik), bottom=h_alt, bgcolor=i_alis_bar_renk, border_color=color.new(color.black, 80))
array.push(vpvr_alim_kutulari, alim_kutu)
if satim_genislik > 0
box satim_kutu = box.new( left=int(bar_index + i_son_mumdan_mesafe + alim_genislik), top=h_ust, right=int(bar_index + i_son_mumdan_mesafe + alim_genislik + satim_genislik), bottom=h_alt, bgcolor=i_satis_bar_renk, border_color=color.new(color.black, 80))
array.push(vpvr_satim_kutulari, satim_kutu)
else
// VPVR aktif değilse tüm görsel nesneleri temizle
// Kutuları temizle
if array.size(vpvr_alim_kutulari) > 0
for i = 0 to array.size(vpvr_alim_kutulari) - 1
box.delete(array.get(vpvr_alim_kutulari, i))
if array.size(vpvr_satim_kutulari) > 0
for i = 0 to array.size(vpvr_satim_kutulari) - 1
box.delete(array.get(vpvr_satim_kutulari, i))
// Çizgileri temizle
if array.size(vpvr_cizgiler) > 0
for i = 0 to array.size(vpvr_cizgiler) - 1
line.delete(array.get(vpvr_cizgiler, i))
// Dizileri temizle
array.clear(vpvr_alim_kutulari)
array.clear(vpvr_satim_kutulari)
array.clear(vpvr_cizgiler)
// VPVR POC (Point of Control) Bilgisi
if barstate.islast
if i_vpvr_aktif
// VPVR aktifse POC bilgilerini göster
table.cell(table_obj, 0, 19, "VPVR POC:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 19, vpvr_poc_metin, text_color=vpvr_poc_renk, text_size=size.small, bgcolor=i_panel_renk)
if not na(vpvr_poc_yuzde)
table.cell(table_obj, 0, 20, "POC'ye Mesafe (%):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 20, str.tostring(vpvr_poc_yuzde, "#.##") + "%",
text_color=vpvr_poc_yuzde >= 0 ? color.green : color.red,
text_size=size.small,
bgcolor=i_panel_renk)
// POC'un üstünde mi altında mı bilgisi
table.cell(table_obj, 0, 21, "POC Durumu:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 21, vpvr_ustunde ? "POC Üzerinde ↑" : "POC Altında ↓",
text_color=vpvr_ustunde ? color.green : color.red,
text_size=size.small,
bgcolor=i_panel_renk)
else
table.cell(table_obj, 0, 20, "POC'ye Mesafe (%):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 20, "HESAPLANIYOR", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 21, "POC Durumu:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 21, "HESAPLANIYOR", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
else
// VPVR aktif değilse boş hücreler göster
table.cell(table_obj, 0, 19, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 19, "", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 20, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 20, "", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 21, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 21, "", text_color=i_panel_yazi_renk, text_size=size.small, bgcolor=i_panel_renk)
// =================== PANEL ===================
// Panel pozisyonunu ayarla
var panel_pos = i_panel_konum == "Sag Üst" ? position.top_right :
i_panel_konum == "Sol Üst" ? position.top_left :
i_panel_konum == "Sag Alt" ? position.bottom_right : position.bottom_left
// Renk ayarları
var panel_bg_renk = i_panel_renk
var panel_text_renk = color.white
var alim_renk = i_alis_renk
var satim_renk = i_satis_renk
// Tablo oluştur
table_obj := table.new(panel_pos, 2, 22, i_panel_renk, frame_width=2, frame_color=panel_text_renk, border_color=panel_text_renk, border_width=1)
// Maliyet referansları için formatlama fonksiyonu
f_renk_format(deger, ref_alt, ref_ust) =>
deger < ref_alt ? satim_renk : deger > ref_ust ? alim_renk : panel_text_renk
// Tablo başlığı
f_tablo_guncelle(table_obj) =>
table.cell(table_obj, 0, 0, "Spekulator Maliyet Analizi Pro V4", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 0, "v4.1", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
// Piyasa bilgileri
table.cell(table_obj, 0, 1, "PİYASA BİLGİLERİ", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 1, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 2, "Trend:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
trend_durum = uptrend ? 1 : -1
trend_renk = trend_durum == 1 ? alim_renk : satim_renk
trend_metin = trend_durum == 1 ? "YUKARI (Alış)" : "AŞAĞI (Satış)"
table.cell(table_obj, 1, 2, trend_metin, text_color=trend_renk, text_size=size.small, bgcolor=i_panel_renk)
// Maliyet bilgileri
table.cell(table_obj, 0, 3, "MALİYET HESABI", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 3, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 4, "Kritik Fib. 61.8%:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 4, str.tostring(alis_maliyeti, "#.00"), text_color=f_renk_format(close, alis_maliyeti * 0.99, alis_maliyeti * 1.01), text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 5, "Kritik Fib. 78.6%:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 5, str.tostring(satis_maliyeti, "#.00"), text_color=f_renk_format(close, satis_maliyeti * 0.99, satis_maliyeti * 1.01), text_size=size.small, bgcolor=i_panel_renk)
// Diğer maliyet bilgileri...
table.cell(table_obj, 0, 6, "TE Maliyet (ORT):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 6, str.tostring(alis_maliyeti, "#.00"), text_color=f_renk_format(close, alis_maliyeti * 0.99, alis_maliyeti * 1.01), text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 7, "TE Min. Maliyet:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 7, str.tostring(alis_maliyeti_alt, "#.00"), text_color=f_renk_format(close, alis_maliyeti_alt * 0.99, alis_maliyeti_alt * 1.01), text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 8, "TE Maks. Maliyet:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 8, str.tostring(alis_maliyeti_ust, "#.00"), text_color=f_renk_format(close, alis_maliyeti_ust * 0.99, alis_maliyeti_ust * 1.01), text_size=size.small, bgcolor=i_panel_renk)
// Pozisyon durumu
table.cell(table_obj, 0, 9, "POZİSYON DURUMU", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 9, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
var int son_trend_yonu = 0
var int son_trend_uzunlugu = 0
if close > open
if son_trend_yonu == 1
son_trend_uzunlugu := son_trend_uzunlugu + 1
else
son_trend_yonu := 1
son_trend_uzunlugu := 1
else if close < open
if son_trend_yonu == -1
son_trend_uzunlugu := son_trend_uzunlugu + 1
else
son_trend_yonu := -1
son_trend_uzunlugu := 1
pos_durum_renk = pozisyonda ? (son_islem_alis ? alim_renk : satim_renk) : panel_text_renk
pos_durum_metin = pozisyonda ? (son_islem_alis ? "UZUN (Alış)" : "KISA (Satış)") : "POZİSYON YOK"
table.cell(table_obj, 0, 10, "Mevcut Pozisyon:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 10, pos_durum_metin, text_color=pos_durum_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 11, "Sinyal Tipi:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
sinyal_renk = last_signal_type == 1 ? alim_renk : last_signal_type == -1 ? satim_renk : panel_text_renk
sinyal_metin = last_signal_type == 1 ? "ALIS" : last_signal_type == -1 ? "SATIŞ" : "YOK"
table.cell(table_obj, 1, 11, sinyal_metin, text_color=sinyal_renk, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 0, 12, "Olası Sinyal:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
olasi_sinyal_renk = olasi_alis ? alim_renk : olasi_satis ? satim_renk : panel_text_renk
olasi_sinyal_metin = olasi_alis ? "OLASI ALIS" : olasi_satis ? "OLASI SATIŞ" : "YOK"
table.cell(table_obj, 1, 12, olasi_sinyal_metin, text_color=olasi_sinyal_renk, text_size=size.small, bgcolor=i_panel_renk)
// Hacim ve volatilite
table.cell(table_obj, 0, 13, "DESTEKLEYEN FAKTÖRLER", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 13, "", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
// RSI
rsi_renk = rsi < 30 ? alim_renk : rsi > 70 ? satim_renk : panel_text_renk
table.cell(table_obj, 0, 14, "RSI Değeri:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 14, str.tostring(rsi, "#.00"), text_color=rsi_renk, text_size=size.small, bgcolor=i_panel_renk)
// Hacim Durumu
float yerel_hacim_orani = volume / vol_sma
hacim_renk = yerel_hacim_orani > 1.1 ? alim_renk : yerel_hacim_orani < 0.9 ? satim_renk : panel_text_renk
table.cell(table_obj, 0, 15, "Hacim Oranı:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 15, str.tostring(yerel_hacim_orani, "#.00x"), text_color=hacim_renk, text_size=size.small, bgcolor=i_panel_renk)
// Mevcut Aralık
fiyat_araligi = (high - low) / low * 100
aralik_renk = fiyat_araligi > 1.5 ? alim_renk : panel_text_renk
table.cell(table_obj, 0, 16, "Fiyat Aralığı (%):", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 16, str.tostring(fiyat_araligi, "#.00") + "%", text_color=aralik_renk, text_size=size.small, bgcolor=i_panel_renk)
// Ardışık Mum Sayısı
mum_renk = son_trend_yonu == 1 ? alim_renk : son_trend_yonu == -1 ? satim_renk : panel_text_renk
mum_metin = son_trend_yonu == 1 ? "+" + str.tostring(son_trend_uzunlugu) + " YEŞİL" : son_trend_yonu == -1 ? "-" + str.tostring(son_trend_uzunlugu) + " KIRMIZI" : "NÖTR"
table.cell(table_obj, 0, 17, "Ardışık Mumlar:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 17, mum_metin, text_color=mum_renk, text_size=size.small, bgcolor=i_panel_renk)
// Anormal Hareket Uyarısı
var int siradisi_durumlar = 0
siradisi_durumlar := siradisi_alis or siradisi_satis ? siradisi_durumlar + 1 : siradisi_durumlar
siradisi_renk = siradisi_durumlar > 0 ? color.yellow : panel_text_renk
siradisi_metin = siradisi_durumlar > 0 ? "Sıra Dışı İşaret" : "NORMAL"
table.cell(table_obj, 0, 18, "Sıra Dışı Durum:", text_color=color.white, text_size=size.small, bgcolor=i_panel_renk)
table.cell(table_obj, 1, 18, siradisi_metin, text_color=siradisi_renk, text_size=size.small, bgcolor=i_panel_renk)
// Panel'i güncelle
if barstate.islast
f_tablo_guncelle(table_obj)
// =================== ALERTLER ===================
alertcondition(alis_sinyal, "Alış Sinyali", "Fiyat alış maliyetini yukarı kırdı")
alertcondition(satis_sinyal, "Satış Sinyali", "Fiyat satış maliyetini aşağı kırdı")
alertcondition(alis_tp_crossover, "Alış TP", "Alış pozisyonu kar hedefine ulaştı")
alertcondition(satis_tp_crossunder, "Satış TP", "Satış pozisyonu kar hedefine ulaştı")
alertcondition(alis_sl_crossunder, "Alış SL", "Alış pozisyonu stop loss seviyesinde")
alertcondition(satis_sl_crossover, "Satış SL", "Satış pozisyonu stop loss seviyesinde")
alertcondition(trailing_stop_crossunder, "Trailing Stop", "Trailing stop seviyesine ulaşıldı")
alertcondition(olasi_alis, "Olası Alış", "Olası alış fırsatı")
alertcondition(olasi_satis, "Olası Satış", "Olası satış fırsatı")
// Sıra dışı hareket alertleri
alertcondition(siradisi_alis, "Sıra Dışı Yükseliş", "Anormal derecede hızlı bir yükseliş tespit edildi!")
alertcondition(siradisi_satis, "Sıra Dışı Düşüş", "Anormal derecede hızlı bir düşüş tespit edildi!")
Fiyat ve Mavi Çizgi Kesişimi ve RSI, Fibonacci, MACDüçü bir arada ve tüm zaman larda uygun macd rsi ve fibonaci kullarak grafik üzerinde değerleri yazıyor
Anchored VWAP with Std Dev Bands### Anchored VWAP with 8 Standard Deviations Indicator
This powerful and flexible Pine Script indicator allows you to precisely analyze market dynamics using an Anchored VWAP combined with up to eight customizable standard deviation bands. By anchoring the VWAP to a specific bar of your choosing, you can gain a clear reference point tailored exactly to your trading strategy, enabling detailed price action analysis around critical market events.
#### Key Features:
- **Interactive Anchor Selection:** When adding the indicator to your chart, TradingView prompts you to select the exact bar from which to anchor the VWAP calculation, allowing pinpoint accuracy and flexibility.
- **Customizable Standard Deviations:** Define up to 8 individual standard deviation levels via intuitive inputs, ensuring the indicator adapts seamlessly to your analytical needs.
- **Source Flexibility:** Easily adjust the data source used for VWAP calculation—whether closing price, high, low, or any other price input available—giving you full control over the indicator's calculation.
- **Clear Visual Representation:** The anchored VWAP is prominently plotted in blue, while upper standard deviations are displayed in progressively stronger shades of green, and lower deviations in shades of red, making trend analysis clear and intuitive.
### Usage Recommendations:
Ideal for traders employing mean reversion strategies, trend-following systems, or looking for clear support and resistance levels based on institutional benchmarks. Perfectly suited for intraday traders, swing traders, and long-term investors seeking precise volume-weighted insights.
Enhance your analysis and trading precision today with the Anchored VWAP with 8 Standard Deviations Indicator.
Morphine Moving AveragesMorphine Moving Averages (MMA) is a comprehensive technical analysis tool designed to give traders a clear, visual representation of key market trends. Combining several essential indicators into one, MMA includes:
Bollinger Bands (20 SMA, 2 standard deviation): Provides a dynamic range to identify volatility and potential reversals.
VWAP (Volume Weighted Average Price): Offers an average price weighted by volume, helping you assess market trends and potential entry points.
8 SMA: A simple moving average that helps identify short-term trends.
20 EMA: A faster-moving average that responds to recent price changes, ideal for spotting shorter-term momentum.
50 EMA: Represents a medium-term trend, smoothing out price action for better market clarity.
200 EMA: A long-term moving average, widely followed to understand the broader trend and potential support/resistance zones.
Each line is color-coded for quick identification, making it an ideal tool for both short-term and long-term traders who want a comprehensive view of the market's key levels. Use the Morphine Moving Averages indicator to spot trends, reversals, and key support/resistance levels all in one glance!
Make sure you have it pinned to price scale right.
If you have any questions or bugs, feel free to reach out to me on X. x.com
Collatz Dual Number CalculatorCollatz Dual Number Calculator. Counting the number of candles associated with the chart using the Collatz conjecture, which is calculated as two input numbers. The output is displayed on the left side of the image.