Indicators and strategies
Cruce TEMA SMMA con Alarma a 12 Barras LLUCes un cruce de TEMA SMMA, luego del cruce contar 12 barras controladas por otros
Todays Session Open LN,NYWhen are the Asian, London and New York open for each session simple stuff trading view made me right more stuff so i can publish this what to do c'est la vie 
EXTPO TRENDIndicator designed for traders who prefer quick scalping or day trading.
Applicable to timeframes below M15.
Currently, I’m using it on BTC M1.
Note:
When the status is Buy, only buy signals will appear.
When the status is Sell, only sell signals will appear.
When the status is Off, no signals will appear because one of the entry conditions is not met.
Luxy BIG beautiful Dynamic ORBThis is an advanced Opening Range Breakout (ORB) indicator that tracks price breakouts from the first 5, 15, 30, and 60 minutes of the trading session. It provides complete trade management including entry signals, stop-loss placement, take-profit targets, and position sizing calculations.
The ORB strategy is based on the concept that the opening range of a trading session often acts as support/resistance, and breakouts from this range tend to lead to significant moves.
  
 What Makes This Different? 
Most ORB indicators simply draw horizontal lines and leave you to figure out the rest. This indicator goes several steps further:
 Multi-Stage Tracking 
Instead of just one ORB timeframe, this tracks FOUR simultaneously (5min, 15min, 30min, 60min). Each stage builds on the previous one, giving you multiple trading opportunities throughout the session.
 Active Trade Management 
When a breakout occurs, the indicator automatically calculates and displays entry price, stop-loss, and multiple take-profit targets. These lines extend forward and update in real-time until the trade completes.
 Cycle Detection 
Unlike indicators that only show the first breakout, this tracks the complete cycle: Breakout → Retest → Re-breakout. You can see when price returns to test the ORB level after breaking out (potential re-entry).
 Failed Breakout Warning 
If price breaks out but quickly returns inside the range (within a few bars), the label changes to "FAILED BREAK" - warning you to exit or avoid the trade.
 Position Sizing Calculator 
Built-in risk management that tells you exactly how many shares to buy based on your account size and risk tolerance. No more guessing or manual calculations.
 Advanced Filtering 
Optional filters for volume confirmation, trend alignment, and Fair Value Gaps (FVG) to reduce false signals and improve win rate.
  
 Core Features Explained
 
### 1. Multi-Stage ORB Levels
The indicator builds four separate Opening Range levels:
 
 ORB 5  - First 5 minutes (fastest signals, most volatile)
 ORB 15  - First 15 minutes (balanced, most popular)
 ORB 30  - First 30 minutes (slower, more reliable)
 ORB 60  - First 60 minutes (slowest, most confirmed)
 
Each level is drawn as a horizontal range on your chart. As time progresses, the ranges expand to include more price action. You can enable or disable any stage and assign custom colors to each.
 How it works:  During the opening minutes, the indicator tracks the highest high and lowest low. Once the time period completes, those levels become your ORB high and low for that stage.
### 2. Breakout Detection
When price closes outside the ORB range, a label appears:
 
 BREAK UP  (green label above price) - Price closed above ORB High
 BREAK DOWN  (red label below price) - Price closed below ORB Low
 
The label shows which ORB stage triggered (ORB5, ORB15, etc.) and the cycle number if tracking multiple breakouts.
 Important:  Signals appear on bar close only - no repainting. What you see is what you get.
### 3. Retest Detection
After price breaks out and moves away, if it returns to test the ORB level, a "RETEST" label appears (orange). This indicates:
 
 The original breakout level is now acting as support/resistance
 Potential re-entry opportunity if you missed the first breakout
 Confirmation that the level is significant
 
The indicator requires price to move a minimum distance away before considering it a valid retest (configurable in settings).
### 4. Failed Breakout Detection
If price breaks out but returns inside the ORB range within a few bars (before the breakout is "committed"), the original label changes to "FAILED BREAK" in orange.
This warns you:
 
 The breakout lacked conviction
 Consider exiting if already in the trade
 Wait for better setup
 
 Committed Breakout:  The indicator tracks how many bars price stays outside the range. Only after staying outside for the minimum number of bars does it become a committed breakout that can be retested.
  
### 5. TP/SL Lines (Trade Management)
When a breakout occurs, colored horizontal lines appear showing:
 
 Entry Line  (cyan for long, orange for short) - Your entry price (the ORB level)
 Stop Loss Line  (red) - Where to exit if trade goes against you
 TP1, TP2, TP3 Lines  (same color as entry) - Profit targets at 1R, 2R, 3R
 
These lines extend forward as new bars form, making it easy to track your trade. When a target is hit, the line turns green and the label shows a checkmark.
 Lines freeze (stop updating) when: 
 
 Stop loss is hit
 The final enabled take-profit is hit
 End of trading session (optional setting)
 
### 6. Position Sizing Dashboard
The dashboard (bottom-left corner by default) shows real-time information:
 
 Current ORB stage and range size
 Breakout status (Inside Range / Break Up / Break Down)
 Volume confirmation (if filter enabled)
 Trend alignment (if filter enabled)
 Entry and Stop Loss prices
 All enabled Take Profit levels with percentages
 Risk/Reward ratio
 Position sizing: Max shares to buy and total risk amount
 
 Position Sizing Example: 
If your account is $25,000 and you risk 1% per trade ($250), and the distance from entry to stop loss is $0.50, the calculator shows you can buy 500 shares (250 / 0.50 = 500).
  
### 7. FVG Filter (Fair Value Gap)
Fair Value Gaps are price inefficiencies - gaps left by strong momentum where one candle's high doesn't overlap with a previous candle's low (or vice versa).
When enabled, this filter:
 
 Detects bullish and bearish FVGs
 Draws semi-transparent boxes around these gaps
 Only allows breakout signals if there's an FVG near the breakout level
 
 Why this helps:  FVGs indicate institutional activity. Breakouts through FVGs tend to be stronger and more reliable.
 Proximity setting:  Controls how close the FVG must be to the ORB level. 2.0x means the breakout can be within 2 times the FVG size - a reasonable default.
