Cari dalam skrip untuk "entry"
Amazing Crossover SystemEntry Rules
BUY when the 5 EMA crosses above the 10 EMA from underneath and the RSI crosses above the 50.0 mark from the bottom.
SELL when the 5 EMA crosses below the 10 EMA from the top and the RSI crosses below the 50.0 mark from the top.
Make sure that the RSI did cross 50.0 from the top or bottom and not just ranging tightly around the level.
How to setup Alert:
1) Add the Amazing Crossover System to your chart via Indicators
2) Find your currency pair
3) Set the timeframe on the chart to 1 hour
4) Press 'Alt + A' (create alert shortcut)
5) Set the following criteria for the alert:
Condition = 'Amazing Crossover System', Plot, ' BUY Signal'
The rest of the alert can be customized to your preferences
5) Repeat steps 1 - 4, but set the Condition = 'Amazing Crossover System', Plot, ' SELL Signal'
Adaptive HMA Trendfilter & Profit SpikesShort Description
Adaptive trend-following filter using Hull Moving Average (HMA) slope.
Includes optional Keltner Channel entries/exits and dynamic spike-based take-profit markers (ATR/Z-Score).
Optional Fast HMA for early entry visualization (not included in logic).
USER GUIDE:
1) Quick Overview
Trend Filter: Slow HMA defines Bull / Bear / Sideways (via slope & direction).
Entries / Exits:
Entry: Color change of the slow HMA (red→green = Long, green→red = Short), optionally filtered by the Keltner basis.
Exit: Preferably via Keltner Band (Long: Close under Upper Band; Short: Close above Lower Band).
Fallback: exit on opposite HMA color change.
Take-Profit Spikes: Marks abnormal moves (ATR, Z-Score, or both) as discretionary TP signals.
Fast HMA (optional): Purely visual for early entry opportunities; not part of the core trading logic (see §5).
2) Adding & Basic Setup
Add the indicator to your chart.
Open Settings (gear icon) and configure:
HMA: Slow HMA Length = 55, Slope Lookback = 10, Slope Threshold = 0.20%.
Keltner: KC Length = 20, Multiplier = 1.5.
Spike-TP: Mode = ATR+Z, ATR Length = 14, Z Length = 20, Cooldown = 5.
Optionally: enable Fast HMA (e.g., length = 20).
3) Input Parameters – Key Controls
Slow HMA Length: Higher = smoother, fewer but cleaner signals.
Slope Lookback: How far back HMA slope is compared against.
Slope Threshold (%): Minimum slope to avoid “Sideways” regime.
KC Length / Multiplier: Width and reactivity of Keltner Channels.
Exits via KC Bands: Toggle on/off (recommended: on).
Entries only above/below KC Basis: Helps filter out chop.
Spike Mode: Choose ATR, Z, or ATR+Z (stricter, fewer signals).
Spikes only when in position: TP markers show only when you’re in a trade.
4) Entry & Exit Logic
Entries
Long: Slow HMA turns from red → green, and (if filter enabled) Close > KC Basis.
Short: Slow HMA turns from green → red, and (if filter enabled) Close < KC Basis.
Exits
KC Exit (recommended):
Long → crossunder(close, Upper KC) closes trade.
Short → crossover(close, Lower KC).
Fallback Exit: If KC Exits are off → exit on opposite HMA color change.
Spike-TP (Discretionary)
Marks unusually large deviations from HMA.
Use for partial profits or tightening stops.
⚠️ Not auto-traded — only marker/alert.
5) Early Entry Opportunities (Fast HMA Cross – visual only)
The script can optionally display a Fast HMA (e.g., 20) alongside the Slow HMA (e.g., 55).
Bullish early hint: Fast HMA crosses above Slow HMA, or stays above, before the Slow HMA officially turns green.
Bearish early hint: opposite.
⚠️ These signals are not part of the built-in logic — they are purely discretionary:
Advantage: Earlier entries, more profit potential.
Risk: Higher chance of whipsaws.
Practical workflow (early long entry):
Fast HMA crosses above Slow HMA AND Close > KC Basis.
Enter small position with tight stop (under KC Basis or HMA swing).
Once Slow HMA confirms green → add to position or trail stop tighter.
6) Recommended Presets
Crypto (1h/2h):
HMA: 55 / 10 / 0.20–0.30%
KC: 20 / 1.5–1.8
Spikes: ATR+Z, ATR=14, Z=20, Cooldown 5
FX (1h/4h):
HMA: 55 / 8–10 / 0.10–0.25%
KC: 20 / 1.2–1.5
Indices (15m/1h):
HMA: 50–60 / 8–12 / 0.15–0.30%
KC: 20 / 1.3–1.6
Fine-tuning:
Too noisy? → Raise slope threshold or increase HMA length.
Too sluggish? → Lower slope threshold or shorten HMA length.
7) Alerts – Best Practice
Long/Short Entry – get notified when trend color switches & KC filter is valid.
Long/Short Exit – for KC exits or fallback exits.
Long/Short Spike TP – for discretionary profit-taking.
Set via TradingView: Create Alert → Select this indicator → choose condition.
8) Common Pitfalls & Tips
Too many false signals?
Raise slope threshold (more “Sideways” filtering).
Enable KC filter for entries.
Entries too late?
Use Fast HMA cross for early discretionary entries.
Or lower slope threshold slightly.
Spikes too rare/frequent?
More frequent → ATR mode or lower ATR multiplier / Z-threshold.
Rarer but stronger → ATR+Z with higher thresholds.
9) Example Playbook (Long Trade)
Regime: Slow HMA still red, Fast HMA crosses upward (early hint).
Filter: Close > KC Basis.
Early Entry: Small size, stop below KC Basis or recent swing low.
Confirmation: Slow HMA turns green → scale up or trail stop.
Management: Partial profits at Spike-TP marker; full exit at KC upper band break.
Trend Pro - @CRYPTIK1Introduction: What is Trend Pro?
Trend Pro is a comprehensive trend analysis tool designed to give you a clear, at-a-glance understanding of the market's direction across multiple timeframes. In a noisy market, the single most important factor is the dominant trend. This indicator filters out the noise by focusing on one core principle: trading with the primary momentum of the market.
Instead of cluttering your chart with confusing signals, Trend Pro provides a clean, visual representation of the trend, helping you make more confident and informed trading decisions.
The Core Concept: The Power of Confluence
The strength of any trading decision comes from confluence—when multiple factors align to point in the same direction. Trend Pro is built on this idea. It uses a long-term moving average (200-period by default) to define the primary trend on your current chart and then pulls in data from three higher timeframes to confirm whether the broader market agrees with your analysis.
When your current timeframe and the higher timeframes are all aligned, you have a state of "confluence," which represents a higher-probability environment for trend-following trades.
This tool is designed to be a foundational layer for your trading system, providing the essential context you need before entering any trade.
Key Features
1. The Dynamic Trend MA:
The main moving average on your chart acts as your primary guide. Its color dynamically changes to give you an instant read on the market.
Green MA: The price is in a confirmed uptrend (trading above the MA).
Red MA: The price is in a confirmed downtrend (trading below the MA).
2. The Multi-Timeframe (MTF) Trend Dashboard:
Located discreetly in the bottom-right corner, this dashboard is your window into the broader market sentiment. It shows you the trend status (Up, Down, or Neutral) on three customizable higher timeframes.
Green Box: The trend is UP on that timeframe.
Red Box: The trend is DOWN on that timeframe.
Gray Box: The price is neutral or at the MA on that timeframe.
How to Use Trend Pro: A Simple Framework
Step 1: Identify the Primary Trend
Look at the color of the MA on your main chart. This is your starting point. If it's green, you should be looking for opportunities to go long. If it's red, you should be looking for opportunities to go short.
Step 2: Check for Confluence
Glance at the MTF Trend Dashboard.
Strong Confluence (High-Probability): If your main chart is in an uptrend (Green MA) and the dashboard shows all green boxes, the market is in a strong, unified uptrend. This is a high-probability environment to be a buyer.
Weak or No Confluence (Caution Zone): If your main chart is in an uptrend, but the dashboard shows red or gray boxes, it signals that the higher timeframes are not in agreement. This is a sign of market indecision and a lower-probability environment. It's often best to wait for the timeframes to align.
Best Practices & Settings
Timeframe Synergy: For the best results, use Trend Pro on a lower timeframe and set your dashboard to higher timeframes. For example, if you trade on the 1-hour chart, set your MTF dashboard to the 4-hour, 1-day, and 1-week to get a complete picture of the market.
Use as a Confirmation Tool: Trend Pro is not designed to be a standalone entry/exit system. Use it as the foundational layer of your analysis. First, confirm the trend with Trend Pro, then use your preferred entry method (e.g., support/resistance, chart patterns, or other indicators) to time your trade.
MACD + RSI/MA Signals with 200 EMA (Overlay)How It’s Built
MACD Line = EMA(12) – EMA(26)
→ Short-term vs. medium-term momentum.
Signal Line = EMA(9) of MACD Line
→ Smooths things out.
Histogram = MACD Line – Signal Line
→ Visual "energy gauge" showing momentum strength.
What It Actually Tells You
Crossover Signals
MACD Line crosses above Signal Line → Bullish shift (momentum turning up).
MACD Line crosses below Signal Line → Bearish shift (momentum turning down).
⚠️ But: crossovers lag price. On their own, they’re late.
Zero Line Relevance
Above Zero → Trend bias is bullish (short-term EMA > long-term EMA).
Below Zero → Trend bias is bearish.
Crosses through zero often align with bigger trend changes.
Histogram Use
Expanding histogram = momentum strengthening.
Shrinking histogram = momentum weakening (trend may be stalling).
Flips from positive to negative (or vice versa) often precede crossovers.
Divergences
Price makes a new high, but MACD doesn’t → momentum is fading → possible reversal.
Same idea for lows.
Where Traders Go Wrong
Using it alone. It’s a confirmation tool, not an entry machine.
Misreading every crossover as a trade. Many are just noise, especially on low timeframes.
Forgetting market context — MACD works best in trending markets, not chop.
Best Way to Use It
With trend structure + support/resistance:
→ E.g., you’re eyeing a BTC bounce long. If MACD histogram turns from negative to positive while price defends support, that’s confirmation, not a blind buy.
For momentum timing:
→ Ride trends longer if histogram stays strong. Scale out when it weakens.
Divergence spotting:
→ Early heads-up that a reversal is brewing.
MACD + RSI/MA Signals with 200 EMA (Overlay)MACD (Moving Average Convergence Divergence) is a momentum + trend-following indicator that traders use to spot when momentum is shifting in or out of a trend. It’s built from moving averages but is more about the relationship between them than just the averages themselves.
How It’s Built
MACD Line = EMA(12) – EMA(26)
→ Short-term vs. medium-term momentum.
Signal Line = EMA(9) of MACD Line
→ Smooths things out.
Histogram = MACD Line – Signal Line
→ Visual "energy gauge" showing momentum strength.
What It Actually Tells You
Crossover Signals
MACD Line crosses above Signal Line → Bullish shift (momentum turning up).
MACD Line crosses below Signal Line → Bearish shift (momentum turning down).
⚠️ But: crossovers lag price. On their own, they’re late.
Zero Line Relevance
Above Zero → Trend bias is bullish (short-term EMA > long-term EMA).
Below Zero → Trend bias is bearish.
Crosses through zero often align with bigger trend changes.
Histogram Use
Expanding histogram = momentum strengthening.
Shrinking histogram = momentum weakening (trend may be stalling).
Flips from positive to negative (or vice versa) often precede crossovers.
Divergences
Price makes a new high, but MACD doesn’t → momentum is fading → possible reversal.
Same idea for lows.
Where Traders Go Wrong
Using it alone. It’s a confirmation tool, not an entry machine.
Misreading every crossover as a trade. Many are just noise, especially on low timeframes.
Forgetting market context — MACD works best in trending markets, not chop.
Best Way to Use It
With trend structure + support/resistance:
→ E.g., you’re eyeing a BTC bounce long. If MACD histogram turns from negative to positive while price defends support, that’s confirmation, not a blind buy.
For momentum timing:
→ Ride trends longer if histogram stays strong. Scale out when it weakens.
Divergence spotting:
→ Early heads-up that a reversal is brewing.
Intraday Scalping Trading System with Alerts# Flexible Buy/Sell Signals Source - Clean Labels & Volume Ranks Buy/Sell Only
**Description:**
This multi-featured indicator combines robust buy/sell signals from multiple popular sources with advanced volume labeling to highlight institutional activity and market momentum shifts.
## Key Features
- **Multi-Source Signal Options:**
Choose from EMA1/EMA2 crossover, EMA2/EMA3 crossover, price vs VWAP, or price vs SuperTrend for flexible signal generation matching diverse trading styles.
- **Clean Buy/Sell Labels:**
Displays clear buy and sell labels directly on the chart with customizable size, color, and offset to enhance entry/exit clarity.
- **Intraday Volume Ranking:**
Highlights the highest and 2nd highest volume bars of the day with bullish/bearish color-coded labels and vertical connection lines, aiding in identifying strong participation.
- **First Candle Range Visualization:**
Visualizes today’s first candle range on your preferred timeframe to help gauge initial market structure and early momentum.
- **VWAP & SuperTrend Integration:**
Optional plots for VWAP and SuperTrend lines add enhanced trend context and support decision making.
- **Previous OHLC Levels:**
Displays prior day, week, and month open, high, low, and close levels as lines and labels—vital reference points for support and resistance.
- **Highly Customizable:**
Each component includes toggle inputs for on/off control, allowing you to declutter and tailor the chart display to your preference.
- **Built-In Alerts:**
Includes alert conditions on buy and sell signals to enhance trading responsiveness.
## How to Use
1. Select the preferred buy/sell signal source from the dropdown input.
2. Enable and customize volume labels to identify key institutional volume candles.
3. Use first candle range, VWAP, and SuperTrend overlays optionally for confirmation.
4. Leverage prior OHLC levels for advanced support/resistance context.
5. Adjust label size, color, and positions for optimal visibility.
## Ideal For
Day traders, swing traders, and analysts seeking a clean, powerful toolkit to combine price action, institutional volume, and multiple indicator signals into actionable insights.
---
Trade responsibly and combine with your own analysis for best results.
Globex Trap w/ percentage [SLICKRICK]Globex Trap w/ Percentage
Overview
The Globex Trap w/ Percentage indicator is a powerful tool designed to help traders identify high-probability trading opportunities by analyzing price action during the Globex (overnight) session and regular trading hours. By combining Globex session ranges with Supply & Demand zones, this indicator highlights potential "trap" areas where significant price reactions may occur. Additionally, it calculates the Globex session range as a percentage of the daily Average True Range (ATR), providing valuable context for assessing market volatility.
This indicator is ideal for traders in futures markets or other instruments traded during Globex sessions, offering a visual and analytical edge for spotting key price levels and potential reversals or breakouts.
Key Features
Globex Session Tracking:
Visualizes the high and low of the Globex session (default: 3:00 PM to 6:30 AM PST) with customizable time settings.
Displays a semi-transparent box to mark the Globex range, with labels for "Globex High" and "Globex Low."
Calculates the Globex range as a percentage of the daily ATR, displayed as a label for quick reference.
Supply & Demand Zones:
Identifies Supply & Demand zones during regular trading hours (default: 6:00 AM to 8:00 AM PST) with customizable time settings.
Draws semi-transparent boxes to highlight these zones, aiding in the identification of key support and resistance areas.
Trap Area Identification:
Highlights potential trap zones where Globex ranges and Supply & Demand zones overlap, indicating areas where price may reverse or consolidate due to trapped traders.
Customizable Settings:
Adjust Globex and Supply & Demand session times to suit your trading preferences.
Toggle visibility of Globex and Supply & Demand zones independently.
Customize box colors for better chart readability.
Set the lookback period (default: 10 days) to control how many historical zones are displayed.
Configure the ATR length (default: 14) for the percentage calculation.
PST Timezone Default:
All times are based on Pacific Standard Time (PST) by default, ensuring accurate session tracking for users in this timezone or those aligning with U.S. West Coast market hours.
Recommended Usage
Timeframes: Best used on 1-hour charts or lower (e.g., 15-minute, 5-minute) for precise entry and exit points.
Markets: Optimized for futures (e.g., ES, NQ, CL) and other instruments traded during Globex sessions.
Historical Data: Ensure at least 10 days of historical data for optimal visualization of zones.
Strategy Integration: Use the indicator to identify potential reversals or breakouts at Globex highs/lows or Supply & Demand zones. The ATR percentage provides context for whether the Globex range is significant relative to typical daily volatility.
How It Works
Globex Session:
Tracks the high and low prices during the user-defined Globex session (default: 3:00 PM to 6:30 AM PST).
When the session ends, a box is drawn from the start to the end of the session, capturing the high and low prices.
Labels are placed at the midpoint of the session, showing "Globex High," "Globex Low," and the range as a percentage of the daily ATR (e.g., "75.23% of Daily ATR").
Supply & Demand Zones:
Tracks the high and low prices during the user-defined regular trading hours (default: 6:00 AM to 8:00 AM PST).
Draws a box to mark these zones, which often act as key support or resistance levels.
ATR Percentage:
Calculates the Globex range (high minus low) and divides it by the daily ATR to express it as a percentage.
This metric helps traders gauge whether the overnight price movement is significant compared to the instrument’s typical volatility.
Time Handling:
Uses PST (UTC-8) for all time calculations, ensuring accurate session timing for users aligning with this timezone.
Properly handles overnight sessions that cross midnight, ensuring seamless tracking.
Input Settings
Globex Session Settings:
Show Globex Session: Enable/disable Globex session visualization (default: true).
Globex Start/End Time: Set the start and end times for the Globex session (default: 3:00 PM to 6:30 AM PST).
Globex Box Color: Customize the color of the Globex session box (default: semi-transparent gray).
Supply & Demand Zone Settings:
Show Supply & Demand Zone: Enable/disable zone visualization (default: true).
Zone Start/End Time: Set the start and end times for Supply & Demand zones (default: 6:00 AM to 8:00 AM PST).
Zone Box Color: Customize the color of the zone box (default: semi-transparent aqua).
General Settings:
Days to Look Back: Number of historical days to display zones (default: 10).
ATR Length: Period for calculating the daily ATR (default: 14).
Notes
All times are in Pacific Standard Time (PST). Adjust the start and end times if your market operates in a different timezone or if you prefer different session windows.
The indicator is optimized for instruments with active Globex sessions, such as futures. Results may vary for non-24/5 markets.
A typo in the label "Globe Low" (should be "Globex Low") will be corrected in future updates.
Ensure your TradingView chart is set to display sufficient historical data to view the full lookback period.
Why Use This Indicator?
The Globex Trap w/ Percentage indicator provides a unique combination of session-based range analysis, Supply & Demand zone identification, and volatility context via the ATR percentage. Whether you’re a day trader, swing trader, or scalper, this tool helps you:
Pinpoint key price levels where institutional traders may act.
Assess the significance of overnight price movements relative to daily volatility.
Identify potential trap zones for high-probability setups.
Customize the indicator to fit your trading style and market preferences.
LuxAlgo Swing Highs/Lows & Candle Patterns [edited by AlexsOptioThis script plots higher highs and lower lows as well as lower highs and higher lows.
This is an edited script created by LuxAlgo that allows you to turn off the lower highs and higher lows.
This makes it very easy to time your entry signals.
Entering into an up trending market after lower lows and entering into downtrending market after higher highs
You can also use HH and LL to time market tops and bottoms
I plan on adding the ability to draw the broadening formation & gauge the magnitude of where price is going in the near future
ADX with Custom Limit LineADX with Custom Limit Line - Educational Indicator
═════════════════════════════════════════════════════════════
WHAT IS THIS INDICATOR?
This indicator displays the Average Directional Index (ADX) with a fully customizable limit line, designed specifically for educational purposes and trend strength analysis learning.
ORIGINALITY AND PURPOSE
Unlike standard ADX indicators that use fixed reference levels, this version allows traders to set their own custom threshold line based on their specific trading strategy requirements. The indicator focuses purely on trend strength measurement while removing directional noise from +DI/-DI lines for cleaner analysis.
HOW IT WORKS
The ADX calculation uses the standard Welles Wilder formula:
• Calculates True Range and Directional Movement
• Smooths the values using the specified periods
• Applies additional smoothing to create the final ADX value
• Compares this value against your custom limit line
KEY FEATURES
🎯 Customizable Limit Line: Set your own threshold level (default: 20)
📊 Clean Visual Design: Focus on trend strength without directional confusion
📏 Reference Lines: Additional levels at 25 (weak trend) and 50 (strong trend)
🟢 Background Highlighting: Green background when ADX exceeds your limit
🔔 Multiple Alert Types: Notifications for limit crossovers and trend changes
⚙️ Flexible Parameters: Adjust DI Length and ADX Smoothing periods
SETTINGS EXPLANATION
DI Length (14): Period used for calculating +DI and -DI components
ADX Smoothing (14): Additional smoothing applied to the ADX calculation
Limit Line (20): Your custom threshold - adjust based on your strategy
Background Highlight: Toggle visual emphasis on/off
INTERPRETATION GUIDE
ADX < 20: Weak or absent trend - market may be ranging
ADX 20-25: Trend is developing but still weak
ADX 25-40: Moderate trend strength - consider trend-following strategies
ADX 40-50: Strong trend present - high-probability trend trades
ADX > 50: Very strong trend - momentum strategies may be effective
WHY THIS APPROACH?
This simplified version eliminates +DI/-DI lines to focus exclusively on trend STRENGTH rather than direction. This approach helps traders:
✓ Identify when trends are strong enough to trade
✓ Avoid choppy, sideways markets that can cause whipsaws
✓ Set objective criteria for trend-based strategy entry/exit
✓ Learn trend analysis without directional bias
ALERT SYSTEM
The indicator includes four distinct alert conditions:
1. ADX Above Custom Limit: When ADX crosses above your threshold
2. ADX Below Custom Limit: When ADX falls below your threshold
3. Strong Trend Formation: When ADX exceeds 40 (strong trend alert)
4. Weak Trend Warning: When ADX drops below 20 (ranging market alert)
EDUCATIONAL VALUE
This indicator serves as an excellent learning tool for understanding:
• How trend strength differs from trend direction
• The relationship between ADX values and market conditions
• Custom threshold optimization for different timeframes and instruments
• The importance of trend strength in trading system development
USAGE RECOMMENDATIONS
Combine with price action: Use ADX to confirm trend strength, not as standalone signals
Timeframe considerations: Higher timeframes typically show more reliable ADX readings
Market adaptation: Adjust your custom limit based on instrument volatility
Risk management: Always implement proper position sizing and stop losses
Paper trading: Test your custom limit settings before live trading
TECHNICAL LIMITATIONS
⚠️ ADX is a lagging indicator based on historical price data
⚠️ Strong ADX readings can persist during trend exhaustion phases
⚠️ No indicator provides 100% accurate signals
⚠️ Market conditions can change rapidly regardless of ADX readings
⚠️ Should be used as part of a comprehensive trading strategy
═════════════════════════════════════════════════════════════
⚠️⚠️ IMPORTANT DISCLAIMER ⚠️⚠️
This indicator is provided for EDUCATIONAL PURPOSES ONLY and should NOT be considered as financial or investment advice.
RISK WARNING:
• Past performance does not guarantee future results
• All trading involves substantial risk of loss
• No indicator can predict future market movements with certainty
• Always use appropriate risk management techniques
• Never risk more capital than you can afford to lose completely
• Consider seeking advice from qualified financial professionals
RESPONSIBLE USAGE:
• This tool is designed for learning trend analysis concepts
• Use paper trading to understand the indicator's behavior
• Combine with fundamental analysis and market knowledge
• Implement proper risk management in all trading activities
• Remember that successful trading requires more than technical indicators
By using this indicator, you acknowledge understanding these risks and accept full responsibility for your trading decisions.
═════════════════════════════════════════════════════════════
Educational tool for trend strength analysis - Trade responsibly and never stop learning!
FibLevel Size CalculatorThis skript calculates position sizes and new take profits for sizing into an long or short position with 3 entrys defined at custom fibonacci retracement levels.
TP: -0,272
Entry1: 0.382
Entry2: 0.618
Entry3: 0.83
SL: 1.05
Expected RR per trade is 0.2 with a High Win rate definitly profitable.
Search for an established trend on the higher timeframe, drop to the smaller ones and look for correction waves. Once they break to the trenddirection of the higher timeframe take the fib from lowest to highes point. Draw a fib level on the chart and use the Indicator to define these Levels above. The calculator gives you the Margin to use in each position, and will check that you will not get liquidated an that you have enough margin. It tells you the new TP for Limit2 and Limit3 if they get hit so you can get out of the trade full TP with a small bounce.
Inputs:
Account Balance, Risk Percentage, and Leverage: These inputs are used to calculate the position size and risk.
Entry 1, Entry 2, Entry 3, Take Profit (TP), and Stop Loss (SL): These prices are used for calculating position sizes, risk, and profit for up to three entry points.
Calculations:
Risk Amount: Calculated based on the account balance and risk percentage.
Position Sizes (Qty): For each entry point, the position size is determined. The second and third entries have a multiplier (3x for Entry 2, 5x for Entry 3) compared to the first.
Stop Loss and Profit Calculation: The script calculates the potential profit and adjusts the TP levels based on the average entries for Limit 2 and Limit 3.
Margin Calculation: Margin requirements for each position are calculated based on leverage.
Output:
Table Display: A table shows key values like entry prices, position sizes, TP levels, potential profit, and margin requirements for each limit.
Warnings: It includes a liquidation warning and a check for whether the account is at risk of liquidation based on leverage.
Position Type: It automatically detects if the trade is a long or short based on the relationship between TP and SL.
Visualization:
Lines: It draws horizontal lines on the chart to visually represent the entry, TP, and SL levels.
Overall, this script is designed to help traders manage risk and calculate position sizes for multi-level entries using leverage.
Pls drop feedback in the comments.
Nef33 Forex & Crypto Trading Signals PRO
1. Understanding the Indicator's Context
The indicator generates signals based on confluence (trend, volume, key zones, etc.), but it does not include predefined SL or TP levels. To establish them, we must:
Use dynamic or static support/resistance levels already present in the script.
Incorporate volatility (such as ATR) to adjust the levels based on market conditions.
Define a risk/reward ratio (e.g., 1:2).
2. Options for Determining SL and TP
Below, I provide several ideas based on the tools available in the script:
Stop Loss (SL)
The SL should protect you from adverse movements. You can base it on:
ATR (Volatility): Use the smoothed ATR (atr_smooth) multiplied by a factor (e.g., 1.5 or 2) to set a dynamic SL.
Buy: SL = Entry Price - (atr_smooth * atr_mult).
Sell: SL = Entry Price + (atr_smooth * atr_mult).
Key Zones: Place the SL below a support (for buys) or above a resistance (for sells), using Order Blocks, Fair Value Gaps, or Liquidity Zones.
Buy: SL below the nearest ob_lows or fvg_lows.
Sell: SL above the nearest ob_highs or fvg_highs.
VWAP: Use the daily VWAP (vwap_day) as a critical level.
Buy: SL below vwap_day.
Sell: SL above vwap_day.
Take Profit (TP)
The TP should maximize profits. You can base it on:
Risk/Reward Ratio: Multiply the SL distance by a factor (e.g., 2 or 3).
Buy: TP = Entry Price + (SL Distance * 2).
Sell: TP = Entry Price - (SL Distance * 2).
Key Zones: Target the next resistance (for buys) or support (for sells).
Buy: TP at the next ob_highs, fvg_highs, or liq_zone_high.
Sell: TP at the next ob_lows, fvg_lows, or liq_zone_low.
Ichimoku: Use the cloud levels (Senkou Span A/B) as targets.
Buy: TP at senkou_span_a or senkou_span_b (whichever is higher).
Sell: TP at senkou_span_a or senkou_span_b (whichever is lower).
3. Practical Implementation
Since the script does not automatically draw SL/TP, you can:
Calculate them manually: Observe the chart and use the levels mentioned.
Modify the code: Add SL/TP as labels (label.new) at the moment of the signal.
Here’s an example of how to modify the code to display SL and TP based on ATR with a 1:2 risk/reward ratio:
Modified Code (Signals Section)
Find the lines where the signals (trade_buy and trade_sell) are generated and add the following:
pinescript
// Calculate SL and TP based on ATR
atr_sl_mult = 1.5 // Multiplier for SL
atr_tp_mult = 3.0 // Multiplier for TP (1:2 ratio)
sl_distance = atr_smooth * atr_sl_mult
tp_distance = atr_smooth * atr_tp_mult
if trade_buy
entry_price = close
sl_price = entry_price - sl_distance
tp_price = entry_price + tp_distance
label.new(bar_index, low, "Buy: " + str.tostring(math.round(bull_conditions, 1)), color=color.green, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_up, size=size.tiny)
if trade_sell
entry_price = close
sl_price = entry_price + sl_distance
tp_price = entry_price - tp_distance
label.new(bar_index, high, "Sell: " + str.tostring(math.round(bear_conditions, 1)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_down, size=size.tiny)
Code Explanation
SL: Calculated by subtracting/adding sl_distance to the entry price (close) depending on whether it’s a buy or sell.
TP: Calculated with a double distance (tp_distance) for a 1:2 risk/reward ratio.
Visualization: Labels are added to the chart to display SL (red) and TP (blue).
4. Practical Strategy Without Modifying the Code
If you don’t want to modify the script, follow these steps manually:
Entry: Take the trade_buy or trade_sell signal.
SL: Check the smoothed ATR (atr_smooth) on the chart or calculate a fixed level (e.g., 1.5 times the ATR). Also, review nearby key zones (OB, FVG, VWAP).
TP: Define a target based on the next key zone or multiply the SL distance by 2 or 3.
Example:
Buy at 100, ATR = 2.
SL = 100 - (2 * 1.5) = 97.
TP = 100 + (2 * 3) = 106.
5. Recommendations
Test in Demo: Apply this logic in a demo account to adjust the multipliers (atr_sl_mult, atr_tp_mult) based on the market (forex or crypto).
Combine with Zones: If the ATR-based SL is too wide, use the nearest OB or FVG as a reference.
Risk/Reward Ratio: Adjust the TP based on your tolerance (1:1, 1:2, 1:3)
Dave Trading Indicator (with Arrows)//@version=5
indicator("A1 SMC Clean Entry (Arrows + SL/TP) - Publishable", overlay=true,
max_labels_count=500, max_lines_count=500, max_boxes_count=200)
// === USER SETTINGS ===
rsiLength = input.int(14, "RSI Length")
slATRMult = input.float(1.5, "Stop Loss (ATR Multiplier)", step=0.1)
tpRR = input.float(2.0, "Take Profit (R:R)", step=0.1)
htfEMA = input.int(200, "Trend EMA (filter)", minval=1)
lookbackHigh = input.int(20, "Liquidity High Lookback")
lookbackLow = input.int(20, "Liquidity Low Lookback")
obLookback = input.int(8, "Order Block Lookback")
keepOnlyLast = input.bool(true, "Keep only latest drawings", tooltip="Deletes previous label/box/lines when a new signal appears")
// === INDICATORS / FILTERS ===
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(14)
trendEMA = ta.ema(close, htfEMA)
// === LIQUIDITY SWEEP LOGIC ===
// A "grab" means price briefly sweeps the recent extreme then closes back beyond it
liqHigh = ta.highest(high, lookbackHigh)
liqLow = ta.lowest(low, lookbackLow)
grabHigh = high > liqHigh and close < liqHigh // stop-hunt above recent highs
grabLow = low < liqLow and close > liqLow // stop-hunt below recent lows
// === CORE ENTRY RULES ===
// Multi-confirmation: liquidity sweep + RSI + EMA trend
longCondition = grabLow and rsi > 50 and close > trendEMA
shortCondition = grabHigh and rsi < 50 and close < trendEMA
// === GLOBAL ARROWS (must be in global scope) ===
plotshape(longCondition, title="BUY Arrow", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.large, text="BUY")
plotshape(shortCondition, title="SELL Arrow", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.large, text="SELL")
// === ALERTS ===
alertcondition(longCondition, title="BUY setup", message="{{ticker}} BUY setup")
alertcondition(shortCondition, title="SELL setup", message="{{ticker}} SELL setup")
// === OBJECT MANAGEMENT: keep only last drawings if enabled ===
var label lastLabel = na
var line lastSL = na
var line lastTP = na
var box lastBox = na
f_delete_prev() =>
if not na(lastLabel)
label.delete(lastLabel)
lastLabel := na
if not na(lastSL)
line.delete(lastSL)
lastSL := na
if not na(lastTP)
line.delete(lastTP)
lastTP := na
if not na(lastBox)
box.delete(lastBox)
lastBox := na
// === WHEN LONG TRIGGERS ===
if longCondition
if keepOnlyLast
f_delete_prev()
entryPrice = close
stopLoss = entryPrice - atr * slATRMult
takeProfit = entryPrice + (entryPrice - stopLoss) * tpRR
// Label (entry)
lastLabel := label.new(bar_index, entryPrice, text="BUY", style=label.style_label_up, color=color.green, textcolor=color.white, size=size.small)
// SL and TP lines (extend a few bars to the right)
lastSL := line.new(bar_index, stopLoss, bar_index + 20, stopLoss, color=color.red, style=line.style_dashed, width=1)
lastTP := line.new(bar_index, takeProfit, bar_index + 20, takeProfit, color=color.green, style=line.style_dashed, width=1)
// Order Block (approx): use last bearish range before move up
bearOB_top = ta.highest(high, obLookback)
bearOB_bot = ta.lowest(low, obLookback)
// draw a box that covers last obLookback candles and spans bot..top
lastBox := box.new(bar_index - obLookback, bearOB_top, bar_index, bearOB_bot, bgcolor=color.new(color.green, 85), border_color=color.green)
// === WHEN SHORT TRIGGERS ===
if shortCondition
if keepOnlyLast
f_delete_prev()
entryPrice = close
stopLoss = entryPrice + atr * slATRMult
takeProfit = entryPrice - (stopLoss - entryPrice) * tpRR
// Label (entry)
lastLabel := label.new(bar_index, entryPrice, text="SELL", style=label.style_label_down, color=color.red, textcolor=color.white, size=size.small)
// SL and TP lines
lastSL := line.new(bar_index, stopLoss, bar_index + 20, stopLoss, color=color.red, style=line.style_dashed, width=1)
lastTP := line.new(bar_index, takeProfit, bar_index + 20, takeProfit, color=color.green, style=line.style_dashed, width=1)
// Order Block (approx): last bullish range before move down
bullOB_top = ta.highest(high, obLookback)
bullOB_bot = ta.lowest(low, obLookback)
lastBox := box.new(bar_index - obLookback, bullOB_top, bar_index, bullOB_bot, bgcolor=color.new(color.red, 85), border_color=color.red)
// === OPTIONAL DEBUG PLOTS (comment out if you don't want them) ===
// plot(rsi, title="RSI", color=color.orange) // off by default to keep chart clean
// plot(trendEMA, title="EMA200", color=color.blue)
// keep indicator valid even if nothing plotted
plot(na)
DLC INDICATOR//@version=5
indicator("A1 SMC Day Trading Indicator (OB + Liquidity Grab)", overlay=true, max_lines_count=500, max_labels_count=500)
// === INPUTS ===
rsiLength = input.int(14, "RSI Length")
slATRMult = input.float(1.5, "Stop Loss (ATR Multiplier)")
tpRR = input.float(2.0, "Take Profit (Risk/Reward)")
htfEMA = input.int(200, "Trend EMA (Filter)")
lookbackHigh = input.int(20, "Liquidity High Lookback")
lookbackLow = input.int(20, "Liquidity Low Lookback")
obLookback = input.int(10, "Order Block Lookback")
// === INDICATORS ===
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(14)
trendEMA = ta.ema(close, htfEMA) // only as filter
// === ORDER BLOCK DETECTION ===
bullOB = ta.lowest(low, obLookback)
bearOB = ta.highest(high, obLookback)
// === LIQUIDITY SWEEPS ===
liqHigh = ta.highest(high, lookbackHigh)
liqLow = ta.lowest(low, lookbackLow)
grabHigh = high > liqHigh and close < liqHigh // stop hunt above highs
grabLow = low < liqLow and close > liqLow // stop hunt below lows
// === ENTRY CONDITIONS ===
longCondition = grabLow and rsi > 50 and close > trendEMA
shortCondition = grabHigh and rsi < 50 and close < trendEMA
// === VARIABLES ===
var float entryPrice = na
var float stopLoss = na
var float takeProfit = na
// === LONG ENTRY ===
if (longCondition)
entryPrice := close
stopLoss := entryPrice - atr * slATRMult
takeProfit := entryPrice + (entryPrice - stopLoss) * tpRR
// Label
label.new(bar_index, entryPrice, "BUY (SMC) ✅",
style=label.style_label_up, color=color.green, textcolor=color.white, size=size.normal)
// SL / TP lines
line.new(bar_index, stopLoss, bar_index+10, stopLoss, color=color.red, style=line.style_dashed)
line.new(bar_index, takeProfit, bar_index+10, takeProfit, color=color.green, style=line.style_dashed)
// Highlight Order Block
box.new(bar_index-obLookback, bullOB, bar_index, entryPrice, bgcolor=color.new(color.green, 85), border_color=color.green)
// === SHORT ENTRY ===
if (shortCondition)
entryPrice := close
stopLoss := entryPrice + atr * slATRMult
takeProfit := entryPrice - (stopLoss - entryPrice) * tpRR
// Label
label.new(bar_index, entryPrice, "SELL (SMC) ✅",
style=label.style_label_down, color=color.red, textcolor=color.white, size=size.normal)
// SL / TP lines
line.new(bar_index, stopLoss, bar_index+10, stopLoss, color=color.red, style=line.style_dashed)
line.new(bar_index, takeProfit, bar_index+10, takeProfit, color=color.green, style=line.style_dashed)
// Highlight Order Block
box.new(bar_index-obLookback, entryPrice, bar_index, bearOB, bgcolor=color.new(color.red, 85), border_color=color.red)
AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)Below is a fully self-contained, English-language description of every input, function, and logical block inside the “AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)” indicator. You can copy and paste this into TradingView’s “Description” field when you publish, without exposing any Pine code.
---
## Indicator Name and Purpose
**Name (Short Title):**
AI Strat Adaptive v3 (NoRepaint)
**Overview:**
This indicator combines multiple technical tools—RSI, EMA, ATR (with a dynamic multiplier), ADX/DI, and an “AI‐style” scoring mechanism—to generate trend-filtered and reversal signals. It also optionally confirms signals on a higher timeframe, dynamically adjusts its sensitivity based on volatility, and plots intrabar stop‐loss (SL) and take‐profit (TP) levels derived from ATR. Special care has been taken to ensure that no signals “repaint” (i.e., once drawn on a closed bar, they never disappear or shift).
---
## 1. Main Inputs
All of the inputs appear in the Settings dialog for the published indicator. Below is a detailed explanation of each input, grouped by logical category.
### A. RSI & EMA Base Parameters
1. **RSI Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars used to calculate the Relative Strength Index (RSI). A shorter RSI reacts more quickly to price changes; a longer RSI is smoother.
2. **RSI Overbought Threshold**
* **Input type:** Integer (default 60)
* **Description:** If the RSI value rises above this level, it contributes a “sell” signal component. You can adjust this (e.g., 70) to make your system more conservative.
3. **RSI Oversold Threshold**
* **Input type:** Integer (default 40)
* **Description:** If the RSI falls below this level, it contributes a “buy” signal component. Raising this threshold (e.g., 50) makes the strategy more aggressive in seeking reversals.
4. **EMA Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** Number of bars for the Exponential Moving Average (EMA). A shorter EMA will produce more frequent crossovers, a longer EMA is smoother.
### B. ATR & Volatility Filter Parameters
5. **ATR Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars to calculate Average True Range (ATR). The ATR is used both for measuring volatility and for dynamic SL/TP levels.
6. **ATR SMA Length**
* **Input type:** Integer (default 50)
* **Description:** Number of bars to compute a Simple Moving Average of the ATR itself. This gives a baseline of “normal” volatility. If ATR rises significantly above this SMA, the indicator treats the market as “high volatility.”
7. **ATR Multiplier Base**
* **Input type:** Float (default 1.2, step 0.1)
* **Description:** Base multiplier for ATR when filtering for volatility. The actual threshold is computed as `ATR_SMA × (ATR_Multiplier Base) × sqrt(current_ATR / ATR_SMA)`. In other words, the multiplier becomes larger if volatility is rising, and smaller if volatility is falling.
8. **Disable Volatility Filter**
* **Input type:** Boolean (default false)
* **Description:** If enabled (true), the indicator will ignore any volatility‐based filtering, using signals regardless of ATR behavior. If disabled (false), signals only fire when ATR > (ATR\_SMA × dynamic multiplier).
### C. Price-Change & “AI Score” Parameters
9. **Price Change Period (bars)**
* **Input type:** Integer (default 3)
* **Description:** The number of bars back to measure percentage price change. Used to ensure that a “trend” signal is accompanied by a sufficiently positive (for longs) or negative (for shorts) price movement over this many bars.
10. **Base AI Score Threshold**
* **Input type:** Float (default 0.1)
* **Description:** The indicator computes a composite “AI-style” score by combining the RSI signal (overbought/oversold) and an EMA crossover signal. Only if the absolute value of that composite score exceeds this threshold will a trend signal be eligible. Raising it makes signals rarer but (potentially) higher-conviction.
### D. SMA “ICT” Trend Filter Parameters
11. **ICT SMA Long Length (Base)**
* **Input type:** Integer (default 50)
* **Description:** Number of bars for the “long” Simple Moving Average (SMA) used in the internal trend filter. Typically, price must be above this SMA (and ADX must be strong) to confirm an uptrend, or below it (and ADX strong) to confirm a downtrend.
12. **ICT SMA Short1 Length (Base)**
* **Input type:** Integer (default 10)
* **Description:** Secondary “fast” SMA used both for reversal logic (e.g., price crossing above it can count as a bullish reversal) and part of the internal trend confirmation.
13. **ICT SMA Short2 Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** A second “medium” SMA used for reversal triggers (e.g., crossovers or crossunders alongside RSI conditions).
### E. ADX & DI Parameters
14. **Base ADX Length**
* **Input type:** Integer (default 14)
* **Description:** Number of bars for the ADX (Average Directional Index) moving averages, which measure trend strength. The same length is used for +DI and –DI smoothing.
15. **Base ADX Threshold**
* **Input type:** Float (default 25.0, step 0.5)
* **Description:** If ADX > this threshold and +DI > –DI, we consider an uptrend; if ADX > this threshold and –DI > +DI, we consider a downtrend. Raising this value demands stronger trends to qualify.
### F. Sensitivity & Cooldown
16. **Sensitivity (0–1)**
* **Input type:** Float between 0.0 and 1.0 (default 0.5)
* **Description:** A general “mixture” parameter used internally to weight how aggressively the indicator leans into trend versus reversal. In practice, the code uses it to fine-tune exact thresholds for switching between trend and reversal conditions. You can leave it at 0.5 unless you want to bias more heavily toward either regime.
17. **Base Cooldown Bars Between Signals**
* **Input type:** Integer (default 5, min 0)
* **Description:** Once a long or short signal fires, the indicator will wait at least this many bars before allowing a new signal in the same direction. Prevents “signal flipping” on each bar. A higher number forces fewer, more spaced-out entries.
18. **Trend Confirmation Bars**
* **Input type:** Integer (default 3, min 1)
* **Description:** After the directional filters (+DI/–DI cross, price vs. SMA), the indicator still requires that price remains on the same side of the long SMA for at least this many consecutive bars before confirming “trend up” or “trend down.” Larger values smooth out false breakouts but may lag signals.
### G. Higher Timeframe Confirmation
19. **Use Higher Timeframe Confirmation**
* **Input type:** Boolean (default true)
* **Description:** If true, the indicator will request a block of values (SMA, +DI, –DI, ADX) from a higher timeframe (default 60 minutes) and require that the higher timeframe is also in agreement (strong uptrend or strong downtrend) before confirming your current-timeframe trend. This helps filter out lower-timeframe noise.
20. **Higher Timeframe (TF) for Confirmation**
* **Input type:** Timeframe (default “60”)
* **Description:** The chart timeframe (e.g., 5, 15, 60 minutes) whose trend conditions must also be true. It’s sent through a `request.security(..., lookahead=barmerge.lookahead_off)` call so that it never “paints ahead.”
### H. Dynamic TP/SL Parameters
21. **TP as ATR Multiple**
* **Input type:** Float (default 2.0, step 0.1)
* **Description:** When a trade is open, the “take-profit” price is determined by looking at the highest high (for longs) or lowest low (for shorts) observed since entry, and then plotting a cross (“X”) at that level when the trend finally flips. This is purely for display. However, separate from that, this parameter can be adapted if you want a strictly ATR–based TP. In the “Minimal” version, TP is ≈ (highest high) once trend inverts, but you could rewrite it to use `entry_price + ATR×TP_Multiplier`.
22. **SL as ATR Multiple**
* **Input type:** Float (default 1.0, step 0.1)
* **Description:** While in a trade, a trailing SL line is plotted each bar. Its value is always `entry_price ± (ATR × SL_Multiplier)`. When the trend inverts, the SL no longer updates, and you see it on the chart.
### I. Display and Mode Options
23. **Show Debug Lines**
* **Input type:** Boolean (default true)
* **Description:** When enabled, the indicator will plot all intermediate lines—ATR SMA, ATR Threshold, +DI, –DI, ADX (current and HTF), HTF SMA, etc.—so that you can diagnose exactly what’s happening. Turn this off to hide all debug information and only see entry/exit shapes.
24. **Enable Scalping Mode**
* **Input type:** Boolean (default false)
* **Description:** If true, many of the “base” parameters are halved (e.g., RSI length becomes 7 instead of 14, ATR length becomes 7 instead of 14, ADX length becomes 7, etc.), and the ADX threshold is multiplied by 0.8. This makes all oscillators and moving averages more reactive, suited for very short-term (scalping) setups.
---
## 2. Core Calculation Blocks
Below is a high-level description of each logical block (in code order), translated from Pine into conceptual steps.
### A. Adjust Inputs if “Scalping Mode” Is On
If **Scalping Mode** = true, then:
* `RSI_Length` becomes `max(1, round(Base_RSI_Length / 2))`
* `EMA_Length` becomes `max(1, round(Base_EMA_Length / 2))`
* `ATR_Length` becomes `max(1, round(Base_ATR_Length / 2))`
* `Price_Change_Period` becomes `max(1, round(Base_Price_Change_Period / 2))`
* `SMA_Long_Length`, `SMA_Short1_Length`, and `SMA_Short2_Length` are each halved (minimum 1).
* `ADX_Length` = `max(1, round(Base_ADX_Length / 2))`
* `ADX_Threshold` = `Base_ADX_Threshold × 0.8`
* `Cooldown_Bars` = `max(0, round(Base_Cooldown_Bars / 2))`
Otherwise, all adjusted lengths = their base values.
### B. RSI, EMA & “AI Score” on Current Timeframe
1. **Compute RSI:**
* Uses the (possibly adjusted) `RSI_Length`.
* Denote this as `RSI_Value`.
2. **Compute ATR & Its SMA:**
* `ATR_Value` = `ta.atr(ATR_Length)`.
* `ATR_SMA` = `ta.sma(ATR_Value, ATR_SMA_Length)`.
* Then define `Volatility_Increase` = (`ATR_Value > ATR_SMA`).
* If the volatility has increased, the weighting of RSI vs. EMA changes.
3. **Compute Weights:**
* If `Volatility_Increase == true`, then:
* `RSI_Weight = 0.7`
* `EMA_Weight = 0.3`
* Otherwise:
* `RSI_Weight = 0.3`
* `EMA_Weight = 0.7`
4. **RSI Signal Component (`RSI_Sig`):**
* If `RSI_Value > RSI_Overbought`, then `RSI_Sig = –1`.
* Else if `RSI_Value < RSI_Oversold`, then `RSI_Sig = +1`.
* Otherwise, `RSI_Sig = 0`.
5. **EMA Value & Signal Component (`EMA_Sig`):**
* `EMA_Value` = `ta.ema(close, EMA_Length)`.
* `EMA_Sig = +1` if the current close crosses **above** the EMA; `EMA_Sig = –1` if the current close crosses **below** the EMA; else `0`.
6. **Compute Raw “AI Score”:**
$$
Raw\_AI = (RSI\_Sig \times RSI\_Weight)\;+\;(EMA\_Sig \times EMA\_Weight)
$$
Then,
$$
AI\_Score = \frac{Raw\_AI}{(RSI\_Weight + EMA\_Weight)}
$$
(This normalization ensures the score always ranges between –1 and +1 if both weights sum to 1.)
### C. Dynamic ATR Multiplier & Volatility Filter
1. **Volatility Factor:**
$$
Volatility\_Factor = \frac{ATR\_Value}{ATR\_SMA}
$$
2. **Dynamic ATR Multiplier:**
$$
ATR\_Multiplier = ATR\_Multiplier\_Base \times \sqrt{Volatility\_Factor}
$$
3. **High Volatility Condition (`High_Volatility`):**
* If `Disable_Volatility_Filter == true`, then treat `High_Volatility = true` always.
* Else, `High_Volatility = (ATR_Value > ATR_SMA × ATR_Multiplier)`.
### D. Price Change Percentage
* **Compute Price Change:**
$$
Price\_Change = \frac{(Close - Close )}{Close } \times 100
$$
* This is the percent return from `Price_Change_Period` bars ago to now.
* For a valid long‐trend signal, we require `Price_Change > 0`; for a short trend, `Price_Change < 0`.
### E. Local SMAs for Trend/Reversal Filters
* `SMA_Close_Long` = `ta.sma(close, SMA_Long_Length)`.
* `SMA_Close_Short1` = `ta.sma(close, SMA_Short1_Length)`.
* `SMA_Close_Short2` = `ta.sma(close, SMA_Short2_Length)`.
These three SMAs help define the “local trend” and reversal breakout points:
* **Primary Trend Filter:**
* Price must be above `SMA_Close_Long` for an uptrend filter, or below `SMA_Close_Long` for a downtrend filter.
* **Reversal Filter:**
* A bullish reversal is detected if **(RSI < Oversold AND close crosses above EMA)** OR **(RSI < Oversold AND close crosses above SMA\_Close\_Short1)**.
* A bearish reversal is detected if **(RSI > Overbought AND close crosses below EMA)** OR **(RSI > Overbought AND close crosses below SMA\_Close\_Short1)**.
### F. Manual +DI, –DI & ADX on Current Timeframe
Instead of relying on the built-in `ta.adx`, the script calculates DI and ADX manually. This makes it easier to replicate the exact logic on a higher timeframe via `request.security`. The steps are:
1. **Directional Movement (DM) Components:**
* `Up_Move` = `high – high `
* `Down_Move` = `low – low`
* `Plus_DM` = `Up_Move` if (`Up_Move > Down_Move` AND `Up_Move > 0`), else `0`
* `Minus_DM` = `Down_Move` if (`Down_Move > Up_Move` AND `Down_Move > 0`), else `0`
2. **True Range (TR) Components:**
* `TR1` = `high – low`
* `TR2` = `abs(high – close )`
* `TR3` = `abs(low – close )`
* `True_Range` = `max(TR1, TR2, TR3)`
3. **Smoothed Averages (RMA):**
* `Sm_TR` = `ta.rma(True_Range, ADX_Length)`
* `Sm_Plus` = `ta.rma(Plus_DM, ADX_Length)`
* `Sm_Minus`= `ta.rma(Minus_DM, ADX_Length)`
4. **Compute DI%:**
$$
Plus\_DI = \frac{Sm\_Plus}{Sm\_TR} \times 100,\quad
Minus\_DI = \frac{Sm\_Minus}{Sm\_TR} \times 100
$$
5. **DX and ADX:**
$$
DX = \frac{|Plus\_DI - Minus\_DI|}{Plus\_DI + Minus\_DI} \times 100,\quad
ADX = ta.rma(DX, ADX_Length)
$$
These values are referred to as `(plus_di, minus_di, adx_val)` for the current timeframe.
---
## 3. Higher Timeframe (HTF) Confirmation Function
If **Use Higher Timeframe Confirmation** is enabled, the script calls a single helper (Pine) function `f_htf` with two parameters: the ADX length and the SMA length (both taken from the “base” or “scaled” values). Internally, `f_htf` simply reruns the manual DI/ADX logic (same as above) on the higher timeframe’s bar data, and also includes that timeframe’s closing price and its SMA for trend comparison.
* **Request.Security Call:**
```
= request.security(
syminfo.tickerid,
higher_tf,
f_htf(adx_length, sma_long_len),
lookahead=barmerge.lookahead_off
)
```
* `lookahead=barmerge.lookahead_off` ensures that no HTF value “paints” early; you always see only confirmed HTF bars.
* The returned tuple provides:
1. `ht_close` = HTF closing price
2. `ht_sma` = HTF SMA of length `sma_long_len`
3. `ht_pdi` = HTF +DI percentage
4. `ht_mdi` = HTF –DI percentage
5. `ht_adx` = HTF ADX value
---
## 4. Trend & Reversal Filters (Current & HTF)
### A. Current-Timeframe Trend Filter
1. **Uptrend\_Basic (Current TF)**
$$
(plus\_di > minus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close > SMA\_Close\_Long)
$$
2. **Downtrend\_Basic (Current TF)**
$$
(minus\_di > plus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close < SMA\_Close\_Long)
$$
3. **Trend Confirmation by Bars:**
* `Bars_Since_Below` = number of bars since `close <= SMA_Close_Long`.
* `Bars_Since_Above` = number of bars since `close >= SMA_Close_Long`.
* If `Uptrend_Basic == true` AND `Bars_Since_Below ≥ Trend_Confirmation_Bars` → mark `Uptrend_Confirm = true`.
* If `Downtrend_Basic == true` AND `Bars_Since_Above ≥ Trend_Confirmation_Bars` → mark `Downtrend_Confirm = true`.
### B. Reversal Filters (Current TF)
1. **Bullish Reversal (`Rev_Bullish`):**
* If `(RSI < RSI_Oversold AND close crosses above EMA_Value)` OR
`(RSI < RSI_Oversold AND close crosses above SMA_Close_Short1)`
→ then `Rev_Bullish = true`.
2. **Bearish Reversal (`Rev_Bearish`):**
* If `(RSI > RSI_Overbought AND close crosses below EMA_Value)` OR
`(RSI > RSI_Overbought AND close crosses below SMA_Close_Short1)`
→ then `Rev_Bearish = true`.
### C. Higher-Timeframe Trend Filter (HTF)
1. **HTF Uptrend (`HT_Uptrend`):**
$$
(ht\_pdi > ht\_mdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close > ht\_sma)
$$
2. **HTF Downtrend (`HT_Downtrend`):**
$$
(ht\_mdi > ht\_pdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close < ht\_sma)
$$
3. **Combine Current & HTF:**
* If **Use\_HTF\_Confirmation == true**, then:
* `Uptrend_Confirm := Uptrend_Confirm AND HT_Uptrend`
* `Downtrend_Confirm := Downtrend_Confirm AND HT_Downtrend`
* Otherwise, just use the current timeframe’s `Uptrend_Confirm` and `Downtrend_Confirm`.
4. **Define `CurrentTrend` (Integer):**
* `CurrentTrend = +1` if `Uptrend_Confirm == true`.
* `CurrentTrend = –1` if `Downtrend_Confirm == true`.
* Otherwise, `CurrentTrend = 0`.
5. **Reset “One Trade Per Trend”:**
* There is a persistent variable `LastTradeTrend`.
* Every time `CurrentTrend` flips (i.e., `CurrentTrend != CurrentTrend `), the code sets `LastTradeTrend := 0`.
* That allows one new entry once the detected trend has changed.
---
## 5. One‐Time “Cooldown” Logic
* **`LastSignalBar`**
* A persistent integer (initially undefined).
* After each confirmed long or short entry, `LastSignalBar` is set to the bar index where that signal fired.
* **`Bars_Since_Signal`**
* If `LastSignalBar` is undefined, treat as a very large number (so that initial signals are always allowed).
* Otherwise, `Bars_Since_Signal = bar_index – LastSignalBar`.
* **Cooldown Check:**
* A new long (or short) can only be generated if `(Bars_Since_Signal > Signal_Cooldown)`.
* This prevents multiple signals in rapid succession.
---
## 6. Entry Conditions (No Repaint)
All of the conditions below are calculated “intrabar,” but the script only actually registers a **signal** on **bar close** (`barstate.isconfirmed`) so that signals never repaint.
### A. Trend‐Based “Raw” Conditions
1. **Trend\_Long\_Raw:**
$$
(AI\_Score > AI\_Score\_Threshold)\;\land\;Uptrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change > 0)
$$
2. **Trend\_Short\_Raw:**
$$
(AI\_Score < -AI\_Score\_Threshold)\;\land\;Downtrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change < 0)
$$
### B. Reversal “Raw” Conditions
1. **Rev\_Long\_Raw:**
$$
Rev\_Bullish\;\land\;(CurrentTrend \neq +1)
$$
2. **Rev\_Short\_Raw:**
$$
Rev\_Bearish\;\land\;(CurrentTrend \neq -1)
$$
### C. Combine Raw Signals
* `Raw_Long = Trend_Long_Raw OR Rev_Long_Raw`.
* `Raw_Short = Trend_Short_Raw OR Rev_Short_Raw`.
### D. Confirmed Long/Short Signal Flags
On each new bar **close** (`barstate.isconfirmed == true`):
* **Long\_Signal\_Confirmed** can fire if:
1. `Raw_Long == true`
2. `LastTradeTrend != +1` (we haven’t already taken a long in this same trend)
3. `Bars_Since_Signal > Signal_Cooldown`
If all three hold, then on this bar close the code sets:
* `Long_Signal = true`
* `LastTradeTrend := +1`
* `LastSignalBar := bar_index`
Otherwise, `Long_Signal := false` on this bar.
* **Short\_Signal\_Confirmed** works the same way but with `Raw_Short`, `LastTradeTrend != -1`, etc.
If triggered, it sets `Short_Signal = true`, `LastTradeTrend := -1`, and `LastSignalBar := bar_index`. Otherwise `Short_Signal := false`.
* **Important:** If the bar is still forming (`else` branch of `barstate.isconfirmed`), then both `Long_Signal` and `Short_Signal` are forced to `false`. This guarantees that no shape or alert appears until the bar actually closes.
---
## 7. Plotting Entry/Exit Shapes
1. **Trend Long Signal (Triangle Up)**
* Condition: `Long_Signal == true` **AND** `Trend_Long_Raw == true`.
* Appearance: A small, semi-transparent lime green triangle drawn **below** the bar.
2. **Trend Short Signal (Triangle Down)**
* Condition: `Short_Signal == true` **AND** `Trend_Short_Raw == true`.
* Appearance: A small, semi-transparent maroon triangle drawn **above** the bar.
3. **Reversal Long Signal (Circle)**
* Condition: `Long_Signal == true` **AND** `Rev_Long_Raw == true`.
* Appearance: A tiny, more transparent green circle drawn **below** the bar.
4. **Reversal Short Signal (Circle)**
* Condition: `Short_Signal == true` **AND** `Rev_Short_Raw == true`.
* Appearance: A tiny, more transparent red circle drawn **above** the bar.
Since `Long_Signal` and `Short_Signal` only ever become true at bar close, these shapes are never repainted or removed once drawn.
---
## 8. Unified Alert Message
* As soon as a new bar closes with either `Long_Signal` or `Short_Signal == true`, an alert message is sent:
* If `Long_Signal`, then `alert_msg = "action=BUY"`.
* If `Short_Signal`, then `alert_msg = "action=SELL"`.
* If neither, `alert_msg = ""` (no alert).
* The code calls `alert(alert_msg, freq=alert.freq_once_per_bar)` only if `barstate.isconfirmed` and `alert_msg` is non‐empty. This ensures exactly one alert per confirmed bar, no intrabar pops.
---
## 9. Dynamic TP/SL Logic (Minimal Implementation)
Once a long or short position is “open,” the script tracks these variables:
1. **Persistent Flags and Prices** (all persist between bars until reset):
* `InLong` (Boolean)
* `InShort` (Boolean)
* `Long_Max` (Float)
* `Short_Min` (Float)
* `Entry_Price` (Float)
2. **On Bar Close:**
* If `Long_Signal == true` →
* Set `InLong := true`,
* `Entry_Price := close` of that bar,
* `Long_Max := high ` (last bar’s high, so that we’re not using “future” data).
* If `Short_Signal == true` →
* Set `InShort := true`,
* `Entry_Price := close`,
* `Short_Min := low `.
3. **While `InLong == true`:**
* Continuously update `Long_Max = max(Long_Max, current high)` on each bar (intrabar, but finalized each close).
* Compute a dynamic SL:
$$
SL_{Long} = Entry\_Price - (ATR \times SL\_ATR\_Multiplier).
$$
* If **current trend** flips to non-uptrend (`CurrentTrend != +1`), mark `ExitLong = true`.
* Then the routine plots `TP_Long = Long_Max` as a cross (“X”) at that level.
* Set `InLong := false` so that no further changes to `Long_Max` or `Entry_Price` happen on future bars.
4. **While `InShort == true`:**
* Continuously update `Short_Min = min(Short_Min, current low)`.
* Compute a dynamic SL:
$$
SL_{Short} = Entry\_Price + (ATR \times SL\_ATR\_Multiplier).
$$
* If trend flips to non-downtrend (`CurrentTrend != –1`), mark `ExitShort = true`.
* Then the routine plots `TP_Short = Short_Min`.
* Set `InShort := false` to freeze those values.
5. **Plotting TP/SL if “Show Debug” is On:**
* **TP Shapes:**
* When `ExitLong == true`, plot a solid lime “X” at `TP_Long` (highest high).
* When `ExitShort == true`, plot a solid maroon “X” at `TP_Short` (lowest low).
* **SL Lines:**
* If still `InLong`, draw a thin red line at `SL_Long` on each bar.
* If still `InShort`, draw a thin green line at `SL_Short`.
Thus, your charts visually show the highest‐high take-profit cross for longs, the lowest-low take-profit cross for shorts, and a continuously updating trailing SL until the trend flips. Because all of this is triggered on confirmed bars, nothing “jumps around” after the fact.
---
## 10. Debug‐Only Plot Lines (When Enabled)
When **Show Debug Lines** = true, the indicator will also plot:
1. **ATR SMA (Orange):**
* The simple moving average of ATR over `ATR_SMA_Length`.
2. **ATR Threshold (Yellow):**
* `ATR_SMA × ATR_Multiplier` (the dynamically scaled threshold).
3. **+DI & –DI (Current TF):**
* +DI plotted as a green line, –DI plotted as a red line (opacity \~70%).
4. **ADX (Current TF, Blue):**
* A blue line for the present timeframe’s ADX.
5. **ADX Threshold (Gray):**
* A horizontal gray line showing `ADX_Threshold`.
6. **+DI & –DI (HTF, Darker Colors):**
* If HTF confirmation is on, “HTF +DI” is a greener but more transparent line; “HTF –DI” is a redder but more transparent line.
7. **ADX (HTF, Blue but Transparent):**
* HTF ADX plotted in blue (high transparency).
8. **HTF SMA (Orange, Transparent):**
* The higher timeframe’s SMA (same length as `SMA_Long_Length`), drawn in fainter orange.
9. **Volatility Zone Fill (Yellow Tinted Area):**
* Fills the area between `ATR_SMA` and `ATR_SMA × ATR_Multiplier`.
* Indicates “normal” versus “high‐volatility” regimes.
These debug lines are purely visual aids. Disable them if you want a cleaner chart.
---
## 11. Putting It All Together — Step-By-Step Flow
1. **Read Inputs** (RSI lengths, EMA length, ATR settings, etc.).
2. **Optionally Halve All Lengths** if “Scalping Mode” is checked.
3. **Calculate Current TF Indicators:**
* RSI, ATR, ATR\_SMA, EMA, price change, various SMAs, DI/ADX.
4. **Compute “AI Score”** (weighted sum of RSI and EMA signals).
5. **Compute Dynamic ATR Multiplier** and decide if “High Volatility” is true.
6. **Compute Raw Trend/Reversal Conditions** on the current timeframe (without triggering yet).
7. **Fetch HTF Values** in one `request.security` call (SMAs, DI/ADX).
8. **Combine Current & HTF Trend Filters** to confirm `Uptrend_Confirm` or `Downtrend_Confirm`.
9. **Check Reversal Conditions** (price crossing EMA or SMA short, in overbought/oversold zones).
10. **Enforce “One Trade Per Trend”** (clear `LastTradeTrend` whenever `CurrentTrend` flips).
11. **Enforce Cooldown** (must wait at least `Signal_Cooldown` bars since the prior signal).
12. **On Bar Close:**
* If `Raw_Long` AND not already in a long trend AND cooldown met, then fire `Long_Signal`.
* Else if `Raw_Short` AND not already in a short trend AND cooldown met, then fire `Short_Signal`.
* Otherwise, no new signal on this bar.
13. **Plot Long/Short Entry Shapes** according to whether it was a Trend signal or a Reversal signal.
14. **Send Alert** (“action=BUY” or “action=SELL”) exactly once per confirmed bar.
15. **If New Long/Short Signal, Set `InLong`/`InShort`, Record Entry Price, Initialize `Long_Max`/`Short_Min`.**
16. **While `InLong` is true:** Update `Long_Max = max(previous Long_Max, current high)`. Compute `SL_Long`. If the current trend flips (no longer uptrend), set `ExitLong = true`, plot a “TP X,” and close the position logic.
17. **While `InShort` is true:** Similarly update `Short_Min`, compute `SL_Short`, and if trend flips, set `ExitShort = true`, plot a “TP X,” and close the position logic.
18. **Optionally Display Debug Lines** (ATR SMA, ATR threshold, DI/ADX, HTF DI/ADX, etc.).
---
## 12. How to Use in TradingView Community
When you publish this indicator to the TradingView community—choosing “Protected” or “Invite-only” visibility—you can paste the above description into the “Description” field. Users will see exactly what each input does, how signals are generated, and what the various plotted lines represent, **without ever seeing the script source**. In this way, the code itself remains hidden but the logic is fully documented.
1. **Go to “Create New Indicator”** on TradingView.
2. **Paste Your Pine Code** (the full indicator script) in the Pine editor and save it.
3. **Set Visibility = Protected** (or Invite-only).
4. **In the “Description” Text Box, paste the entirety of this document** (steps 1–11).
5. **Click “Publish Script.”**
Users who view your indicator will see its name (“AI Strat Adaptive v3 (NoRepaint)”), a list of all inputs (with default values), and the detailed English description above. They can then load it on any chart, adjust inputs, and see the plotted signals, TP/SL lines, and optional debug overlays—without accessing the underlying Pine code.
---
### Summary of Key Points
* **RSI, EMA, ATR, DI/ADX, and “AI Score”** work together to define “trend vs. reversal.”
* **Dynamic volatility filter** uses ATR and ATR\_SMA to adapt the weighting of RSI vs. EMA and decide whether “volatility is high enough” to permit a trend trade.
* **One trade per detected trend** and a **cooldown period** prevent over‐trading.
* **Higher timeframe confirmation** (optional) further filters out noise.
* **No-repaint logic**:
* All signals only appear at bar close (`barstate.isconfirmed`).
* HTF values are fetched with `lookahead=barmerge.lookahead_off`.
* **Entry shapes** (triangles and circles) clearly mark trend vs. reversal entries.
* **Dynamic TP/SL**: highest‐high (or lowest‐low) since entry is used as TP, ATR×multiplier as SL.
* **Debug mode** (optional) shows every intermediate line for full transparency.
Use this description verbatim (or adapt it slightly for your personal style) when publishing. That way, your community sees exactly how each component works—inputs, functions, filters—while the Pine source code remains private.
ORB Dashboard for the TFLX Strategy# ORB Range/ATR Dashboard - Technical Indicator Description
## Main Function
This indicator analyzes Opening Range Breakout (ORB) patterns by calculating a defined time period and its relation to historical volatility. The indicator combines multiple technical analysis methods and presents results in a configurable dashboard format.
**Purpose:** This indicator automates the manual calculation steps of the TFLX analysis methodology, providing real-time computation of volatility ratios, trend filters, and risk management parameters that would otherwise require manual calculation and monitoring.
## Requirements and Limitations
**Additional Indicator Required:** This dashboard indicator works in conjunction with a separate ORB range visualization indicator that displays the actual high/low range levels on the chart. The dashboard provides analysis and calculations, while the range indicator provides visual reference points.
**Important Notice:** This indicator serves as an analytical tool and calculation assistant for the TFLX methodology. It does not execute trades automatically but provides data analysis to support manual decision-making processes.
## TFLX Analysis Methodology Framework
### Core Analysis Rules (Discretionary Implementation)
**Primary Conditions:**
- Market position relative to neutral zones (BB analysis)
- Volatility range between 15-60% of ATR(3)
- News event screening (high-impact economic releases)
- Market session timing constraints (before calculated session end)
- US Bank Holiday considerations
**Exception Conditions:**
- High-impact news with rebreak patterns
- Reversal patterns during neutral market conditions
### Technical Specifications of the Methodology
**Range Definition:**
- Time Period: First 15 minutes after market open
- Measurement: High-Low range calculation
- Breakout Trigger: 5-minute close outside established range
**Volatility Analysis:**
- Formula: (Range Points / ATR(3) Previous Day) × 100
- Threshold Ranges:
- <15%: Below minimum threshold
- 15-20%: Low volatility range
- 25-30%: Moderate volatility range
- 30-40%: Good volatility range
- 40-50%: High volatility range
- 50-60%: Very high volatility range
- >60%: Above maximum threshold
**News Event Categories:**
- Major Events: NFP, CPI, PPI, FOMC releases
- Minor Events: All significant economic releases during market hours
- Impact Assessment: Market reaction analysis framework
**Trend Analysis Framework (1H Bollinger Bands):**
- Base Calculation: EMA(200) with standard deviation bands
- Reference Points: Market Open, ORB Close, Trigger Bar
- Decision Logic: 2 out of 3 reference points determine bias
- Zone Classifications:
- Within 0.5 multiplier: Neutral zone
- Within 1.5 multiplier: Directional bias zone
- Outside 1.5 multiplier: Strong directional zone
**Timing Constraints:**
- Session Window: Market open to calculated session end (typically 4.5 hours)
- Retracement Analysis: Maximum adverse movement before breakeven or stop loss
**Manual Calculation Process (Automated by Indicator):**
1. Measure range in points using chart measurement tools
2. Switch to daily timeframe
3. Set ATR period to 3
4. Extract previous day's ATR value
5. Calculate: (Range Points ÷ ATR Value) × 100
6. Apply percentage thresholds for analysis
## Core Components and Calculation Methods
### 1. Opening Range Calculation
**Data Source:** High/Low/Close prices of current timeframe
**Calculation:**
- Defines a configurable time period (default: 15 minutes)
- Collects during this period: `range_high = max(high)` and `range_low = min(low)`
- Calculates Range Size: `range_size = range_high - range_low`
- Stores the last close price of the period: `final_orb_close`
### 2. ATR (Average True Range) Integration
**Data Source:** Daily True Range values
**Calculation:**
```
daily_atr = ta.atr(length) // Default 3 periods
atr_yesterday = daily_atr // Previous trading day
```
**Available Methods:** RMA (default), SMA, EMA, WMA
### 3. Volatility Ratio Calculation
**Formula:**
```
ratio = (range_size / atr_yesterday) * 100
```
**Purpose:** Normalization of current range against historical volatility
**Configurable Parameters:** Min/Max thresholds (default: 15-60%)
### 4. Bollinger Bands Integration (1H Timeframe)
**Data Source:** 1-hour chart data via `request.security()`
**Calculation:**
```
bb_ema = ta.ema(close, 200) // 1H timeframe
bb_std = ta.stdev(close, 200) // 1H timeframe
bb_upper = bb_ema + (bb_std * multiplier)
bb_lower = bb_ema - (bb_std * multiplier)
```
**Configurable Multipliers:**
- Neutral Zone: 0.5x standard deviation
- Strong Zone: 1.5x standard deviation
### 5. Trend Filter System (2/3 Method)
**Components:**
1. **NY Open Signal:** Compares 1H open price with BB levels
2. **ORB Close Signal:** Compares final ORB close with BB levels
3. **Trigger Signal:** Compares breakout price with BB levels
**Logic:**
```
if (bullish_signals >= 2) → "BULLISH"
if (bearish_signals >= 2) → "BEARISH"
else → "MIXED" or "NO TREND"
```
## Component Interaction
### Trade Signal Generation
**Algorithm:**
```
trade_allowed = (orb_ratio >= min_threshold AND orb_ratio <= max_threshold)
AND (bb_signal != "NEUTRAL")
AND (trend_filter_result contains "BULLISH" OR "BEARISH")
```
### Risk Management Calculation
**Entry Points:**
- Long Entry: `range_high`
- Short Entry: `range_low`
**Stop Loss Calculation:**
```
sl_level = range_low + (range_size * sl_position_percent / 100)
```
**Take Profit Calculation:**
```
tp_distance = range_size * tp_factor_percent / 100
long_tp = long_entry + tp_distance
short_tp = short_entry - tp_distance
```
**Position Sizing (CFD-optimized):**
```
risk_per_contract = avg_risk_points * contract_value * lot_size
max_contracts = max_risk_amount / risk_per_contract
```
**Margin Calculation (CFDs):**
```
position_value = total_units * entry_price
margin_required = position_value / leverage
```
## Dashboard Elements
### 1. Volatility Filter Section
- **ORB Range:** Current range in points
- **ATR Previous:** Yesterday's ATR values
- **ORB Ratio:** Calculated ratio with color coding
### 2. Trend Filter Section
- **NY Open vs BB:** Position of 1H open relative to BB
- **ORB Close vs BB:** Position of ORB close relative to BB
- **Trigger Bar vs BB:** Position of breakout price relative to BB
- **Trend Result:** Summary of 2/3 filter
### 3. Risk Management Section (optional)
- **R/R Ratio:** Calculated from TP/SL distances
- **Risk per Lot:** Based on instrument type
- **Max Lot Packages:** Automatic position sizing calculation
- **Margin Required:** For CFD instruments
### 4. Journal Section (optional)
- **Breakout Timing:** Categorization by bars (1-3, 4-6, 7-9, 10-12, 13+)
- **Direction Tracking:** Bullish/Bearish breakout direction
- **Position Analysis:** Distance of breakout to ORB range
## Automatic Instrument Detection
**CFD/Index Treatment:**
```
if (syminfo.type == "cfd" OR syminfo.type == "index")
contract_value = 1.0 * cfd_lot_size
```
**Forex Treatment:**
```
if (syminfo.type == "forex")
contract_value = syminfo.pointvalue * cfd_lot_size
```
**Futures/Stocks:**
```
contract_value = syminfo.pointvalue
```
## Timezone Handling
- All time calculations based on configurable timezone
- Session End Time: ORB Start + 4.5 hours
- Automatic overflow handling for 24h format
## Alert System
**ORB Formation Alert:**
- Triggered upon completion of ORB period
- Includes: Range size, high/low values
**Breakout Alert:**
- Triggered on close price outside ORB range
- Includes: Direction, trade status based on filters
## Configuration Options
- **ORB Period:** Start/end time in hours/minutes
- **ATR Parameters:** Period and calculation method
- **Volatility Thresholds:** Min/max percentage limits
- **BB Parameters:** Period and multipliers
- **Risk Management:** Risk amount, SL/TP positions
- **Dashboard Layout:** Position, size, colors, visibility
## Data Integrity
- State variables with `var` declaration for persistence
- Daily reset of all relevant variables
- Lookahead bias prevention through `barmerge.lookahead_off`
- Multi-timeframe safety through `request.security()` functions
This technical implementation provides a comprehensive analysis framework for Opening Range Breakout patterns with integrated volatility, trend, and risk management components.
EAOBS by MIGVersion 1
1. Strategy Overview Objective: Capitalize on breakout movements in Ethereum (ETH) price after the Asian open pre-market session (7:00 PM–7:59 PM EST) by identifying high and low prices during the session and trading breakouts above the high or below the low.
Timeframe: Any (script is timeframe-agnostic, but align with session timing).
Session: Pre-market session (7:00 PM–7:59 PM EST, adjustable for other time zones, e.g., 12:00 AM–12:59 AM GMT).
Risk-Reward Ratios (R:R): Targets range from 1.2:1 to 5.2:1, with a fixed stop loss.
Instrument: Ethereum (ETH/USD or ETH-based pairs).
2. Market Setup Session Monitoring: Monitor ETH price action during the pre-market session (7:00 PM–7:59 PM EST), which aligns with the Asian market open (e.g., 9:00 AM–9:59 AM JST).
The script tracks the highest high and lowest low during this session.
Breakout Triggers: Buy Signal: Price breaks above the session’s high after the session ends (7:59 PM EST).
Sell Signal: Price breaks below the session’s low after the session ends.
Visualization: The session is highlighted on the chart with a white background.
Horizontal lines are drawn at the session’s high and low, extended for 30 bars, along with take-profit (TP) and stop-loss (SL) levels.
3. Entry Rules Long (Buy) Entry: Enter a long position when the price breaks above the session’s high price after 7:59 PM EST.
Entry price: Just above the session high (e.g., add a small buffer, like 0.1–0.5%, to avoid false breakouts, depending on volatility).
Short (Sell) Entry: Enter a short position when the price breaks below the session’s low price after 7:59 PM EST.
Entry price: Just below the session low (e.g., subtract a small buffer, like 0.1–0.5%).
Confirmation: Use a candlestick close above/below the breakout level to confirm the entry.
Optionally, add volume confirmation or a momentum indicator (e.g., RSI or MACD) to filter out weak breakouts.
Position Size: Calculate position size based on risk tolerance (e.g., 1–2% of account per trade).
Risk is determined by the stop-loss distance (10 points, as defined in the script).
4. Exit Rules Take-Profit Levels (in points, based on script inputs):TP1: 12 points (1.2:1 R:R).
TP2: 22 points (2.2:1 R:R).
TP3: 32 points (3.2:1 R:R).
TP4: 42 points (4.2:1 R:R).
TP5: 52 points (5.2:1 R:R).
Example for Long: If session high is 3000, TP levels are 3012, 3022, 3032, 3042, 3052.
Example for Short: If session low is 2950, TP levels are 2938, 2928, 2918, 2908, 2898.
Strategy: Scale out of the position (e.g., close 20% at TP1, 20% at TP2, etc.) or take full profit at a preferred TP level based on market conditions.
Stop-Loss: Fixed at 10 points from the entry.
Long SL: Session high - 10 points (e.g., entry at 3000, SL at 2990).
Short SL: Session low + 10 points (e.g., entry at 2950, SL at 2960).
Trailing Stop (Optional):After reaching TP2 or TP3, consider trailing the stop to lock in profits (e.g., trail by 10–15 points below the current price).
5. Risk Management per Trade: Limit risk to 1–2% of your trading account per trade.
Calculate position size: Account Size × Risk % ÷ (Stop-Loss Distance × ETH Price per Point).
Example: $10,000 account, 1% risk = $100. If SL = 10 points and 1 point = $1, position size = $100 ÷ 10 = 0.1 ETH.
Daily Risk Limit: Cap daily losses at 3–5% of the account to avoid overtrading.
Maximum Exposure: Avoid taking both long and short positions simultaneously unless using separate accounts or strategies.
Volatility Consideration: Adjust position size during high-volatility periods (e.g., major news events like Ethereum upgrades or macroeconomic announcements).
6. Trade Management Monitoring :Watch for breakouts after 7:59 PM EST.
Monitor price action near TP and SL levels using alerts or manual checks.
Trade Duration: Breakout lines extend for 30 bars (script parameter). Close trades if no TP or SL is hit within this period, or reassess based on market conditions.
Adjustments: If the market shows strong momentum, consider holding beyond TP5 with a trailing stop.
If the breakout fails (e.g., price reverses before TP1), exit early to minimize losses.
7. Additional Considerations Market Conditions: The 7:00 PM–7:59 PM EST session aligns with the Asian market open (e.g., Tokyo Stock Exchange open at 9:00 AM JST), which may introduce higher volatility due to Asian trading activity.
Avoid trading during low-liquidity periods or extreme volatility (e.g., major crypto news).
Check for upcoming events (e.g., Ethereum network upgrades, ETF decisions) that could impact price.
Backtesting: Test the strategy on historical ETH data using the session high/low breakouts for the 7:00 PM–7:59 PM EST window to validate performance.
Adjust TP/SL levels based on backtest results if needed.
Broker and Fees: Use a low-fee crypto exchange (e.g., Binance, Kraken, Coinbase Pro) to maximize R:R.
Account for trading fees and slippage in your position sizing.
Time zone Adjustment: Adjust session time input for your time zone (e.g., "0000-0059" for GMT).
Ensure your trading platform’s clock aligns with the script’s time zone (default: America/New_York).
8. Example Trade Scenario: Session (7:00 PM–7:59 PM EST) records a high of 3050 and a low of 3000.
Long Trade: Entry: Price breaks above 3050 (e.g., enter at 3051).
TP Levels: 3063 (TP1), 3073 (TP2), 3083 (TP3), 3093 (TP4), 3103 (TP5).
SL: 3040 (3050 - 10).
Position Size: For a $10,000 account, 1% risk = $100. SL = 11 points ($11). Size = $100 ÷ 11 = ~0.09 ETH.
Short Trade: Entry: Price breaks below 3000 (e.g., enter at 2999).
TP Levels: 2987 (TP1), 2977 (TP2), 2967 (TP3), 2957 (TP4), 2947 (TP5).
SL: 3010 (3000 + 10).
Position Size: Same as above, ~0.09 ETH.
Execution: Set alerts for breakouts, enter with limit orders, and monitor TPs/SL.
9. Tools and Setup Platform: Use TradingView to implement the Pine Script and visualize breakout levels.
Alerts: Set price alerts for breakouts above the session high or below the session low after 7:59 PM EST.
Set alerts for TP and SL levels.
Chart Settings: Use a 1-minute or 5-minute chart for precise session tracking.
Overlay the script to see high/low lines, TP levels, and SL levels.
Optional Indicators: Add RSI (e.g., avoid overbought/oversold breakouts) or volume to confirm breakouts.
10. Risk Warnings Crypto Volatility: ETH is highly volatile; unexpected news can cause rapid price swings.
False Breakouts: Breakouts may fail, especially in low-volume sessions. Use confirmation signals.
Leverage: Avoid high leverage (e.g., >5x) to prevent liquidation during volatile moves.
Session Accuracy: Ensure correct session timing for your time zone to avoid misaligned entries.
11. Performance Tracking Journaling :Record each trade’s entry, exit, R:R, and outcome.
Note market conditions (e.g., trending, ranging, news-driven).
Review: Weekly: Assess win rate, average R:R, and adherence to the plan.
Monthly: Adjust TP/SL or session timing based on performance.
ai quant oculusAI QUANT OCULUS
Version 1.0 | Pine Script v6
Purpose & Innovation
AI QUANT OCULUS integrates four distinct technical concepts—exponential trend filtering, adaptive smoothing, momentum oscillation, and Gaussian smoothing—into a single, cohesive system that delivers clear, objective buy and sell signals along with automatically plotted stop-loss and three profit-target levels. This mash-up goes beyond a simple EMA crossover or standalone TRIX oscillator by requiring confluence across trend, adaptive moving averages, momentum direction, and smoothed price action, reducing false triggers and focusing on high‐probability turning points.
How It Works & Why Its Components Matter
Trend Filter: EMA vs. Adaptive MA
EMA (20) measures the prevailing trend with fixed sensitivity.
Adaptive MA (also EMA-based, length 10) approximates a faster-responding moving average, standing in for a KAMA-style filter.
Bullish bias requires AMA > EMA; bearish bias requires AMA < EMA. This ensures signals align with both the underlying trend and a more nimble view of recent price action.
Momentum Confirmation: TRIX
Calculates a triple-smoothed EMA of price over TRIX Length (15), then converts it to a percentage rate-of-change oscillator.
Positive TRIX reinforces bullish entries; negative TRIX reinforces bearish entries. Using TRIX helps filter whipsaws by focusing on sustained momentum shifts.
Gaussian Price Smoother
Applies two back-to-back 5-period EMAs to the price (“gaussian” smoothing) to remove short-term noise.
Price above the smoothed line confirms strength for longs; below confirms weakness for shorts. This layer avoids entries on erratic spikes.
Confluence Signals
Buy Signal (isBull) fires only when:
AMA > EMA (trend alignment)
TRIX > 0 (momentum support)
Close > Gaussian (price strength)
Sell Signal (isBear) fires under the inverse conditions.
Requiring all three conditions simultaneously sharply reduces false triggers common to single-indicator systems.
Automatic Risk & Reward Plotting
On each new buy or sell signal (edge detection via not isBull or not isBear ), the script:
Stores entryPrice at the signal bar’s close.
Draws a stop-loss line at entry minus ATR(14) × Stop Multiplier (1.5) by default.
Plots three profit-target lines at entry plus ATR × Target Multiplier (1×, 1.5×, and 2×).
All previous labels and lines are deleted on each new signal, keeping the chart uncluttered and focusing only on the current trade.
Inputs & Customization
Input Description Default
EMA Length Period for the main trend EMA 20
Adaptive MA Length Period for the faster adaptive EM A substitute 10
TRIX Length Period for the triple-smoothed momentum oscillator 15
Dominant Cycle Length (Reserved) 40
Stop Multiplier ATR multiple for stop-loss distance 1.5
Target Multiplier ATR multiple for first profit target 1.5
Show Buy/Sell Signals Toggle on-chart labels for entry signals On
How to Use
Apply to Chart: Best on 15 m–1 h timeframes for swing entries or 5 m for agile scalps.
Wait for Full Confluence:
Look for the AMA to cross above/below the EMA and verify TRIX and Gaussian conditions on the same bar.
A bright “LONG” or “SHORT” label marks your entry.
Manage the Trade:
Place your stop where the red or green SL line appears.
Scale or exit at the three yellow TP1/TP2/TP3 lines, automatically drawn by volatility.
Repeat Cleanly: Each new signal clears prior annotations, ensuring you only track the active setup.
Why This Script Stands Out
Multi-Layer Confluence: Trend, momentum, and noise-reduction must all align, addressing the weaknesses of single-indicator strategies.
Automated Trade Management: No manual plotting—stop and target lines appear seamlessly with each signal.
Transparent & Customizable: All logic is open, adjustable, and clearly documented, allowing traders to tweak lengths and multipliers to suit different instruments.
Disclaimer
No indicator guarantees profit. Always backtest AI QUANT OCULUS extensively, combine its signals with your own analysis and risk controls, and practice sound money management before trading live.
AI QUANT OCULUSAI QUANT OCULUS
Version 1.0 | Pine Script v6
Purpose & Innovation
AI QUANT OCULUS integrates four distinct technical concepts—exponential trend filtering, adaptive smoothing, momentum oscillation, and Gaussian smoothing—into a single, cohesive system that delivers clear, objective buy and sell signals along with automatically plotted stop-loss and three profit-target levels. This mash-up goes beyond a simple EMA crossover or standalone TRIX oscillator by requiring confluence across trend, adaptive moving averages, momentum direction, and smoothed price action, reducing false triggers and focusing on high‐probability turning points.
How It Works & Why Its Components Matter
Trend Filter: EMA vs. Adaptive MA
EMA (20) measures the prevailing trend with fixed sensitivity.
Adaptive MA (also EMA-based, length 10) approximates a faster-responding moving average, standing in for a KAMA-style filter.
Bullish bias requires AMA > EMA; bearish bias requires AMA < EMA. This ensures signals align with both the underlying trend and a more nimble view of recent price action.
Momentum Confirmation: TRIX
Calculates a triple-smoothed EMA of price over TRIX Length (15), then converts it to a percentage rate-of-change oscillator.
Positive TRIX reinforces bullish entries; negative TRIX reinforces bearish entries. Using TRIX helps filter whipsaws by focusing on sustained momentum shifts.
Gaussian Price Smoother
Applies two back-to-back 5-period EMAs to the price (“gaussian” smoothing) to remove short-term noise.
Price above the smoothed line confirms strength for longs; below confirms weakness for shorts. This layer avoids entries on erratic spikes.
Confluence Signals
Buy Signal (isBull) fires only when:
AMA > EMA (trend alignment)
TRIX > 0 (momentum support)
Close > Gaussian (price strength)
Sell Signal (isBear) fires under the inverse conditions.
Requiring all three conditions simultaneously sharply reduces false triggers common to single-indicator systems.
Automatic Risk & Reward Plotting
On each new buy or sell signal (edge detection via not isBull or not isBear ), the script:
Stores entryPrice at the signal bar’s close.
Draws a stop-loss line at entry minus ATR(14) × Stop Multiplier (1.5) by default.
Plots three profit-target lines at entry plus ATR × Target Multiplier (1×, 1.5×, and 2×).
All previous labels and lines are deleted on each new signal, keeping the chart uncluttered and focusing only on the current trade.
Inputs & Customization
Input Description Default
EMA Length Period for the main trend EMA 20
Adaptive MA Length Period for the faster adaptive EM A substitute 10
TRIX Length Period for the triple-smoothed momentum oscillator 15
Dominant Cycle Length (Reserved) 40
Stop Multiplier ATR multiple for stop-loss distance 1.5
Target Multiplier ATR multiple for first profit target 1.5
Show Buy/Sell Signals Toggle on-chart labels for entry signals On
How to Use
Apply to Chart: Best on 15 m–1 h timeframes for swing entries or 5 m for agile scalps.
Wait for Full Confluence:
Look for the AMA to cross above/below the EMA and verify TRIX and Gaussian conditions on the same bar.
A bright “LONG” or “SHORT” label marks your entry.
Manage the Trade:
Place your stop where the red or green SL line appears.
Scale or exit at the three yellow TP1/TP2/TP3 lines, automatically drawn by volatility.
Repeat Cleanly: Each new signal clears prior annotations, ensuring you only track the active setup.
Why This Script Stands Out
Multi-Layer Confluence: Trend, momentum, and noise-reduction must all align, addressing the weaknesses of single-indicator strategies.
Automated Trade Management: No manual plotting—stop and target lines appear seamlessly with each signal.
Transparent & Customizable: All logic is open, adjustable, and clearly documented, allowing traders to tweak lengths and multipliers to suit different instruments.
Disclaimer
No indicator guarantees profit. Always backtest AI QUANT OCULUS extensively, combine its signals with your own analysis and risk controls, and practice sound money management before trading live.
EMA Cloud Matrix with Trend Tablethis script builds upon a standard exponential moving average (ema) by adding volatility-based dynamic bands and persistent trend detection. it also enhances decision-making by including visual indicators (labels and clouds), a multi-timeframe trend table, and optional retest signals. here's an in-depth explanation:
volatility-based bands:
instead of just plotting an ema line, this script creates an upper and lower band around the ema using the average volatility (calculated as the average range of high-low over 100 bars).
the bands represent areas where price is likely to deviate significantly from the ema, signaling potential trend shifts.
persistent trend detection:
a persistent trend variable updates when price crosses above the upper band (bullish trend) or below the lower band (bearish trend). this ensures that the trend state persists until a new cross event occurs.
normal emas don't store such states—they merely provide a lagging representation of price.
visual enhancements:
a color-coded cloud dynamically highlights the area between the ema and the current trend line (upper or lower band), making trend direction clearer.
labels mark significant crossover or crossunder events, serving as potential buy or sell signals.
multi-timeframe trend table:
the table shows the trend direction (buy/sell) for the 15-minute, 4-hour, and daily timeframes, giving a broader perspective for trading decisions.
optional retest signals:
when enabled, it identifies situations where price tests the ema after trending away, providing additional opportunities for entries or exits.
first time ever - why use this and how?
why use this?
this is ideal for traders who:
struggle with trend-following strategies that lack clear entry/exit rules.
want a hybrid system combining ema-based smoothness with volatility-based adaptability.
need to visualize trends in multiple timeframes without switching charts.
how to use this?
buy signal: when the price crosses above the upper band, the trend flips to bullish. you’ll see a green upward arrow (▲) on the chart, indicating a potential long entry.
sell signal: when the price crosses below the lower band, the trend flips to bearish. a blue downward arrow (▼) appears on the chart, signaling a potential short entry.
retest signals (optional): if the price comes back to test the ema during a trend, a retest label can guide you for a secondary entry.
exit based on risk-reward ratio (rr)
this script doesn't explicitly calculate risk-reward ratios (rr), but you can manage exits effectively using the following ideas:
set a defined stop-loss:
if entering on a buy signal (crossover above upper band), place a stop below the ema or the lower band. for short signals, use the upper band as a stop.
this ensures the stop-loss dynamically adjusts with volatility.
use rr to set targets:
decide on a risk-reward ratio like 1:2 or 1:3. for example:
if your stop-loss is 20 points below your entry, set your target 40 or 60 points above for a 1:2 or 1:3 rr.
you can use trailing stops to lock in profits as the trend continues.
exit on opposite signal:
if the trend changes (e.g., price crosses below the lower band in a bullish trade), close the position.
how it gives signals and when to buy or sell
signal logic:
buy signal (bullish crossover):
when the price crosses above the upper band, the script marks it as a bullish trend and plots a green arrow (▲).
sell signal (bearish crossunder):
when the price crosses below the lower band, the script identifies it as a bearish trend and plots a blue arrow (▼).
trend continuation:
the trend state persists until the opposite condition occurs, helping you avoid noise or whipsaws.
multi-timeframe insights:
consult the trend table for confirmation across timeframes. for example:
if the 15-minute and 4-hour timeframes align with a buy trend, it strengthens the case for a long trade.
conflicting signals might suggest waiting for further confirmation.
using retest signals:
during strong trends, price often revisits the ema before resuming. if the optional retest signals are enabled, you’ll see labels at these points. they can be used to:
add to an existing position.
enter a trade if you missed the initial breakout.
key event: price crosses above the upper band
when the price closes above the upper band (ema + volatility buffer), the script identifies a bullish trend.
a green upward arrow (▲) is plotted on the chart, signaling the beginning of a long trend.
visual confirmation:
the cloud between the ema and the trend line (lower band) is filled with a light green color, representing a bullish phase.
the trend table will display "buy" with an upward arrow for the respective timeframe(s).
actionable insight:
entry: take a long position when the green ▲ appears, confirming a bullish crossover.
continuation trades: use the optional retest signals to identify pullbacks to the ema as opportunities to add to the long position.
exit: close the position when a bearish crossunder (sell signal) occurs.
identifying short trends (sell signal)
key event: price crosses below the lower band
when the price closes below the lower band (ema - volatility buffer), the script identifies a bearish trend.
a blue downward arrow (▼) is plotted on the chart, signaling the beginning of a short trend.
visual confirmation:
the cloud between the ema and the trend line (upper band) is filled with a light blue color, representing a bearish phase.
the trend table will display "sell" with a downward arrow for the respective timeframe(s).
actionable insight:
entry: take a short position when the blue ▼ appears, confirming a bearish crossunder.
continuation trades: use the optional retest signals to identify rallies back to the ema as opportunities to add to the short position.
exit: close the position when a bullish crossover (buy signal) occurs.
what makes it different from other ema indicators?
dynamic volatility adaptation:
standard ema indicators only track the average price over a given period, making them susceptible to market noise in highly volatile conditions.
this script uses a volatility buffer (average true range of high-low) to create upper and lower bands around the ema, filtering out insignificant movements and focusing on meaningful breakouts.
persistent trend logic:
unlike traditional emas that simply follow price direction, this script maintains a persistent trend state until a clear crossover or crossunder occurs:
bullish trends persist above the upper band.
bearish trends persist below the lower band.
this minimizes whipsaws in choppy markets.
visual enhancements:
the trend-colored cloud (green for long trends, blue for short trends) helps you quickly identify the market’s state.
labels (▲ and ▼) mark critical entry signals, making it easier to spot potential trades.
multi-timeframe trend confirmation:
the trend table integrates higher and lower timeframes, providing a multi-timeframe perspective:
short-term (15 minutes) for active trading.
medium-term (4 hours) for swing positions.
long-term (daily) for overall trend direction.
optional retest signals:
most ema-based strategies miss the retest phase after a breakout.
this script includes an optional feature to identify pullbacks to the ema during a trend, helping traders enter or add positions at better prices.
all-in-one system:
while traditional ema indicators only show a smoothed average line, this script integrates trend detection, volatility bands, visual aids, and multi-timeframe analysis in a single tool, reducing the need for additional indicators.
summary
this script goes beyond a simple ema by incorporating trend persistence, volatility bands, and multi-timeframe analysis. buy signals occur when price crosses above the upper band, initiating a long trend, while sell signals occur when price crosses below the lower band, initiating a short trend. it stands out due to its ability to adapt to market conditions, provide clear visual cues, and avoid the noise common in standard ema-based systems.
Volume Strength IndicatorThis Indicator is built to give you an edge into the market. Given volume, volatility and price-action, it compares market conditions against the maximum that have occurred so far in the session. Useful for intraday and day trading for timing entries with the smart money.
The green/red histogram gives us a view into the relative strength of the current bar, whether they have strong buying or selling power.
The orange signal line gives us a view of the recent trend, which can be modified using the various inputs.
Trend Shift Histogram By Clarity ChartsTrend Shift Histogram – A Brand New Formula by Clarity Charts
The Trend Shift Histogram is a brand-new mathematical formula designed to capture market momentum shifts with exceptional clarity.
Unlike traditional histograms, this indicator focuses on detecting early changes in market direction by analyzing underlying trend strength and momentum imbalances.
Key Features:
New Formula – Built from scratch to highlight momentum reversals and hidden trend shifts.
Visual Clarity – Green and red histogram bars make it easy to identify bullish and bearish phases, and grey area as trend reversal or sideways zone.
Trend Detection – Helps traders spot when the market is about to shift direction, often before price reacts strongly.
Scalable Settings –
Use smaller lengths for scalping and short-term trades.
Use larger lengths for swing trading and longer trend analysis.
Every Timeframe Ready – Whether you’re scalping on 1m or analyzing weekly charts, the histogram adapts seamlessly.
Power of Combining with the Fear Index
The Trend Shift Histogram becomes even more powerful when combined with Fear Index by Clarity Charts :
Fear Index by Clarity Charts
Together:
Fear Index highlights market fear & exhaustion levels, showing when traders are capitulating.
Trend Shift Histogram confirms the direction of the new trend once fear has peaked.
How to Use:
📈 Long Entry Condition
A long position is triggered when the following conditions align:
The Fear Index Bulls are showing upward momentum, indicating strengthening bullish sentiment.
The Fear Index Bears are simultaneously declining, signaling weakening bearish pressure.
The Trend Shift Histogram transitions from a short bias to a long bias, confirming a structural shift in market direction.
When all three conditions occur together, it provides a strong confluence to initiate a long trade entry.
📉 Short Entry Condition
A short position is triggered when the opposite conditions align:
The Fear Index Bears are showing upward momentum, indicating strengthening bearish sentiment.
The Fear Index Bulls are simultaneously declining, signaling weakening bullish pressure.
The Trend Shift Histogram transitions from a long bias to a short bias, confirming a structural shift in market direction.
When all three conditions occur together, it provides a strong confluence to initiate a short trade entry.
🔄 Bullish Trend Cycle
During a bullish phase as per the Fear Index, you can capture the entire cycle by:
Entry: Taking entries when the Trend Shift Histogram begins printing green bars, which mark the start of a bullish trend shift.
Exit: Closing the position when the histogram transitions to grey bars, signaling exhaustion or a potential pause in the bullish cycle.
This approach allows you to ride the bullish momentum effectively while respecting market cycle shifts.
🔻 Bearish Trend Cycle
During a bearish phase as per the Fear Index, you can capture the entire cycle by:
Entry: Taking entries when the Trend Shift Histogram begins printing red bars, which mark the start of a bearish trend shift.
Exit: Closing the position when the histogram transitions to grey bars, signaling exhaustion or a potential pause in the bearish cycle.
This approach ensures that bearish trends are traded with precision, avoiding late entries and capturing maximum move potential.
Watch for histogram color changes (green = bullish, red = bearish, grey = sideways).
Adjust length settings based on your style:
Small = intraday & scalping precision.
Large = swing & positional confidence.
Combine signals with Fear Index peaks for high-probability reversal zones.
Apply across any timeframe for flexible strategy building.
Who Can Use This
Scalpers – Catch quick intraday shifts.
Swing Traders – Ride bigger moves with confidence.
Long-Term Investors – Spot early warning signs of market trend reversals.
Contact & Support
For collaboration, premium indicators, or custom strategy building:
theclaritycharts@gmail.com
Polaris Trend All-in-One📘 Polaris Trend Indicator: Trading Rules & Strategy
Guide
The Polaris Trend Indicator is designed to simplify trading decisions by identifying key entry
and exit signals without the need for excessive technical analysis. This system combines the
Polaris Trend with the Polaris Golden Wave and Market Bias tools to give you confidence
across multiple timeframes.
This guide outlines clear trading rules for two use cases:
● Swing Trading
● Long-Term Investing and Holding
⚡ Swing Trading Strategy
Swing trading can be challenging when the market direction is unclear. The Polaris Trend helps
traders stay on the right side of momentum with straightforward visual signals. This approach is
best used on the Daily or Weekly chart.
✅ Entry Criteria (Bullish Trades)
● A solid green column appears above the zero line.
● A green upward arrow confirms bullish momentum.
● Enter your trade immediately when the green column first appears.
● Hold the trade until a red column appears, signaling a shift in momentum.
🚫 Exit Criteria (Bullish Trades)
● The first appearance of a red column after a green run.
● Multiple green columns followed by a red column.
● Do not enter trades mid-trend; always enter on the first green flip.
***Recommended Swing Strategy
● When a new daily green column appears but the weekly columns are still red, stay
nimble. Enter your position when the Polaris Trend Indicator turns green and displays an
upward-pointing arrow.
● If the price pulls back to a higher low but a red daily column forms, sell 50% of your
position and move your stop loss to your original entry. Then, wait for the next daily
green column and arrow to reappear, this is your signal to reenter the 50% you exited.
● If the price continues to rise and the weekly columns also turn green, shift your focus
to the weekly chart. Ignore daily signals and hold the trade until the weekly column
turns red, which will be your cue to exit. The weekly green column is your confirmation of
a stronger uptrend and a potential longer hold.
🔻 Entry Criteria (Bearish Trades)
● A solid red column appears below the zero line.
● A red downward arrow confirms bearish momentum.
● Enter your short trade immediately when the red column first appears.
● Hold until a green column appears, indicating momentum has shifted.
🔁 Exit Criteria (Bearish Trades)
● The first green column that follows a red sequence.
● Same rule applies: enter only on the initial flip, not mid-trend.
Note: The first color flip is the most reliable entry point. Avoid entering positions
deep into a trend, wait for the clear signal from Polaris.
🧭 Long-Term Investing Strategy
This approach combines the Polaris Golden Wave, Polaris Trend, and Market Bias to help
long-term investors buy at deep value levels and scale into positions over time.
📉 Ideal Entry: Golden Zone + Polaris Trend Signal
● Use the Golden Wave to identify the monthly 0.618–0.826 retracement zone
(significant discount levels).
● When price enters the Golden Zone and the Polaris Trend shows a green column on
the Daily or Weekly, this is your optimal entry point.
● If the trend turns red inside the zone, consider trimming positions and re-entering on the
next bullish signal.
If price drops below the Golden Zone, the stock becomes even more undervalued,
wait for the next green Polaris Trend signal to enter.
💰 Secondary Entry: Market Bias Rebounds
● If you miss the Golden Zone entry or are dollar-cost averaging:
○ Use the Market Bias on a Weekly timeframe.
○ Wait for price to retrace into the Market Bias band after moving higher.
○ Look for a red Polaris Trend column, then wait for price to enter the Market
Bias band and once it enters, wait for Polaris Trend signal to flip back to green
for your entry. If the trend turns red inside the zone, consider trimming positions
and re-entering on the next bullish signal.
Think of the Market Bias like a lake and price like a skipping stone—you want to
buy when the stone comes down and touches the surface.
📊 Indicator Explanations
🔶 Golden Wave (Monthly Fibonacci Retracement Zones)
● Highlights key monthly retracement zones (0.618 to 0.826).
● Helps identify deep-value entries on longer timeframes.
● Visible across all chart timeframes for consistent macro reference.
🔴 Market Bias (Smoothed Heikin-Ashi Trend Filter)
● Measures trend direction and strength using smoothed Heikin-Ashi candles and
oscillation logic.
● Customizable smoothing, oscillator period, and timeframe inputs.
● Option to display trend signals in a separate pane with dynamic coloring.
This combined approach empowers traders to make high-quality decisions with clarity and
discipline. Whether you're entering short-term swings or building long-term positions, the
Polaris Trend system guides you with timely, data-driven signals.