Previous Key Levels (fadi)Previous Key Levels indicator is a highly configurable OHLC levels tool designed to provide traders with the ability to plot multiple levels while minimizing screen clutter. This indicator is perfect for those who want to monitor various timeframes simultaneously without overloading their charts with unnecessary information.
How to Use It
This indicator offers traders the flexibility to track up to 6 higher timeframes (HTFs) and multiple candles for each timeframe. For example, a trader can choose to monitor the OHLC of the last four 4-hour candles, providing a comprehensive view of significant price levels over different periods.
Key Features
Highly Configurable: Customize the number of timeframes and candles to suit your trading strategy.
Minimal Screen Clutter: Efficiently plot multiple levels without overwhelming your chart.
Flexible Application: Ideal for identifying support and resistance levels, liquidity sweeps, target levels, and more, adapting to various trading styles.
Traders have diverse trading styles and preferences. Some may use these levels to identify support and resistance zones, while others might look for liquidity sweeps or set target levels. By offering a high degree of customization, the Previous Key Levels indicator caters to the unique needs of individual traders, helping them make informed decisions based on historical price action across multiple timeframes.
Timeframe Settings
Toggle to track 6 HTF settings and the number of candles to track for each.
Limit to next HTFs only can be used to limit the HTF levels displayed based on the current timeframe.
Hide Above will disable the indicator above the specified interval.
Offset to Left and Right are used to specify where the level line starts and ends based on the current candle.
Offset between HTFs extends HTF levels to become more readable.
HTF Settings
Choice of the OHLC levels to track.
Specify the color, line style, and line width for each level.
Mark the start of that level, for example, draw a vertical line where the 4H candle has started.
Trace back to draw optional lines to track back to the origin of the level.
Label Settings
Highly configurable labels that allow traders to customize the labels to their liking.
Label color, background, and size.
Customize using up to 9 configurable parts.
Fading Levels
To prevent clutter, the indicator offers the option to change the transparency of the levels based on their distance from the current price. The distance is calculated based on a configurable Average True Range (ATR).
Change Transparency to a percentage of its current color.
Range should be within X candles will fade any level that is X candles length away from the current price.
ATR length used in calculation will calculate the average size of candles in the calculation.
Candlestick analysis
Inside Bar Multi-Currency ScannerInside Bar Scanner
This indicator for TradingView scans up to 10 customizable assets across multiple, user-defined timeframes to detect Inside Bar patterns. It features two key columns: Ready and Cooking. The Ready column highlights when the previous candle has formed an Inside Bar, signaling traders to watch for potential entry triggers. The Cooking column actively monitors the current candle in progress to identify ongoing Inside Bar formations. The indicator allows full customization of asset lists and independent timeframe selection, making it a powerful tool for multi-timeframe analysis and enhancing trading precision.
BRT Cluster VolumeTitle and Purpose
BRT Cluster Volume is a powerful market analysis tool designed to identify key support and resistance levels, cluster volumes, and breakout signals. This script is highly beneficial for traders who aim to gain deeper insights into market trends and pinpoint zones of interest for buyers and sellers.
Key Features
1. Support and Resistance Levels:
- The script automatically detects chart extremums by analyzing a specified number of bars on the left and right to form levels. This approach effectively identifies local highs and lows.
- The uniqueness of this implementation lies in its dynamic data processing. For each extremum, the "channel width" is calculated, allowing insignificant levels to be filtered out based on a user-defined minimum width. This method eliminates noise and ensures focus on critical levels.
- Extremum lines can be extended to the right (when enabled), allowing traders to track current price movements relative to historical levels.
2. Cluster Volume:
- The cluster analysis is based on lower timeframe data, providing precise identification of key zones of market participant activity. The script dynamically requests close prices and volumes from lower timeframes, calculates the average volume, and identifies levels where volumes exceed a defined threshold.
- The visualization of cluster volumes is unique: volumes exceeding the threshold are displayed as candles with customizable colors and markers. These indicators help traders identify zones of significant interest.
- Cluster volume is only displayed when it interacts with support or resistance levels, ensuring that the visualization remains precise and relevant for market analysis.
3. Breakout Signals:
- The script evaluates "breakout strength" for each breakout of support or resistance levels by comparing the current price with the level. This helps filter false breakouts and focus on significant price movements.
- Traders can select the source for breakout signals (close price or high/low), offering flexibility for various trading styles and strategies.
- By incorporating the concept of "maximum breakout strength," the script highlights only meaningful breakouts, ignoring minor fluctuations.
4. Integration of Trading Sessions:
- Extremum levels for major trading sessions (Asia, Europe, USA) are identified and labeled on the chart. This allows traders to see when significant price levels were formed during the day.
- The script uses timestamps to automatically detect session times, ensuring accuracy and minimizing manual adjustments.
5. Dynamic Data Updates:
- The script dynamically updates support and resistance levels in real time as new data becomes available. This feature is crucial for traders working in fast-moving markets.
- Outdated information (such as obsolete levels) is automatically removed to keep the chart clean and focused on relevant data.
6. Visualization of Activity Zones:
- Trend direction is visualized using color-coded candles based on cluster volumes. For instance, candles with volumes exceeding the average are highlighted with specific colors, helping traders quickly identify areas of heightened activity.
- The unique aspect of this visualization is that cluster volumes appear only in zones where they interact with breakout levels, providing an intuitive and streamlined presentation of critical data.
Usage
- Support and Resistance: Adjust the "Left Bars" and "Right Bars" settings to determine extremums. Use the "Channel Min Width" setting to filter out insignificant levels.
- Cluster Volume: Customize the analysis period and volume threshold to identify high-activity zones. Enable breakout clusters to see how volumes interact with breakouts.
- Session Extremums: Highlight significant levels for Asia, Europe, and US trading sessions to gain insights into market dynamics across different time zones.
- Breakout Signals: Configure the breakout strength and source (close or high/low) for precise signal detection.
Parameter Details
1. Support & Resistance:
- `Left Bars` / `Right Bars`: Number of bars to consider for determining extremums.
- `# of Lines`: Maximum number of support/resistance lines to display.
- `Channel Min Width`: Minimum channel width to filter insignificant levels.
2. Breakout:
- `Show Breakouts`: Toggle breakout signal display.
- `Max breakout strength`: Maximum strength for valid breakouts.
- `Breakout source`: Data source for breakouts (close or high/low).
3. Cluster Volume:
- `Lookback`: Number of bars to analyze for cluster volumes.
- `Threshold`: Volume threshold (percentage above the average).
- `Cluster Volume Timeframe`: Timeframe for cluster volume analysis.
- `Breakout Cluster`: Display cluster volumes only for breakout-related zones.
4. Visual Settings:
- `Extend extremum lines to the right`: Extend support/resistance lines to the right.
- `Show ASIA/EU/US Session Extremums`: Display extremums for trading sessions.
Features and Benefits
- The script provides flexible parameter customization, allowing it to adapt to different trading styles and timeframes.
- The visualization is designed to be clean and intuitive, ensuring users can easily interpret the data.
- Suitable for all timeframes, making it ideal for both intraday and long-term market analysis.
Limitations
- The script is not suitable for analysis on non-standard chart types (e.g., Heikin Ashi, Renko, Kagi).
- To ensure accurate performance, realistic data for commission and slippage should be used.
Warnings
- The script relies on historical data for calculations, which may cause discrepancies in real-time conditions.
- Users should fully understand the functionality of cluster analysis and breakout signals before using the script in live trading.
This script combines advanced data processing logic, dynamic level adjustments, and unique visualization approaches, making it an indispensable tool for market analysis and trading decision-making.
HotFx Buy Sell Scalper The HotFx Scalper is a dynamic trading tool designed to help identify potential buy and sell opportunities using a combination of EMAs, Stochastic RSI, and price action. It combines a fast and slow EMA to capture trends and consolidation phases, with an additional 200 EMA to filter for the broader market trend. The indicator provides buy and sell signals with visual cues and alerts, along with customizable background alerts to keep you informed of key crossovers.
Please note: No indicator is 100% accurate, so use this tool at your own risk and always conduct your own analysis before making trades.
VinSpace Optimized Indicator with Enhanced SignalsVinSpace Optimized Indicator with Enhanced Signals
The VinSpace Optimized Indicator with Enhanced Signals is an advanced trading tool designed to offer powerful insights by combining multiple key technical analysis indicators. This enhanced version incorporates the Adaptive Channel , RSI (Relative Strength Index) , and MACD (Moving Average Convergence Divergence) with visually distinct Buy/Sell signals and background highlights to help traders identify trend reversals and optimize their trading strategies.
Key Features:
Adaptive Channel: Dynamically adjusts itself based on the price movement, identifying potential support and resistance levels. It plots the upper channel , lower channel , and the middle channel for a comprehensive view of market trends.
RSI (Relative Strength Index): The RSI is used to measure the strength of a price move. The indicator comes with adjustable overbought and oversold levels, allowing traders to spot overbought or oversold conditions that may indicate a reversal.
MACD (Moving Average Convergence Divergence): The MACD is employed to identify potential buy or sell signals by comparing the difference between fast and slow moving averages. The MACD histogram helps in visualizing the strength of the current market movement.
Buy/Sell Markers: The indicator includes Buy/Sell signals that appear as green circles (Buy) and red diamonds (Sell), placed directly above or below the price bars for clear and actionable signals.
Background Highlights: To increase visibility and enhance the user experience, the Buy signal triggers a green background and the Sell signal triggers a red background , clearly highlighting the moments when the market is in a buy or sell zone.
How it Works:
Adaptive Channel: The channel dynamically adjusts to price movements and provides insights into potential support and resistance levels. This helps traders identify price levels where a breakout or reversal could occur.
RSI: The RSI is calculated based on the closing prices over a defined period, typically 14 periods. When the RSI is above the overbought level (typically 70), it signals that the market may be overbought. When it is below the oversold level (typically 30), it suggests the market may be oversold.
MACD: The MACD indicator compares the difference between the 12-day and 26-day exponential moving averages, providing buy and sell signals when the MACD line crosses above or below the signal line.
TG Group: @vinotspace_chat
TG Channel: @vinotspace
Inside Bar Breakout/Fakeout with AI Scenarios [Yosiet]Inside Bar Breakout/Fakeout Indicator with Scenarios
The Indicator is a powerful tool for traders looking to identify potential breakout and fakeout opportunities based on inside bar patterns. This indicator combines multiple technical analysis concepts to provide a comprehensive view of market behavior, helping traders make more informed decisions.
Key Features
Inside bar detection with filtering
Breakout and fakeout identification
Three distinct scenario detections
Customizable moving average calculations
Flexible visualization options
Alert conditions for various events
How It Works
The indicator identifies inside bars and filters them based on a maximum number of consecutive inside bars. It then detects breakouts and fakeouts using user-defined parameters. The script also calculates moving averages to determine trend direction.
Three specific scenarios are detected:
Strong breakout followed by a strong reversal
Weak breakout with multiple doji/weak candles
Strong breakout without reversal
These scenarios are visually represented on the chart, allowing traders to quickly identify potential trading opportunities.
How to Use
Apply the indicator to your chart
Adjust the input parameters to suit your trading style
Look for inside bar patterns and subsequent breakouts/fakeouts
Pay attention to the three scenario markers for additional context
Use the alert conditions to stay informed of potential opportunities
Adjustable Entry Price Levels by Sobhi v6Adjustable Entry Price Levels", is designed to display customizable price levels on a chart, allowing traders to visualize key price zones relative to a chosen entry price. Here's a detailed breakdown of its functionality:
Purpose
The indicator helps traders create and manage equidistant price levels (both above and below a selected entry price). These levels can assist in planning trades, setting stop-loss and take-profit levels, or identifying key market zones for decision-making.
Features
Entry Price Input:
Users can specify a starting price (Entry Price) to base the levels on.
Adjustable Distance Between Levels:
Levels are spaced at a user-defined interval (Distance), creating equidistant horizontal lines.
Number of Levels:
Users can select how many levels to display above and below the entry price (Number of Levels).
Line Customization:
Style: Choose between Solid, Dotted, or Dashed lines.
Color: Customize the color for upward and downward levels (Line Color Up and Line Color Down).
Thickness: Adjust line thickness (Line Width).
Label Customization:
Visibility: Option to show or hide labels on each level (Show Labels).
Font Size: Set the size of the text for level labels (Label Font Size).
Colors: Separate customization for labels above (Label Color Up) and below (Label Color Down) the entry price.
Extended Line Display:
The lines extend backward (Extend Bars Back) and forward (Extend Bars Forward) to ensure visibility over a larger section of the chart.
Visualization
Upward Levels:
Represented by blue (default) horizontal lines above the entry price.
Labels display the price value of each level in the same color.
Downward Levels:
Represented by red (default) horizontal lines below the entry price.
Labels display the price value of each level in the same color.
Example Use Case
Scenario 1: Support and Resistance Planning
A trader can define a key level (Entry Price) and observe nearby support and resistance zones using the calculated price levels.
Scenario 2: Risk Management
The indicator helps in visualizing stop-loss and take-profit areas equidistant from the entry price.
Scenario 3: Breakout Targets
Traders can use the levels to anticipate potential breakout or breakdown targets.
Customization Options
This indicator is highly customizable, making it versatile for different trading strategies. Traders can tweak:
The visual appearance of the levels (style, color, width).
The number of levels and their spacing.
Whether labels are displayed and their style.
Enhanced SMC Buy/Sell Signals (15min) by Haristhis is based on smc and price action and works wonderfully well in 15 min timeframe with a success rate over 75%
AMIN MAGHSOUDLOO Spike Detectorنماد XAUUSD
تایم فریم M5
نوع چارت کندل استیک
بهترین زمان کار : 6 تا 8 و 11 تا 13 و 17 تا 21
اندیکاتور : EMA 20
ابزار : خط – مستطیل – فیبوناچی
نرخ سود : 1 به 1
نرخ برنده : 80%
تعداد موقعیت در روز : 5 تا 15
1- سقف و کف هفته گذشته با خط سیاه مشخص شود
2- سقف و کف روز گذشته با خط قرمز مشخص شود
3- نمودار میانگین متحرک نمایی EMA با دوره 20 روزه روی چارت باشد (جهت مشخص کردن جهت روند)
4- تایم فریم اصلی M5 است
5- پولبک لایه سوم برای اسپایک پیدا میشود (اسپاک نباید کوچکتر از 20 پیپ * ATR * 0.9 باشد)
6- پولبک نباید بیش تر از 70 اسپایک را برگشته باشد
7- سقف و کف ناحیه پولبک را مشخص میکنیم
8- اگر ارتفاع پولبک بیشتر از 2% سرمایه شد ، از این موقعیت صرف نظر میکنیم
9- منتظر شکست ناحیه پولبک از بالا یا پایین می مانیم
10- در روند صعودی مراقب شکست از کف ودر روند نزولی مراقب شکست از سقف باشیم چون احتمال مثلث گسترشی و استاپ زیاد است
11 – حرکت بازار پس از اسپایک ، یکی از حالتهای کانال یا رنج یا اسپایک جدید خواهد بود
12- شناسایی الگوی در حال شکل گرفتن داخل باکس پولبک ، کمک زیادی در خصوص آینده حرکت خواهد کرد
** ظهور سیگنال بار (پین بار قوی) و کی بار ، تایید بر قدرت روند جدید میباشد .
13- در صورت بسته شدن قیمت در بالا یا پایین باک پولبک ، پس از بازگشت قیمت به لبه باکس ، با نصف حجم مجاز وارد معامله میشویم
14- در صورت بسته شدن قیمت در بالا یا پایین باک پولبک ، پس از بازگشت قیمت به وسط باکس ، با نصف حجم مجاز وارد معامله میشویم
15- در هر موقعیت معاملاتی ، بین 1 تا 2 درصد سود کافیست و از معامله خارج میشود
16- در صورت مشاهده نشانه برگشت یا ظهور اسپایک جدید در خلاف معامله ما ، با کمترین سود و حتی ضرر کم خارج میشویم
Kashinsth_RSI PrimedThis code updated RSI with updated leve marking in to the code. This will help user to identify sideways market
1-3-1 Strat Combo with 50% Level (12h)Logic Explanation
1-3-1 Combo Detection:
The script detects the 1-3-1 pattern using the previous 3 candles:
Candle 4: Inside Bar (Type 1).
Candle 3: Outside Bar (Type 3).
Candle 2: Inside Bar (Type 1).
4th Candle Behavior:
If the 4th candle (current bar):
Stays an inside bar (Type 1) → isFourthInsideBar is true.
Becomes a directional bar (Type 2) → isFourthDirectional is true.
If either of these conditions is true, the script stops calculating and waits for the next valid 1-3-1 setup.
50% Level Calculation:
If the conditions are not met (e.g., the 4th candle doesn’t stop the pattern), the script:
Plots a dotted line at the 50% level of the 3rd candle.
Adds a label showing the 50% level.
Stop Calculations:
No line, box, or label is drawn if the 4th candle is a Type 1 (inside bar) or Type 2 (directional bar).
Visual Outputs:
Dotted Box: Marks the 1-3-1 combo setup.
50% Line: Drawn only if the 4th candle does not invalidate the pattern.
Label: Displays the 50% level of the 3rd candle.
How to Use:
Apply this script on the 12-hour chart.
The script will:
Detect valid 1-3-1 patterns.
Stop drawing any calculations if the 4th candle is an inside bar (1) or a directional bar (2).
Wait for the next valid 1-3-1 combo.
Buyers vs Sellers % This Buyers vs Sellers Imbalance Indicator provides real-time insight into the market's buying and selling pressure. It calculates and displays the percentage of buy and sell volume in relation to each other, using advanced price action analysis and multiple technical factors to determine market sentiment. Here's how it works:
How It Calculates the Imbalance Between Buyers and Sellers:
Candle Analysis: The indicator starts by analyzing each candle's price action. It breaks down the candle into three key parts:
Body: The area between the open and close, showing buying or selling dominance.
Upper Wick: The wick above the body, indicating selling pressure.
Lower Wick: The wick below the body, indicating buying pressure.
The relative sizes of these parts are calculated in ticks, which helps the indicator assess whether buyers or sellers were more dominant during the session.
Volume-weighted Calculation: The indicator uses volume-weighted calculations for each candle, taking into account the actual trading volume along with the candle size and wick sizes. This ensures that large, high-volume candles are given more weight than small, low-volume candles, improving accuracy.
Trend Filters (9 EMA): The indicator incorporates the 9-period Exponential Moving Average (EMA) to identify whether the market is in an uptrend or downtrend. If the price is above the 9 EMA, the indicator will give more weight to buying pressure, while if the price is below the 9 EMA, it will give more weight to selling pressure.
Support/Resistance & Pivot Points: It also tracks key support and resistance levels using pivot points. When the price breaks above resistance, buy pressure increases, and when it falls below support, sell pressure increases.
Candlestick Patterns: The indicator detects bullish and bearish candlestick patterns like Bullish Engulfing, Bearish Engulfing, Morning Star, and Evening Star, adjusting the imbalance based on the strength of these patterns.
Market Consolidation Detection: It detects periods of market consolidation using the Average True Range (ATR) and adjusts the buy/sell imbalance to avoid overreacting during choppy, sideways market conditions.
RSI Adjustments: The Relative Strength Index (RSI) is used to fine-tune the imbalance. If the RSI is overbought (above 70), selling pressure is weighted more. If the RSI is oversold (below 30), buying pressure is weighted more.
Time-of-Day Adjustments: The indicator adjusts the imbalance during certain times of the day (like the first and last hour of trading), when volatility and momentum are typically stronger.
Customizing to Your Trading Style:
Time Period for Imbalance Calculation: You can customize the lookback period for the imbalance calculation (default is 14), allowing you to adjust how sensitive the indicator is to recent price action.
Tick Size Adjustments: Set the tick size based on the specific instrument you're trading (e.g., ES1, NQ1) to ensure accurate calculations.
Trend Sensitivity (9 EMA): Customize how much weight the 9-period EMA has on the imbalance calculations. If you prefer a more aggressive trend filter, increase the weight given to the 9 EMA.
Consolidation Sensitivity: You can adjust how sensitive the indicator is to consolidation periods by modifying the ATR multiplier, allowing you to filter out false signals during sideways market conditions.
RSI Adjustment: Fine-tune how much the RSI affects the imbalance calculation, helping you react more effectively to overbought or oversold conditions.
Table Positioning: You can position the table displaying the buy and sell percentages anywhere on the chart (top-left, top-right, bottom-left, or bottom-right), giving you full control over your workspace.
How to Use the Indicator:
Watch for Imbalance Shifts:
A higher Buy % indicates stronger buying pressure, and a higher Sell % indicates stronger selling pressure.
Look for imbalances that align with other market conditions, such as price being above or below key support/resistance or the 9 EMA.
Combine with Other Tools:
Use this indicator alongside other technical tools like moving averages, trendlines, and candlestick patterns to enhance your decision-making.
Customization for Different Strategies:
Scalpers may prefer a shorter lookback period for quicker, more responsive imbalances.
Swing traders might prefer longer lookback periods and more focus on the overall trend (using the 9 EMA).
Range traders can use the consolidation feature to avoid trading during low-volatility periods.
TRIX | Matheus Trixindicador desenvolvido para o mercado financeiro no geral, tendo que ajustar o mesmo para cada ativo que for usar.
DESENVOLVI com base em suporte e resistencia, canais de fibonacci e uma ema adaptável
SMA-EMA Crossover StrategySMA: Simple Moving Average calculated over a specified period.
EMA: Exponential Moving Average gives more weight to recent price data.
Buy Signal: When EMA crosses above the SMA.
Sell Signal: When EMA crosses below the SMA.
You can customize the lengths of the SMA and EMA to match your strategy preferences. If you have any additional modifications or requirements, let me know!
Tomas Ratio Strategy with Multi-Timeframe AnalysisHello,
I would like to present my new indicator I have compiled together inspired by Calmar Ratio which is a ratio that measures gains vs losers but with a little twist.
Basically the idea is that if HLC3 is above HLC3 (or previous one) it will count as a gain and it will calculate the percentage of winners in last 720 hourly bars and then apply 168 hour standard deviation to the weekly average daily gains.
The idea is that you're supposed to buy if the thick blue line goes up and not buy if it goes down (signalized by the signal line). I liked that idea a lot, but I wanted to add an option to fire open and close signals. I have also added a logic that it not open more trades in relation the purple line which shows confidence in buying.
As input I recommend only adjusting the amount of points required to fire a signal. Note that the lower amount you put, the more open trades it will allow (and vice versa)
Feel free to remove that limiter if you want to. It works without it as well, this script is meant for inexperienced eye.
I will also publish a indicator script with this limiter removed and alerts added for you to test this strategy if you so choose to.
Also, I have added that the trades will enter only if price is above 720 period EMA
Disclaimer
This strategy is for educational purposes only and should not be considered financial advice. Always backtest thoroughly and adjust parameters based on your trading style and market conditions.
Made in collaboration with ChatGPT.
script 2script 2 test 2
script 2 test 2
script 2 test 2
script 2 test 2
script 2 test 2
script 2 test 2
script 2 test 2
script 2 test 2
script 2 test 2
script 1script 1 test 1
script 1 test 1
script 1 test 1
script 1 test 1
script 1 test 1
script 1 test 1
script 1 test 1
SMAX SupertrendThis indicator combines the regular super trend with the 9/21 ema which makes it great for scalping, day trading and swinging. what makes this slightly different also this has a smoothining function. hope you enjoy and leave comments
Fibonacci Retracement Selling Strategy This is the selling strategy with using the fibonacci retracement
CHoCH with alerts//This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © CBriggsnz
// This a modification to add alert functions. All credits belong to the original author CBriggsnz
// The original indicator can be found here:
//@version=5
indicator("CHoCH with alerts", overlay = true, max_lines_count=500)
// ============================================================
// Imports
// ============================================================{
// Debugging
import ed56/debugger/2 as db
= db.debugger()
// ============================================================}
// ============================================================
// Inputs
// ============================================================{
var CHoCH_Group = "Visual Settings"
var CHoCH_Style_in = input.string("┈┈┈┈", "CHoCH Style", options= , inline = "CH1_line", group = CHoCH_Group)
var CHoCH_Style = (CHoCH_Style_in == "┈┈┈┈") ? line.style_dotted : (CHoCH_Style_in == "╌╌╌╌") ? line.style_dashed : line.style_solid
var CHoCH_Color = input.color(color.new(color.blue,20),"Color", inline = "CH1_line", group = CHoCH_Group)
var CHoCH_Thickness = input.int(1, "Thickness", minval = 1, step = 1, inline = "CH1_line", group = CHoCH_Group)
var CHoCH_Change = input(false,"Show CHoCH continuations", group = CHoCH_Group, tooltip = "If unset then only show CHoCHs on Change of Trend")
var CHoCH_cont_Style_in = input.string("┈┈┈┈", "CHoCH Cont Style", options= , inline = "CH2_line", group = CHoCH_Group)
var CHoCH_cont_Style = (CHoCH_cont_Style_in == "┈┈┈┈") ? line.style_dotted : (CHoCH_cont_Style_in == "╌╌╌╌") ? line.style_dashed : line.style_solid
var CHoCH_cont_Color = input.color(color.new(color.aqua,45),"Color", inline = "CH2_line", group = CHoCH_Group)
var CHoCH_cont_Thickness = input.int(1, "Thickness", minval = 1, step = 1, inline = "CH2_line", group = CHoCH_Group)
var CHoCH_number = input.int(6, "Number of CHoCHs to display", minval = 0, group = CHoCH_Group)
var CHoCH_extras = "CHoCH Prediction"
var CHoCH_helper_Style_in= input.string("┈┈┈┈", "Prediction Style", options= , inline = "CH1_line", group = CHoCH_extras)
var CHoCH_helper_Style = (CHoCH_helper_Style_in == "┈┈┈┈") ? line.style_dotted : (CHoCH_helper_Style_in == "╌╌╌╌") ? line.style_dashed : line.style_solid
var CHoCH_helper_Color = input.color(color.new(color.blue,20),"Color", inline = "CH1_line", group = CHoCH_extras)
var CHoCH_helper_Thickness= input.int(2, "Thickness", minval = 1, step = 1, inline = "CH1_line", group = CHoCH_extras)
var show_CHoCH_fractal_HL= input(false,"Show Fractal High and Low Line", group = CHoCH_extras, tooltip = "Shows the current fractal range, good when learning how to draw CHoCHs.")
var show_next_CHoCH = input(true,"Show Next CHoCH line", group = CHoCH_extras, tooltip = "Shows the the line where the next CHoCH will happen.")
// ============================================================
// Modification: Add Alert Functions
// ============================================================
grp = "Alert Functions"
alert_bull_choch = input.bool(true,"Activate alerts for bullish CHoCHs", group = grp)
alert_bear_choch = input.bool(true,"Activate alerts for bearish CHoCHs", group = grp)
alert_cont_choch = input.bool(false,"Activate alerts for continuation CHoCHs", group = grp)
alert_freq = input.string(alert.freq_once_per_bar,"Alert Frequency", options = , group = grp)
// Note: the added alert conditions are part of the main code
// =======================End of Input=========================}
// ============================================================
// Constants - Initial Variable Setup
// ============================================================ {
var float CH_high_price = na
var int CH_high_index = na
var float CH_low_price = na
var int CH_low_index = na
var CH_line_array = array.new_line(0)
var CH_cont_line_array = array.new_line(0)
var CHoCH_trend = ""
if barstate.isfirst
CH_low_price := low
CH_low_index := bar_index
CH_high_price := high
CH_high_index := bar_index
var label CH_high = label.new(na,na,"Fractal High", style = label.style_label_left, color = color.new(color.white, 100), textcolor = CHoCH_Color)
var label CH_low = label.new(na,na, "Fractal Low", style = label.style_label_left, color = color.new(color.white, 100), textcolor = CHoCH_Color)
var line CH_high_line = line.new(na,na,na,na, width = 2, color = CHoCH_helper_Color, style =CHoCH_helper_Style, width = CHoCH_helper_Thickness )
var line CH_low_line = line.new(na,na,na,na, width = 2, color = CHoCH_helper_Color, style =CHoCH_helper_Style, width = CHoCH_helper_Thickness)
// ====================End of CONSTANTS========================}
// ============================================================
// Functions
// ============================================================{
// ==============================
// Utility Functions
// ============================== {
ts(value) =>
// converts int, float, bool into strings
// value -> variable to be converted
// returns ->
// string value -> a string
str.tostring(value)
print(value) =>
// Print log to screen
// any value -> variable to be printed
db.print(c, f, ts(value))
// ============================== }
// ==============================
// Drawing Functions
// ============================== {
drawLine(lin_array, x1, y1, x2, y2, style = line.style_solid, width = 1, linecolor = color.white) =>
// Draw a line
// lin_array -> array to add the line to
// int x1 -> index to draw the start of the line at
// float y1 -> price to draw the start of the line at
// int x2 -> index to draw the end of the line at
// float y2 -> price to draw the end of the line at
// print("New CHoCH at " + ts(x1) + " " + ts(y1))
l = line.new( x1=x1, y1=y1, x2=x2, y2=y2, style = style,color = linecolor, width = width)
array.unshift(lin_array, l)
clearDrawing(line_array) =>
// erase CHoCH drawings that are beyond the requested number of CHoCH's
// line_array -> an array of lines to be deleted
if array.size(line_array) > CHoCH_number
for i = CHoCH_number to array.size(line_array) - 1
line.delete(array.get(line_array,i) )
for i = array.size(line_array) - 1 to CHoCH_number
array.remove(line_array,i)
changeHighLowLines(hi, hp, li, lp) =>
// Change the fractal high and low lines
// int hi -> index of high
// float hp -> price of high
// int li -> index of low
// float lp -> price of low
line.set_xy1(CH_high_line, hi, hp)
line.set_xy2(CH_high_line, bar_index + 10, hp)
line.set_xy1(CH_low_line, li, lp)
line.set_xy2(CH_low_line, bar_index + 10, lp)
label.set_xy(CH_high, bar_index + 10, CH_high_price)
label.set_xy(CH_low, bar_index + 10, CH_low_price)
changeNextCHoCH(hi, hp, li, lp) =>
// CHoCH_trend
if CHoCH_trend == "Bullish"
line.set_color(CH_low_line, CHoCH_helper_Color)
line.set_color(CH_high_line, color.new(color.white,100))
line.set_xy1(CH_low_line, li, lp)
line.set_xy2(CH_low_line, bar_index + 10, lp)
if CHoCH_trend == "Bearish"
line.set_color(CH_low_line, color.new(color.white,100))
line.set_color(CH_high_line, CHoCH_helper_Color)
line.set_xy1(CH_high_line, hi, hp)
line.set_xy2(CH_high_line, bar_index + 10, hp)
// ============================== }
// ==============================
// Calculation Functions
// ============================== {
highSince(int end, start = 0) =>
// Find the highest value since start bars back
// int start -> bars back
// returns ->
//int -> bars back to highest high
int hIndex = 0
float hPrice = 0
for i = (end) to (start)
if high > hPrice
hIndex := i
hPrice := high
hIndex
lowSince(int end, start = 0) =>
// Find the lowest value since start bars back
// int start -> bars back
// returns ->
// int -> bars back to lowest low
int hIndex = 0
float hPrice = 99999999
for i = (end) to (start)
if low < hPrice
hIndex := i
hPrice := low
hIndex
findBreakInLow() =>
// finds where the low run stops
// returns ->
// int highSince(_i) -> index of highest candle since low
int _i = 0
cond = low > low
while cond
_i := _i + 1
cond := low > low
highSince(_i)
findBreakInHigh() =>
// finds where the high run stops
// returns ->
// int lowSince(_i) -> index of lowest candle since low
int _i = 0
cond = high < high
while cond
_i := _i + 1
cond := high < high
lowSince(_i)
// ============================== }
// ====================== End of Function =====================}
// ============================================================
// Main Code
// ============================================================{
engulfed = false
// Candle is engulfing candle
if high > CH_high_price and low < CH_low_price and low < CH_low_price and low > CH_low_price
// candle engulfs previous candle and takes out both low and high in one move
engulfed := true
if CHoCH_trend == "Bearish"
drawLine(CH_line_array, CH_high_index, CH_high_price, bar_index, CH_high_price, style = CHoCH_Style, width = CHoCH_Thickness, linecolor = CHoCH_Color)
clearDrawing(CH_line_array)
CHoCH_trend := "Bullish"
if CHoCH_trend == "Bullish"
drawLine(CH_line_array, CH_low_index, CH_low_price, bar_index, CH_low_price, style = CHoCH_Style, width = CHoCH_Thickness, linecolor = CHoCH_Color)
clearDrawing(CH_line_array)
CHoCH_trend := "Bearish"
// breaks fractal high
if high > CH_high_price
if high <= CH_high_price and not engulfed
// candle caused CHoCH or continuation CHoCH (name?)
if CHoCH_trend == "Bearish"
drawLine(CH_line_array, CH_high_index, CH_high_price, bar_index, CH_high_price, style = CHoCH_Style, width = CHoCH_Thickness, linecolor = CHoCH_Color)
clearDrawing(CH_line_array)
if alert_bull_choch // modification to add alerts
alert("Bullish CHoCH",alert_freq)
else if alert_cont_choch // modification to add alerts
alert("Bullish Cont CHoCH",alert_freq)
else if CHoCH_Change
drawLine(CH_cont_line_array, CH_high_index, CH_high_price, bar_index, CH_high_price, style = CHoCH_cont_Style, width = CHoCH_cont_Thickness, linecolor = CHoCH_cont_Color)
clearDrawing(CH_cont_line_array)
CHoCH_trend := "Bullish"
// calculate new fractal high and low
CH_high_price := high
CH_high_index := bar_index
lowOffset = findBreakInHigh()
CH_low_index := bar_index - lowOffset
CH_low_price := low
// breaks fractal low
if low < CH_low_price
if low >= CH_low_price and not engulfed
// candle caused CHoCH or continuation CHoCH (name?)
if CHoCH_trend == "Bullish"
drawLine(CH_line_array, CH_low_index, CH_low_price, bar_index, CH_low_price, style = CHoCH_Style, width = CHoCH_Thickness, linecolor = CHoCH_Color)
clearDrawing(CH_line_array)
if alert_bear_choch // modification to add alerts
alert("Bearish CHoCH",alert_freq)
else if alert_cont_choch // modification to add alerts
alert("Bearish Cont CHoCH",alert_freq)
else if CHoCH_Change
drawLine(CH_cont_line_array, CH_low_index, CH_low_price, bar_index, CH_low_price, style = CHoCH_cont_Style, width = CHoCH_cont_Thickness, linecolor = CHoCH_cont_Color)
clearDrawing(CH_cont_line_array)
CHoCH_trend := "Bearish"
// calculate new fractal high and low
CH_low_price := low
CH_low_index := bar_index
highOffset = findBreakInLow()
CH_high_index := bar_index - highOffset
CH_high_price := high
// Draw in fractal high and low if selected
if show_CHoCH_fractal_HL
changeHighLowLines(CH_high_index, CH_high_price, CH_low_index, CH_low_price)
else if show_next_CHoCH
changeNextCHoCH(CH_high_index, CH_high_price, CH_low_index, CH_low_price)
// ==================== End of Main Code ======================}
// plot(bar_index)
// print("CHoCH_trend: " + CHoCH_trend)
Blue Sniper TestBlue Sniper is a indicator that allows traders to make high probable decisions for their trades.
It is most effective in trending markets. If the market is consolidated or ranging the strategy is ineffective.
Combine the strategy with proper support and resistance levels and traders should be able to make accurate decisions for their trades.
Refined SMA/EMA Crossover with Ichimoku and 200 SMA FilterYour **Refined SMA/EMA Crossover with Ichimoku and 200 SMA Filter** strategy is a multi-faceted technical trading strategy that combines several key technical indicators to refine entry and exit points for trades. Here's a breakdown of the components and how they work together:
### 1. **SMA/EMA Crossover**
- **Simple Moving Average (SMA) & Exponential Moving Average (EMA) Crossover**:
- The core idea behind the crossover strategy is to use the relationship between two moving averages to generate buy or sell signals.
- **SMA** (Simple Moving Average) gives an average of past prices over a set period.
- **EMA** (Exponential Moving Average) places more weight on recent prices, making it more responsive to price movements.
- A **bullish crossover** occurs when a shorter period moving average (such as a 50-period EMA) crosses above a longer period moving average (such as a 200-period SMA), signaling a potential buy.
- A **bearish crossover** occurs when a shorter period moving average crosses below the longer period moving average, signaling a potential sell.
### 2. **Ichimoku Cloud**
- The **Ichimoku Cloud** is a versatile indicator that provides insight into trend direction, support and resistance levels, and momentum.
- **Cloud (Kumo)**: The space between the Senkou Span A and Senkou Span B lines. It helps identify whether the market is in an uptrend, downtrend, or consolidation.
- **Tenkan-sen** (Conversion Line) and **Kijun-sen** (Base Line): These lines are used for additional confirmation of trend direction.
- **Chikou Span**: A lagging line that is used to confirm the trend.
- The general trading rules based on the Ichimoku Cloud are:
- **Bullish Signal**: When the price is above the cloud and the Tenkan-sen crosses above the Kijun-sen.
- **Bearish Signal**: When the price is below the cloud and the Tenkan-sen crosses below the Kijun-sen.
### 3. **200 SMA Filter**
- The **200 SMA Filter** serves as a long-term trend filter.
- When the price is **above the 200 SMA**, it signals a long-term bullish trend, and you only look for buying opportunities.
- When the price is **below the 200 SMA**, it signals a long-term bearish trend, and you only look for selling opportunities.
- This filter helps to avoid counter-trend trades, aligning your positions with the broader market trend.
### **How the Strategy Works Together**
- **Trade Setup (Long Position)**
1. The **200 SMA Filter** must confirm an **uptrend** by ensuring that the price is above the 200 SMA.
2. A **bullish crossover** (e.g., the 50 EMA crossing above the 200 SMA) occurs.
3. **Ichimoku Cloud** confirms a bullish trend, with the price above the cloud and the Tenkan-sen crossing above the Kijun-sen.
4. You enter a **long trade** with this confluence of signals.
- **Trade Setup (Short Position)**
1. The **200 SMA Filter** must confirm a **downtrend** by ensuring the price is below the 200 SMA.
2. A **bearish crossover** (e.g., the 50 EMA crossing below the 200 SMA) occurs.
3. **Ichimoku Cloud** confirms a bearish trend, with the price below the cloud and the Tenkan-sen crossing below the Kijun-sen.
4. You enter a **short trade** with this confluence of signals.
### **Exit Strategy**
- Exits can be determined based on any of the following:
- **SMA/EMA crossover reversal**: Exit when the shorter-term moving average crosses back below the longer-term moving average for a long position or crosses above for a short position.
- **Ichimoku Cloud reversal**: If the price breaks through the cloud or the Tenkan-sen and Kijun-sen lines cross in the opposite direction.
- **Profit target or stop loss**: Setting predefined profit targets or using a trailing stop to lock in profits as the trade moves in your favor.
Summary of the Strategy
This strategy is designed to identify strong trends and avoid false signals by combining:
SMA/EMA crossovers for immediate market direction signals.
Ichimoku Cloud for confirming the strength and trend direction.
A 200
SMA filter to ensure trades align with the long-term trend.
By using these multiple indicators together, the strategy aims to refine entry and exit points, minimize risk, and increase the likelihood of successful trades.