### 8. Volume & Trend Filters
 Volume Filter: 
Requires current volume to be above average (customizable multiplier). High volume breakouts are more likely to sustain.
 
 Set minimum multiplier (e.g., 1.5x = 50% above average)
 Set "strong volume" multiplier (e.g., 2.5x) that bypasses other filters
 Dashboard shows current volume ratio
 
 Trend Filter: 
Only shows breakouts aligned with a higher timeframe trend. Choose from:
 
 VWAP - Price above/below volume-weighted average
 EMA - Price above/below exponential moving average
 SuperTrend - ATR-based trend indicator
 Combined modes (VWAP+EMA, VWAP+SuperTrend) for stricter filtering
 
### 9. Pullback Filter (Advanced)
 Purpose: 
Waits for price to pull back slightly after initial breakout before confirming the signal. 
This reduces false breakouts from immediate reversals.
 How it works: 
- After breakout is detected, indicator waits for a small pullback (default 2%)
- Once pullback occurs AND price breaks out again, signal is confirmed
- If no pullback within timeout period (5 bars), signal is issued anyway
 Settings: 
 
 Enable Pullback Filter:  Turn this filter on/off
 Pullback %:  How much price must pull back (2% is balanced)
 Timeout (bars):  Max bars to wait for pullback (5 is standard)
 
 When to use: 
- Choppy markets with many fake breakouts
- When you want higher quality signals
- Combine with Volume filter for maximum confirmation
 Trade-off: 
- Better signal quality
- May miss some valid fast moves
- Slight entry delay
  
 How to Use This Indicator 
### For Beginners - Simple Setup
 
 Add the indicator to your chart (5-minute or 15-minute timeframe recommended)
 Leave all default settings - they work well for most stocks
 Watch for BREAK UP or BREAK DOWN labels to appear
 Check the dashboard for entry, stop loss, and targets
 Use the position sizing to determine how many shares to buy
 
 Basic Trading Plan: 
 
 Wait for a clear breakout label
 Enter at the ORB level (or next candle open if you're late)
 Place stop loss where the red line indicates
 Take profit at TP1 (50% of position) and TP2 (remaining 50%)
 
### For Advanced Traders - Customized Setup
 
 Choose which ORB stages to track (you might only want ORB15 and ORB30)
 Enable filters: Volume (stocks) or Trend (trending markets)
 Enable FVG filter for institutional confirmation
 Set "Track Cycles" mode to catch retests and re-breakouts
 Customize stop loss method (ATR for volatile stocks, ORB% for stable ones)
 Adjust risk per trade and account size for accurate position sizing
 
 Advanced Strategy Example: 
 
 Enable ORB15 only (disable others for cleaner chart)
 Turn on Volume filter at 1.5x with Strong at 2.5x
 Enable Trend filter using VWAP
 Set Signal Mode to "Track Cycles" with Max 3 cycles
 Wait for aligned breakouts (Volume + Trend + Direction)
 Enter on retest if you missed the initial break
 
### Timeframe Recommendations
 
 5-minute chart:  Scalping, very active trading, crypto
 15-minute chart:  Day trading, balanced approach (most popular)
 30-minute chart:  Swing entries, less screen time
 60-minute chart:  Position trading, longer holds
 
The indicator works on any intraday timeframe, but ORB is fundamentally a day trading strategy. Daily charts don't make sense for ORB.
 
 DEFAULT CONFIGURATION  
ON by Default:
• All 4 ORB stages (5/15/30/60)
• Breakout Detection
• Retest Labels
• All TP levels (1/1.5/2/3)
• TP/SL Lines (Detailed mode)
• Dashboard (Bottom Left, Dark theme)
• Position Size Calculator
OFF by Default (Optional Filters):
• FVG Filter
• Pullback Filter
• Volume Filter
• Trend Filter
• HTF Bias Check
• Alerts
Recommended for Beginners:
• Leave all defaults
• Session Mode: Auto-Detect
• Signal Mode: Track Cycles
• Stop Method: ATR
• Add Volume Filter if trading stocks
 Recommended for Advanced: 
• Enable ORB15 + ORB30 only (disable 5 & 60)
• Enable: Volume + Trend + FVG 
• Signal Mode: Track Cycles, Max 3 
• Stop Method: ATR or Safer 
• Enable HTF Daily bias check 
 
## Settings Guide
The settings are organized into logical groups. Here's what each section controls:
### ORB COLORS Section
 
 Show Edge Labels:  Display "ORB 5", "ORB 15" labels at the right edge of the levels
 Background:  Fill the area between ORB high/low with color
 Transparency:  How see-through the background is (95% is nearly invisible)
 Enable ORB 5/15/30/60:  Turn each stage on or off individually
 Colors:  Assign colors to each ORB stage for easy identification
 
### SESSION SETTINGS Section
 
 Session Mode:  Choose trading session (Auto-Detect works for most instruments)
 Custom Session Hours:  Define your own hours if needed (format: HHMM-HHMM)
 
Auto-Detect uses the instrument's natural hours (stocks use exchange hours, crypto uses 24/7).
### BREAKOUT DETECTION Section
 
 Enable Breakout Detection:  Master switch for signals
 Show Retest Labels:  Display retest signals
 Label Size:  Visual size for all labels (Small recommended)
 Enable FVG Filter:  Require Fair Value Gap confirmation
 Show FVG Boxes:  Display the gap boxes on chart
 Signal Mode:  "First Only" = one signal per direction per day, "Track Cycles" = multiple signals
 Max Cycles:  How many breakout-retest cycles to track (6 is balanced)
 Breakout Buffer:  Extra distance required beyond ORB level (0.1-0.2% recommended)
 Min Distance for Retest:  How far price must move away before retest is valid (2% recommended)
 Min Bars Outside ORB:  Bars price must stay outside for committed breakout (2 is balanced)
 
### TARGETS & RISK Section
 
 Enable Targets & Stop-Loss:  Calculate and show trade management
 TP1/TP2/TP3 checkboxes:  Select which profit targets to display
 Stop Method:  How to calculate stop loss placement
  - ATR: Based on volatility (best for most cases)
  - ORB %: Fixed % of ORB range
  - Swing: Recent swing high/low
  - Safer: Widest of all methods
 ATR Length & Multiplier:  Controls ATR stop distance (14 period, 1.5x is standard)
 ORB Stop %:  Percentage beyond ORB for stop (20% is balanced)
 Swing Bars:  Lookback period for swing high/low (3 is recent)
 
### TP/SL LINES Section
 
 Show TP/SL Lines:  Display horizontal lines on chart
 Label Format:  "Short" = minimal text, "Detailed" = shows prices
 Freeze Lines at EOD:  Stop extending lines at session close
 
### DASHBOARD Section
 
 Show Info Panel:  Display the metrics dashboard
 Theme:  Dark or Light colors
 Position:  Where to place dashboard on chart
 Toggle rows:  Show/hide specific information rows
 Calculate Position Size:  Enable the position sizing calculator
 Risk Mode:  Risk fixed $ amount or % of account
 Account Size:  Your total trading capital
 Risk %:  Percentage to risk per trade (0.5-1% recommended)
 
### VOLUME FILTER Section
 
 Enable Volume Filter:  Require volume confirmation
 MA Length:  Average period (20 is standard)
 Min Volume:  Required multiplier (1.5x = 50% above average)
 Strong Volume:  Multiplier that bypasses other filters (2.5x)
 
### TREND FILTER Section
 
 Enable Trend Filter:  Require trend alignment
 Trend Mode:  Method to determine trend (VWAP is simple and effective)
 Custom EMA Length:  If using EMA mode (50 for swing, 20 for day trading)
 SuperTrend settings:  Period and Multiplier if using SuperTrend mode
 
### HIGHER TIMEFRAME Section
 
 Check Daily Trend:  Display higher timeframe bias in dashboard
 Timeframe:  What TF to check (D = daily, recommended)
 Method:  Price vs MA (stable) or Candle Direction (reactive)
 MA Period:  EMA length for Price vs MA method (20 is balanced)
 Min Strength %:  Minimum strength threshold for HTF bias to be considered
  - For "Price vs MA": Minimum distance (%) from moving average
  - For "Candle Direction": Minimum candle body size (%)
  - 0.5% is balanced - increase for stricter filtering
  - Lower values = more signals, higher values = only strong trends
 
### ALERTS Section
 
 Enable Alerts:  Master switch (must be ON to use any alerts)
 Breakout Alerts:  Notify on ORB breakouts
 Retest Alerts:  Notify when price retests after breakout
 Failed Break Alerts:  Notify on failed breakouts
 Stage Complete Alerts:  Notify when each ORB stage finishes forming
 
After enabling desired alert types, click "Create Alert" button, select this indicator, choose "Any alert() function call".
## Tips & Best Practices
### General Trading Tips
 
 ORB works best on liquid instruments (stocks with good volume, major crypto pairs)
 First hour of the session is most important - that's when ORB is forming
 Breakouts WITH the trend have higher success rates - use the trend filter
 Failed breakouts are common - use the "Min Bars Outside" setting to filter weak moves
 Not every day produces good ORB setups - be patient and selective
 
### Position Sizing Best Practices
 
 Never risk more than 1-2% of your account on a single trade
 Use the built-in calculator - don't guess your position size
 Update your account size monthly as it grows
 Smaller accounts: use $ Amount mode for simplicity
 Larger accounts: use % of Account mode for scaling
 
### Take Profit Strategy
 
 Most traders use: 50% at TP1, 50% at TP2
 Aggressive: Hold through TP1 for TP2 or TP3
 Conservative: Full exit at TP1 (1:1 risk/reward)
 After TP1 hits, consider moving stop to breakeven
 TP3 rarely hits - only on strong trending days
 
### Filter Combinations
 
 Maximum Quality:  Volume + Trend + FVG (fewest signals, highest quality)
 Balanced:  Volume + Trend (good quality, reasonable frequency)
 Active Trading:  No filters or Volume only (many signals, lower quality)
 Trending Markets:  Trend filter essential (indices, crypto)
 Range-Bound:  Volume + FVG (avoid trend filter)
 
### Common Mistakes to Avoid
 
 Chasing breakouts - wait for the bar to close, don't FOMO into wicks
 Ignoring the stop loss - always use it, move it manually if needed
 Over-leveraging - the calculator shows MAX shares, you can buy less
 Trading every signal - quality > quantity, use filters
 Not tracking results - keep a journal to see what works for YOU
 
## Pros and Cons
### Advantages
 
 Complete all-in-one solution - from signal to position sizing
 Multiple timeframes tracked simultaneously
 Visual clarity - easy to see what's happening
 Cycle tracking catches opportunities others miss
 Built-in risk management eliminates guesswork
 Customizable filters for different trading styles
 No repainting - what you see is locked in
 Works across multiple markets (stocks, forex, crypto)
 
### Limitations
 
 Intraday strategy only - doesn't work on daily charts
 Requires active monitoring during first 1-2 hours of session
 Not suitable for after-hours or extended sessions by default
 Can produce many signals in choppy markets (use filters)
 Dashboard can be overwhelming for complete beginners
 Performance depends on market conditions (trends vs ranges)
 Requires understanding of risk management concepts
 
### Best For
 
 Day traders who can watch the first 1-2 hours of market open
 Traders who want systematic entry/exit rules
 Those learning proper position sizing and risk management
 Active traders comfortable with multiple signals per day
 Anyone trading liquid instruments with clear sessions
 
### Not Ideal For
 
 Swing traders holding multi-day positions
 Set-and-forget / passive investors
 Traders who can't watch market open
 Complete beginners unfamiliar with trading concepts
 Low volume / illiquid instruments
 
## Frequently Asked Questions
 Q: Why are no signals appearing? 
A: Check that you're on an intraday timeframe (5min, 15min, etc.) and that the current time is within your session hours. Also verify that "Enable Breakout Detection" is ON and at least one ORB stage is enabled. If using filters, they might be blocking signals - try disabling them temporarily.
 Q: What's the best ORB stage to use? 
A: ORB15 (15 minutes) is most popular and balanced. ORB5 gives faster signals but more noise. ORB30 and ORB60 are slower but more reliable. Many traders use ORB15 + ORB30 together.
 Q: Should I enable all the filters? 
A: Start with no filters to see all signals. If too many false signals, add Volume filter first (stocks) or Trend filter (trending markets). FVG filter is most restrictive - use for maximum quality but fewer signals.
 Q: How do I know which stop loss method to use? 
A: ATR works for most cases - it adapts to volatility. Use ORB% if you want predictable stop placement. Swing is for respecting chart structure. Safer gives you the most room but largest risk.
 Q: Can I use this for swing trading? 
A: Not really - ORB is fundamentally an intraday strategy. The ranges reset each day. For swing trading, look at weekly support/resistance or moving averages instead.
 Q: Why do TP/SL lines disappear sometimes? 
A: Lines freeze (stop extending) when: stop loss is hit, the last enabled take-profit is hit, or end of session arrives (if "Freeze at EOD" is enabled). This is intentional - the trade is complete.
 Q: What's the difference between "First Only" and "Track Cycles"? 
A: "First Only" shows one breakout UP and one DOWN per day maximum - clean but might miss opportunities. "Track Cycles" shows breakout-retest-rebreak sequences - more signals but busier chart.
 Q: Is position sizing accurate for options/forex? 
A: The calculator is designed for shares (stocks). For options, ignore the share count and use the risk amount. For forex, you'll need to adapt the lot size calculation manually.
 Q: How much capital do I need to use this? 
A: The indicator works for any account size, but practical day trading typically requires $25,000 in the US due to Pattern Day Trader rules. Adjust the "Account Size" setting to match your capital.
 Q: Can I backtest this strategy? 
A: This is an indicator, not a strategy script, so it doesn't have built-in backtesting. You can visually review historical signals or code a strategy script using similar logic.
 Q: Why does the dashboard show different entry price than the breakout label? 
A: If you're looking at an old breakout, the ORB levels may have changed when the next stage completed. The dashboard always shows the CURRENT active range and trade setup.
 Q: What's a good win rate to expect? 
A: ORB strategies typically see 40-60% win rate depending on market conditions and filters used. The strategy relies on positive risk/reward ratios (2:1 or better) to be profitable even with moderate win rates.
 Q: Does this work on crypto? 
A: Yes, but crypto trades 24/7 so you need to define what "session start" means. Use Session Mode = Custom and set your preferred daily reset time (e.g., 0000-2359 UTC).
## Credits & Transparency
### Development
This indicator was developed with the assistance of AI technology to implement complex ORB trading logic.
The strategy concept, feature specifications, and trading logic were designed by the publisher. The implementation leverages modern development tools to ensure:
 
 Clean, efficient, and maintainable code
 Comprehensive error handling and input validation
 Detailed documentation and user guidance
 Performance optimization
 
### Trading Concepts
This indicator implements several public domain trading concepts:
 
 Opening Range Breakout (ORB):  Trading strategy popularized by Toby Crabel, Mark Fisher and many more talanted traders.
 Fair Value Gap (FVG):  Price imbalance concept from ICT methodology
 SuperTrend:  ATR-based trend indicator using public formula
 Risk/Reward Ratio:  Standard risk management principle
 
All mathematical formulas and technical concepts used are in the public domain.
### Pine Script
Uses standard TradingView built-in functions:
 ta.ema(), ta.atr(), ta.vwap(), ta.highest(), ta.lowest(), request.security() 
No external libraries or proprietary code from other authors.
## Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice.
Trading involves substantial risk of loss and is not suitable for every investor. Past performance shown in examples is not indicative of future results.
The indicator provides signals and calculations, but trading decisions are solely your responsibility. Always:
 
 Test strategies on paper before using real money
 Never risk more than you can afford to lose
 Understand that all trading involves risk
 Consider seeking advice from a licensed financial advisor
 
The publisher makes no guarantees regarding accuracy, profitability, or performance. Use at your own risk.
---
 Version:  3.0
 Pine Script Version:  v6
 Last Updated:  October 2024
For support, questions, or suggestions, please comment below or send a private message.
---
 Happy trading, and remember: consistent risk management beats perfect entry timing every time.
Risk Leverage ToolRisk Leverage Tool – Calculate Position Size and Required Leverage
This script automatically calculates the optimal position size and the leverage needed based on the amount of capital you are willing to risk on a trade. It is designed for traders who want precise control over their risk management.
The script determines the distance between the entry and stop-loss price, calculates the maximum position size that fits within the defined risk, and derives the notional value of the trade. Based on the available margin, it then calculates the required leverage. It also displays the percentage of margin at risk if the stop-loss is hit.
All results are displayed in a table in the top-right corner of the chart. Additionally, a label appears at the entry price level showing the same data.
To use the tool, simply input your planned entry price, stop-loss price, the maximum risk amount in dollars, and the available margin in the settings menu. The script will update all values automatically in real time.
This tool works with any market where capital risk is expressed in absolute terms (such as USD), including futures, CFDs, and leveraged spot positions. For inverse contracts or percentage-based stops, manual adjustment is required.
DXY ChecklistDxy Checklist
Used to stay on track on what the market is performing on index market.
Check list asks questions,   when performed we acknowledge the deal done on index.
Adaptive Trend SelectorThe Adaptive Trend Selector is a comprehensive trend-following tool designed to automatically identify the optimal moving average crossover strategy. It features adjustable parameters and an integrated backtester that delivers institutional-grade insights into the recommended strategy. The model continuously adapts to new data in real time by evaluating multiple moving average combinations, determining the best performing lengths, and presenting the backtest results in a clear, color-coded table that benchmarks performance against the buy-and-hold strategy.
At its core, the model systematically backtests a wide range of moving average combinations to identify the configuration that maximizes the selected optimization metric. Users can choose to optimize for absolute returns or risk-adjusted returns using the Sharpe, Sortino, or Calmar ratios. Alternatively, users can enable manual optimization to test custom fast and slow moving average lengths and view the corresponding backtest results. The label displays the Compounded Annual Growth Rate (CAGR) of the strategy, with the buy-and-hold CAGR in parentheses for comparison. The table presents the backtest results based on the fast and slow lengths displayed at the top:
 
 Sharpe = CAGR per unit of standard deviation.
 Sortino = CAGR per unit of downside deviation.
 Calmar = CAGR relative to maximum drawdown.
 Max DD = Largest peak-to-trough decline in value.
 Beta (β) = Return sensitivity relative to buy-and-hold.
 Alpha (α) = Excess annualized risk-adjusted returns.
 Win Rate = Ratio of profitable trades to total trades.
 Profit Factor = Total gross profit per unit of losses.
 Expectancy = Average expected return per trade.
 Trades/Year = Average number of trades per year.
 
This indicator is designed with flexibility in mind, enabling users to specify the start date of the backtesting period and the preferred moving average strategy. Supported strategies include the Exponential Moving Average (EMA), Simple Moving Average (SMA), Wilder’s Moving Average (RMA), Weighted Moving Average (WMA), and Volume-Weighted Moving Average (VWMA). To minimize overfitting, users can define constraints such as a minimum and maximum number of trades per year, as well as an optional optimization margin that prioritizes longer, more robust combinations by requiring shorter-length strategies to exceed this threshold. The table follows an intuitive color logic that enables quick performance comparison against buy-and-hold (B&H):
 
 Sharpe = Green indicates better than B&H, while red indicates worse.
 Sortino = Green indicates better than B&H, while red indicates worse.
 Calmar = Green indicates better than B&H, while red indicates worse.
 Max DD = Green indicates better than B&H, while red indicates worse.
 Beta (β) = Green indicates better than B&H, while red indicates worse.
 Alpha (α) = Green indicates above 0%, while red indicates below 0%.
 Win Rate = Green indicates above 50%, while red indicates below 50%.
 Profit Factor = Green indicates above 2, while red indicates below 1.
 Expectancy = Green indicates above 0%, while red indicates below 0%.
 
In summary, the Adaptive Trend Selector is a powerful tool designed to help investors make data-driven decisions when selecting moving average crossover strategies. By optimizing for risk-adjusted returns, investors can confidently identify the best lengths using institutional-grade metrics. While results are based on the selected historical period, users should be mindful of potential overfitting, as past results may not persist under future market conditions. Since the model recalibrates to incorporate new data, the recommended lengths may evolve over time.
Better DEMAThe  Better DEMA  is a new tool designed to recreate the classical moving average DEMA, into a smoother, more reliable tool. Combining many methodologies, this script offers users a unique insight into market behavior.
 How does it work? 
First, to get a smoother signal, we need to calculate the Gaussian filter. A Gaussian filter is a smoothing filter that reduces noise and detail by averaging data with weights following a Gaussian (bell-shaped) curve.
Now that we have the source, we will calculate the following:
n2 = n/2 (half of the user defined length)
a = 2/(1+n) 
ns 
Now that we have that out of the way, it is time to get into the core.
Now we calculate 2 EMAs:
slow EMA => EMA over n
fast EMA => EMA over n2 period
Rather then now doing this:
DEMA = fast EMA * 2 - slow EMA
I found this to be better:
DEMA = slow EMA * (1-a) + fast EMA * a
As a last touch I took a little something from the HMA, and used a EMA with period of √n to smooth the entire the thing.
The Trend condition at base is the following (but feel free to FAFO with it):
Long = dema > dema yesterday and dema < src
Short = dema < dema yesterday and dema > src
 Methodology 
While the DEMA is an amazing tool used in many great indicators, it can be far too noisy.
This made me test out many filters, out of which the Gaussian performed best.
Then I tried out the non subtractive approach and that worked too, as it made it smoother.
Compacting on all I learned and smoothing it bit by bit, I think I can say this is worth looking into :).
 Use cases: 
Following Trends => classic, effective :)
Smoothing sources for other indicators => if done well enough, could be useful :)
Easy trend visualization => Added extra options for that.
Strategy development => Yes
Another good thing is it does not a high lookback period, so it should be better and less overfit.
That is all for today Gs,
Have fun and enjoy!
Quantum Portfolio vs S&P 500 (Base: May 2, 2021)This script compares the performance of a custom Quantum Portfolio — a weighted basket of quantum computing, semiconductor, and cybersecurity stocks — against the S&P 500 Index, with both series rebased to 100 on May 2 2021.
It provides a clear, normalized view of cumulative returns, allowing you to visualize portfolio outperformance or underperformance relative to the broader market benchmark.
Auto Chart PatternsAuto Chart Patterns automatically scans the chart for major technical patterns and marks them directly on price action. It detects:
• Head & Shoulders (bearish reversal)
• Inverse Head & Shoulders (bullish reversal)
• Rising and Falling Wedges
• Double / Triple Tops and Bottoms
• Cup & Handle (bullish continuation)
For each pattern, the script draws the structure (trendlines / neckline), shades the pattern zone, and places a label with the pattern name.
It also generates optional trade signals:
• “BUY” when a bullish pattern breaks out with confirmation
• “SELL” when a bearish pattern breaks down with confirmation
Confirmations can include:
• Follow-through candle in the breakout direction
• Volume spike vs recent average
• RSI momentum agreement
Inputs let you control:
• Pivot sensitivity (left/right bars)
• Pattern types to display
• Cup & Handle depth rules
• Confirmation rules for entry/exit signals
This tool is designed to help you visually spot reversal and continuation setups, highlight potential breakout levels (necklines / wedge boundaries), and time trades with clearer confirmation instead of guessing.
Disclaimer: This script is for educational/technical analysis purposes only. It does not guarantee future performance, does not execute trades, and is not financial advice. Always confirm signals with your own analysis and risk management before entering any position.
Range Opening (ADX)▶ OVERVIEW 
Range Opening (ADX) dynamically detects market opening ranges triggered by ADX (Average Directional Index) momentum shifts. Upon a user-defined ADX crossover or crossunder event, it builds a volume-based range box that tracks high and low prices over a fixed bar length and visualizes order flow pressure with delta volume and breakout buffer zones.
 
▶ RANGE TRIGGER VIA ADX CROSSOVER 
The range begins when ADX crosses a custom threshold, indicating a shift in trend strength:
Users choose between ADX crossover or crossunder as the trigger.
Once triggered, the indicator starts collecting price and volume data for the specified “Range Opening Length.”
The ADX plot on the subchart is colored dynamically using a green-to-magenta gradient based on its strength.
A small label marks the ADX crossover/crossunder event visually.
 ▶ RANGE DEVELOPMENT BOX 
While the range is forming:
Price highs and lows over the defined period are collected and stored.
A temporary gray box is drawn between the maximum high and minimum low, showing the developing range.
At each bar, delta volume is updated:
Positive if close > open
Negative if close < open
A total delta volume value is shown inside the developing box for real-time monitoring.
 ▶ RANGE COMPLETION & BREAKOUT LINES 
Once the range completes (after the defined bar count):
The gray box is replaced with a finalized, color-coded range box.
Color Logic:
Green box if delta volume is positive (bullish bias)
Magenta box if delta is negative (bearish bias)
Two solid horizontal lines are drawn:
Top line from the range high
Bottom line from the range low
Two dashed lines are added above and below the range using ATR-based buffers, acting as buffer zones.
These lines extend until a new ADX trigger occurs, helping track future price interaction with the range.
 ▶ INFO PANEL & STATUS MONITORING 
A compact data table appears in the top-right corner, offering quick insight:
ADX: Current value, color-coded to strength.
Threshold: User-defined trigger level.
Range Status:
Shows a green diamond when range is still forming.
Shows a magenta diamond after the range has completed.
Tooltip updates to “Developing” or “Formatted” based on stage.
 ▶ USAGE 
Traders can use Range Opening (ADX) to:
Identify periods of strength expansion and price consolidation using ADX signals.
Track breakout potential and liquidity zones formed during opening-type setups.
Monitor delta volume to gauge buying/selling bias inside short-term ranges.
Use ATR buffer zones for breakout confirmation or fade setups.
Visually mark where the most recent structured range was defined.
 ▶ CONCLUSION 
Range Opening (ADX) offers a systematic method to detect and monitor market ranges triggered by volatility surges. With real-time delta volume insight, persistent breakout levels, and ADX-driven logic, it serves as a versatile tool for both breakout traders and range strategists looking to capitalize on momentum-based setups.
Trend Pivot Retracements▶ OVERVIEW 
Trend Pivot Retracements   identifies market trend direction using a Donchian-style channel and dynamically highlights retracement zones during trending conditions. It calculates the percentage pullbacks from recent highs and lows, plots labeled zones with varying intensity, and visually connects key retracement pivots. The indicator also emphasizes price proximity to trend boundaries by dynamically adjusting the thickness of plotted trend bands.
 ▶ TREND DETECTION & BAND STRUCTURE 
The indicator determines the current trend by checking for new 50-bar extremes:
Uptrend: If a new highest high is made, the trend is considered bullish.
Downtrend: If a new lowest low is made, the trend is considered bearish.
Uptrend Band: Plots the 50-bar lowest low as a trailing support level.
Downtrend Band: Plots the 50-bar highest high as a trailing resistance level.
Thickness Variation: The thickness of the band increases the further price moves from it, indicating overextension.
 ▶ RETRACEMENT LABELING SYSTEM 
During a trend, the indicator monitors pivot points in the opposite direction to measure retracements:
Bullish Retracement:
Triggered when a pivot low forms during an uptrend.
Measures % pullback from the most recent swing high (searched up to 20 bars back).
Plots a bold horizontal line at the low and a dashed diagonal from the previous swing high.
Adds a “-%” label above the low; intensity is based on recent 50 pullbacks.
Bearish Retracement:
Triggered when a pivot high forms during a downtrend.
Measures % pullback from the previous swing low (up to 20 bars back).
Plots a bold horizontal line at the high and a dashed diagonal from the prior swing low.
Adds a “%” label below the high with gradient color based on the past 50 extremes.
 
▶ PIVOT CONNECTION LINES 
Each retracement includes a visual connector:
A diagonal dashed line linking the swing extreme (20 bars back) to the retracement point.
This line visually traces the path of price retreat within the trend.
Helps traders understand where the retracement originated and how steep it was.
 ▶ TREND SWITCH SIGNALS 
When trend direction changes:
A diamond marker is plotted on the new pivot confirming the trend shift.
Green diamonds signal new bullish trends at fresh lows.
Magenta diamonds signal new bearish trends at fresh highs.
 ▶ COLOR INTENSITY & CONTEXTUAL AWARENESS 
To help interpret the magnitude of retracements:
The % labels are color-coded using a gradient scale that references the max of the last 50 pullbacks.
Stronger pullbacks result in deeper color intensity, signaling more significant corrections.
Trend bands also use standard deviation normalization to adjust line thickness based on how far price has moved from the band.
This creates a visual cue for potential exhaustion or volatility extremes.
 ▶ USAGE 
Trend Pivot Retracements is a powerful tool for traders who want to:
Identify trend direction and contextual pullbacks within those trends.
Spot key retracement points that may serve as entry opportunities or reversal signals.
Use visual retracement angles to understand market pressure and trend maturity.
Read dynamic band thickness as an alert for price stretch, potential mean reversion, or breakout setups.
 ▶ CONCLUSION 
Trend Pivot Retracements   gives traders a clean, visually expressive way to monitor trending markets, while capturing and labeling meaningful retracements. With adaptive color intensity, diagonal connectors, and smart trend switching, it enhances situational awareness and provides immediate clarity on trend health and pullback strength.
HTF Session Boxes H4 > H2 > H1HTF Session Boxes H4 > H2 > H1
Visualize higher timeframe candle structures on lower timeframe charts with nested, customizable boxes.
 Overview 
HTF Session Boxes plots 4-hour, 2-hour, and 1-hour candle ranges as nested boxes directly on your lower timeframe charts (15M and below). This provides instant visual context of higher timeframe structure without switching between different chart timeframes.
 Key Features 
- Three Timeframe Levels: Simultaneously displays 4H, 2H, and 1H candle boxes
- Nested Design: Boxes are layered inside each other for clear hierarchical structure
- Real-Time Updates: Boxes dynamically adjust as higher timeframe candles develop
 Fully Customizable: 
-Individual colors and transparency for each timeframe
-Custom border colors, widths, and styles (solid, dashed, dotted)
-Toggle each timeframe on/off independently
 Best Use Cases 
-Scalping & Day Trading: Maintain awareness of higher timeframe structure while trading lower 
 timeframes
-Session Analysis: Clearly see 4H session boundaries and internal 2H/1H divisions
-Support/Resistance: Identify key levels where higher timeframe candles open, close, or create 
 highs/lows
-Multi-Timeframe Confluence: Spot when multiple timeframes align at key price levels
Quantum Portfolio vs NASDAQ (Base: May 2, 2021)This custom Pine Script indicator tracks and compares the cumulative performance of a multi-asset “Quantum Portfolio” against the NASDAQ 100 benchmark, rebased to a common starting point on May 2, 2021.
Both series are normalized to a base value of 100 on that date, allowing direct visual comparison of percentage growth or decline over time.
50-Minute Opening Range BreakoutThis is a test of the opening range with Bearish/Bullish confirmation
Renko ATR Trend + SMA Indicator by YCGH Capital🧭 Overview
The Renko ATR Trend + SMA Indicator is a trend-following tool designed for chart trading.
It combines Renko-style price movement logic (based on ATR) with a Simple Moving Average (SMA) filter to identify sustained bullish or bearish phases on any timeframe.
It plots a color-coded trend line directly on the price chart — green for bullish trends, red for bearish — and maintains a single active state (no repeated buy/sell signals) until the opposite condition appears.
⚙️ How It Works
1️⃣ Renko ATR Engine
Instead of using fixed box sizes like classic Renko charts, this indicator builds synthetic Renko movement based on ATR (Average True Range) of a chosen timeframe.
It pulls OHLC data from your selected Renko Source Timeframe (for example, 60-minute candles).
It calculates an ATR brick size — representing the minimum price move needed for a new Renko brick.
When price moves by at least one ATR in the opposite direction, it flips the trend.
This filters out small fluctuations and captures the underlying directional bias.
2️⃣ SMA Filter
A Simple Moving Average (SMA) acts as a trend confirmation filter.
Only when Renko direction aligns with the price relative to the SMA, a trend signal activates.
BUY → Renko uptrend + price above SMA
SELL → Renko downtrend + price below SMA
3️⃣ Stateful Signal Logic
Unlike typical indicators that spam multiple buy/sell shapes:
This version holds one persistent signal (Buy or Sell)
The state continues until an opposite signal is confirmed
No “continuation” arrows — clean and minimal trend visualization
🎨 Visuals
Element	Meaning
🟩 Green Renko Line	Active Bullish Trend
🟥 Red Renko Line	Active Bearish Trend
⚪ Gray Line	Neutral / Waiting phase
🟡 Yellow Line	SMA (trend filter)
📍 Label (Buy Active / Sell Active)	Displays the current market bias
🔧 Inputs
Input	Description
Renko Source Timeframe	The timeframe from which Renko data is calculated (e.g., 60 = 1h candles).
ATR Period	Determines brick size sensitivity (lower = more responsive, higher = smoother).
SMA Length	Moving Average length used as a directional filter.
💡 How Traders Use It
Trend Confirmation:
Use green/red Renko line to stay aligned with the dominant market move.
Entry Timing:
Enter trades when a new Renko direction is confirmed along with SMA alignment.
Exit or Reverse:
Exit long when a red line (Sell Active) appears, and vice versa.
Combine with Price Action:
Add support/resistance or volume analysis for confirmation.
FX Realized Volatility *The downward signal for Euqities!?*The Russel 2000 put in a new ath today as capital is moving further out the risk curve. Risk-Assets continue to rally to the upside.
This will last until we see a lasting driver happening on a real time basis that drag  pull equties down
When volatility rises, we need to see the DRIVER of the volatility have persistence behind it as opposed to one off shocks. 
We are not there yet as volatility in FX and bonds continues to compress since the April lows in equities.
Equities will continue to rally until long end yields blow out or the carry trade unwinds. Long end yields blowing out is not occuring on an imminent basis but the FX side of things could be a significant risk soon.
 Its all about: When will that liquidity beginn to create inflation or a problem in the currency 
Monitoring the equity vol, Bond vol and FX volatiliy is crucial here
You can watch them via: 
VIX, 
Move, 
+ i build an Trading view modell which conducts the vol of the major FX pairs.
(its 100% free)
If you just want it simple, just look at USD & EUR vol as they are the most trades foreign exchange currencies.
Watching these 2 Risks (Vol & long-end) will put you upfront most people in the market.
Once we see information in the underlying economy shifting i will adjust my views as they relate to every major asset class.
But for now we are likely moving higher in basically every risky asset.
**Feel free to ask me any questions**
XAUUSD 5m — NY Supertrend+RSI Optimizer (1:2 RR) — $240k/orderThis strategy is built for XAUUSD (Gold) on the 5-minute timeframe, focusing exclusively on the New York trading session (08:00–17:00 NY time) — the most volatile and liquid hours of the day.
It combines a Supertrend trend filter with RSI momentum signals to identify high-probability entries, using a 1:2 risk–reward ratio for disciplined trade management.
🧠 Strategy Logic:
Buy Condition: RSI crosses above 55 while Supertrend indicates an uptrend
Sell Condition: RSI crosses below 45 while Supertrend indicates a downtrend
Session Filter: Trades only between 08:00 → 17:00 New York time
Risk/Reward: 1:2 (Take-Profit = 2× Stop-Loss distance from Supertrend line)
Position Size: $240,000 notional per order
Auto-Exit: Closes all trades at NY session end
⚡ Highlights:
Targets NY session volatility
Combines trend + momentum for cleaner entries
Strict 1:2 RR for consistent outcomes
Avoids overnight exposure
⚠️ Disclaimer:
This script is intended for educational and research purposes only.
Past performance is not indicative of future results.
Always forward-test on demo before using live capital.
XAUUSD 5m — CET 13:00→01:00 Supertrend + RSI (1:2 RR) — $240KThis strategy is designed for XAUUSD (Gold) on the 5-minute chart, optimized for trading during the most active hours (13:00–01:00 CET).
It combines a Supertrend direction filter with RSI crossovers for precise entries, and applies a 1:2 risk–reward ratio for consistent risk management.
🧠 Logic Overview:
Buy Signal: RSI crosses above 55 while Supertrend is bullish
Sell Signal: RSI crosses below 45 while Supertrend is bearish
Trading Hours: 13:00 → 01:00 CET (corresponding to 07:00 → 19:00 New York time)
Risk Management: Fixed 1:2 RR (TP = 2× SL distance from Supertrend line)
Session Management: Automatically closes all trades after 01:00 CET
Order Size: $240,000 notional exposure per position
💡 Best used for:
Scalping or intraday trading on XAUUSD during high-volatility hours.
The setup works best when combined with strong price action or volume confirmation.
⚠️ Disclaimer:
This script is for educational and testing purposes only.
Past performance does not guarantee future results.
Always test on demo before using live funds.
Candle Size MonitorCandle Size Monitor – Description 
Update 27.10.25
Objective Volatility Assessment
The Candle Size Monitor helps traders assess actual market movement—regardless of whether candles appear visually large or small on the chart. It supports evaluating whether your planned trade structure (e.g., stop-loss, take-profit) aligns with current volatility.
Key Features
Volatility Analysis:
Calculates the average candle size (difference between high and low) over a user-defined number of candles.
Identifies the largest candle in the selected period.
Displays results in a compact table on the chart.
Exchange Rate Integration (optional):
Shows the current USD-EUR exchange rate (formatted with German-style comma and four decimal places).
Useful for traders in USD-denominated markets who apply EUR-based risk management rules.
Customizable Display:
Text Size: Small, medium, or large.
Colors: Customizable text and background colors.
Table Position: Top/bottom left/right.
Number of Candles: User-defined (default: 20).
Dynamic Updates:
The table updates with each new bar.
The exchange rate is fetched in real-time from OANDA:EURUSD.
Settings and Translations
Settings
Anzahl Kerzen → Number of Candles (Number of candles for calculation, default: 20).
Textgröße → Text Size (Text size in the table: small, medium, large).
Textfarbe → Text Color (Text color, default: white).
Hintergrundfarbe → Background Color (Background color of the table, default: black).
Position → Position (Table position: Top Left, Top Right, Bottom Left, Bottom Right).
Wechselkurs anzeigen (USD → EUR) → Show Exchange Rate (USD → EUR) (Option to display the exchange rate).
Table Contents and Translations
The table displays the following information (with German formatting):
Ø Größe (N):  
English: "Avg Size (N):  " (Average candle size over the last N candles).
Example: "Ø Größe (20): 15,3" → "Avg Size (20): 15.3".
Größte Kerze:  
English: "Largest Candle:  " (Largest candle size in the selected period).
Example: "Größte Kerze: 42,7" → "Largest Candle: 42.7".
1 USD =   € (only if enabled)
English: "1 USD =   EUR" (Current USD-EUR exchange rate, formatted with a comma).
Example: "1 USD = 0,9234 €" → "1 USD = 0.9234 EUR".
Sultan_Mstrading Dynamic Levels (Auto-Market Final Version)The Sultan_Mstrading Dynamic Levels indicator automatically generates dynamic support and resistance levels based on the market type or trading symbol (such as Gold, Bitcoin, Indices, Oil, or Forex pairs).
It plots multiple levels above and below the current price with adjustable spacing, and automatically highlights the nearest level to the current price for quick visual reference
Gap Finder v6Detects unfilled price gaps with clean lines and labels with percentage size of the gap.  Lines extend 16 bars and labels extend 14 bars past last bar.






















