Triple SMA3 customizable SMAs with adjustable lengths, colors, and line widths
Toggle each SMA on/off independently
Labels at end of each line showing the period
Values table showing current SMA values and distance from current price (%)
Grouped settings for easy configuration
Defaults: 20 (yellow), 50 (blue), 200 (red)
지표 및 전략
UK NQ: Custom Day, Dynamic BreakThe Problem
For UK-based traders focusing on the Nasdaq (NQ) or S&P 500 (ES), the trading day is usually split into two high-probability windows: the London Morning and the New York Open. However, every year in March and October, the US and UK change their clocks on different dates. During these 4 "Mismatch Weeks," the US market opens at 13:30 UK time instead of the usual 14:30.
If your session highlighter is fixed, your lunch break will be out of sync, causing you to miss the critical US pre-market volatility or trade during the "Lunch Lull."
The Solution
This indicator is a "Smart" session manager specifically designed for the UK timezone (Europe/London). It allows you to set your preferred working hours (e.g., 09:15 to 17:15) but dynamically recalculates your internal lunch break based on the live relationship between the London and New York exchange clocks.
Key Features
Dynamic "Smart Break" Logic: The script identifies when the US has "Sprung Forward" or the UK has "Fallen Back" earlier than the other. It automatically shifts your 90-minute lunch break 1 hour earlier (from 12:00 to 11:00) during those weeks.
Fixed Work Window: Your overall trading day (Start/End times) remains fixed to your local UK clock, while only the internal high-volume windows shift to stay aligned with Wall Street.
Universal Backtesting (2020–2030): Unlike basic highlighters, this script contains a built-in mathematical calendar for DST shifts. It is 100% accurate for historical backtesting across the last 5 years and the next 5 years.
Customizable Inputs: Easily adjust your start time (e.g., 09:00 vs 09:15) and finish time to suit your personal trading plan.
How to Read the Chart
Blue Zone (London Morning): Highlights the trend established by European institutional flow.
Uncolored Zone (The Break): Represents the "Lunch Lull." A visual cue to stay flat during lower liquidity.
Green Zone (US Open/Overlap): Highlights the surge in volume starting with US Economic Data (13:30/12:30) and the New York Opening Bell.
Perfect For:
Intraday traders based in the UK who want a "set and forget" solution that ensures they are always at their desk exactly 1 hour before the US market opens, regardless of what the clocks are doing.
UK Dual-Session Highlighter (Fixed Day, Dynamic Break)Overview
Specifically engineered for UK-based Nasdaq (NQ) and US Index traders who operate on a fixed professional schedule (09:15 – 17:15 UK Time).
The primary challenge for UK traders is the 4-week annual "Timezone Mismatch" between London and New York (occurring in March and October). During these weeks, the US market opens at 13:30 UK time instead of the usual 14:30. This indicator solves that problem by automatically shifting your 90-minute lunch break to ensure you are always back at your desk exactly 1 hour before the Wall Street opening bell.
The "Smart Break" Logic
The indicator maintains a strict 09:15 start and 17:15 finish, but dynamically re-calculates the internal "Lunch Lull" based on the live US/UK offset:
Standard Weeks (5hr Offset):
Morning: 09:15 – 12:00 | Break: 12:00 – 13:30 | Afternoon: 13:30 – 17:15
Mismatch Weeks (4hr Offset):
Morning: 09:15 – 11:00 | Break: 11:00 – 12:30 | Afternoon: 12:30 – 17:15
Key Features (2020–2030 Ready)
Universal Backtesting: Unlike basic session highlighters, this script uses a mathematical calendar to identify DST mismatch dates for any year between 2020 and 2030. Perfect for verifying historical strategy performance.
Zero-Maintenance: Automatically detects when the US "Springs Forward" or the UK "Falls Back" earlier than the other.
Volatility Sync: Ensures your afternoon trading session always begins during the high-volume US Pre-Market window (1 hour before the NYSE open).
Visual Clarity: Uses distinct colors to separate the London Morning trend from the New York Open overlap.
How to Use
Blue Zone (Morning): Trade the London session momentum.
Uncolored Zone (Break): The "Lunch Lull." Step away from the screens during lower liquidity.
Green Zone (Afternoon): Focus on US Economic Data (8:30 AM ET) and the 14:30 (or 13:30) New York Open.
Settings
All times are hard-coded to Europe/London standards. No manual timezone adjustments are required on your chart settings.
_MyLibraryV1Library "_MyLibraryV1"
maStackedBull(src, fastLen, midLen, slowLen)
Parameters:
src (float)
fastLen (int)
midLen (int)
slowLen (int)
maStackedBear(src, fastLen, midLen, slowLen)
Parameters:
src (float)
fastLen (int)
midLen (int)
slowLen (int)
bullCross(src1, src2)
Parameters:
src1 (float)
src2 (float)
bearCross(src1, src2)
Parameters:
src1 (float)
src2 (float)
bullRegime(src, len)
Parameters:
src (float)
len (int)
bearRegime(src, len)
Parameters:
src (float)
len (int)
rsiBull(len)
Parameters:
len (simple int)
rsiBear(len)
Parameters:
len (simple int)
atrExpansion(len)
Parameters:
len (simple int)
atrContraction(len)
Parameters:
len (simple int)
Candle Countdown TimerShows the remaining time left for the current candle based on the chart’s selected timeframe.
Quant Seasonality ProQuant Seasonality Pro (QuantSeaz)
Quant Seasonality Pro is a data-driven seasonal projection tool that extracts historical day-of-year return patterns and transforms them into a forward-looking price curve. Using log returns, cycle filters, and volatility-based scaling (ATR), it generates a dynamically anchored seasonal roadmap directly on your chart.
The indicator allows you to switch between Trading Days (stocks/forex) and Calendar Days (crypto), apply U.S. election cycle filters, and analyze precisly historical data. The projected curve is detrended to isolate true seasonal structure and then scaled to current market volatility for realistic visualization.
A built-in statistical dashboard provides:
Confidence (%) based on historical win rates
Expected Alpha (%) over the selected forward window
ATR % (noise level)
Viability ratio (Alpha adjusted for risk)
This tool is designed for contextual edge — not signal automation. It helps traders align positioning with historical seasonal tendencies while maintaining proper risk management and independent confirmation.
Hope you enjoy it
Seasonality (100% reliable for the W)Quant Seasonality Pro (QuantSeaz)
Quant Seasonality Pro is a data-driven seasonal projection tool that extracts historical day-of-year return patterns and transforms them into a forward-looking price curve. Using log returns, cycle filters, and volatility-based scaling (ATR), it generates a dynamically anchored seasonal roadmap directly on your chart.
The indicator allows you to switch between Trading Days (stocks/forex) and Calendar Days (crypto), apply U.S. election cycle filters, and analyze historical data precisly. The projected curve is detrended to isolate true seasonal structure and then scaled to current market volatility for realistic visualization.
A built-in statistical dashboard provides:
Confidence (%) based on historical win rates
Expected Alpha (%) over the selected forward window
ATR % (noise level)
Viability ratio (Alpha adjusted for risk)
This tool is designed for contextual edge — not signal automation. It helps traders align positioning with historical seasonal tendencies while maintaining proper risk management and independent confirmation.
TorHzpk EMA with Config & Values (v5) + Cross AlertsTorHzpk EMA with Config & Values (v5) + Cross Alerts
stelaraX - Chaikin Money FlowstelaraX – Chaikin Money Flow
stelaraX – Chaikin Money Flow is a volume-based momentum indicator designed to measure buying and selling pressure over a defined period. By combining price location within the candle and traded volume, it helps identify whether capital is flowing into or out of an asset.
This indicator is part of the stelaraX ecosystem, focused on clean technical analysis and AI-supported chart evaluation
stelarax.com
Core logic
The Chaikin Money Flow (CMF) evaluates where the closing price lies within the high–low range and weights this position by volume. The result is averaged over a user-defined lookback period and normalized by total volume.
Key principles:
* closes near the high contribute positive money flow
* closes near the low contribute negative money flow
* values above zero indicate net buying pressure
* values below zero indicate net selling pressure
* higher absolute values reflect stronger conviction
Readings beyond typical threshold levels suggest sustained accumulation or distribution rather than short-term noise.
Visualization
The script plots:
* the Chaikin Money Flow as a histogram in a separate indicator pane
* green bars when CMF values are positive
* red bars when CMF values are negative
* a zero reference line for directional context
* additional reference levels at +0.05 and −0.05 for pressure strength
This layout makes shifts in capital flow and volume-backed momentum easy to interpret.
Use case
This indicator is intended for:
* identifying accumulation and distribution using volume flow
* confirming trend direction with volume confirmation
* spotting divergences between price and money flow
* filtering false breakouts and weak price moves
* supporting volume-based and smart money concepts
It works particularly well when combined with price structure, trend filters, or AI-assisted chart evaluation.
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
UK Dual-Session HighlighterOverview
This indicator is a specialized volatility-window tool designed for traders operating in UK Time (Europe/London). It specifically isolates the two highest-probability trading windows for the Nasdaq (NQ) and other US/European indices, while intentionally leaving the "Lunch Lull" period unhighlighted to help traders avoid low-liquidity "chop."
The Dual-Session Strategy
The script highlights two distinct phases of the trading day:
London Morning (09:15 – 12:00): Captures the core European institutional flow and the establishment of the morning trend.
The US Active Window (13:30 – 17:15): Covers the critical 13:30 US Economic Data releases, the 14:30 New York Open, and the high-volume London-NY Overlap.
Key Features for 2026
Timezone Locked: Hard-coded to Europe/London. You do not need to adjust your chart settings; the indicator stays accurate regardless of your local time.
Automatic DST Handling: Fully compatible with 2026 Daylight Saving transitions (GMT/BST). It automatically adjusts when the UK clocks change in March and October.
The "Lunch Lull" Filter: By leaving the 12:00–13:30 window blank, the indicator provides a visual "stop" signal during the period when London traders are at lunch and US pre-market volume is typically at its lowest.
Fully Customizable: Toggle sessions on/off and adjust colors, transparency, and specific start/end times via the Inputs menu.
Palko Long 1 This confirms
RSI > 70
High Vol on 4HR
At least 2 1Hr candles have high vol
****** Need to check 15 min rule manually *****
CTR Dual Custom MAs ProFurther improved indicator with easier access to seeing only bearish signals or bullish signals or both by using the Global Bias drop down option. Simplifies everything so you can quickly see what you want without having to check all the different boxes for bull signals and bear signals.
stelaraX - Accumulation/DistributionstelaraX – Accumulation/Distribution
stelaraX – Accumulation/Distribution is a volume-based indicator designed to analyze buying and selling pressure by combining price movement with traded volume. It helps traders assess whether an asset is being accumulated (smart money buying) or distributed (selling pressure), even when price action appears sideways or unclear.
This indicator is part of the stelaraX ecosystem, focused on clean technical analysis and AI-supported chart evaluation
stelarax.com
Core logic
The Accumulation/Distribution (A/D) line evaluates where the closing price sits within the candle range and weights this position by volume.
Key principles:
* closes near the high with high volume increase the A/D value (accumulation)
* closes near the low with high volume decrease the A/D value (distribution)
* values are cumulatively summed, creating a running pressure profile
* a simple moving average (SMA) of the A/D line is applied for smoothing and trend confirmation
A rising A/D line indicates underlying buying pressure, while a falling A/D line signals increasing selling pressure.
Visualization
The script plots:
* the Accumulation/Distribution line in a separate indicator pane
* a configurable moving average of the A/D line
* customizable colors for both the raw A/D line and its moving average
This clean layout makes shifts in volume-backed momentum and pressure changes easy to spot.
Use case
This indicator is intended for:
* identifying accumulation and distribution phases
* confirming trend strength using volume confirmation
* spotting divergences between price and volume pressure
* filtering false breakouts in low-quality price moves
* supporting smart money and volume-based trading concepts
It works especially well when combined with price structure, trend filters, or AI-assisted chart interpretation.
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
Sam BB V14 Bollinger Bands Ribbon with custom inter-band fills looks well-structured and mostly correct for Pine Script v5. It implements:
Four independent, customizable Bollinger Band sets (different lengths, MA types, multipliers, sources, colors)
Individual inner fills (inside each band)
Inter-band "ribbon" fills (the zones between bands on both upper and lower sides)
Toggle visibility per band
Clean input grouping
Design by Sam Mahboubeh, V1
Custom Time Highlighter (UK time adjusted)Overview
This indicator is designed to visually isolate a specific custom time window on your chart.
It automatically adjusts for British Summer Time (BST) and Greenwich Mean Time (GMT) transitions, ensuring your session start and end times remain accurate throughout the year.
Customizable Window: While the default is set to 9:15 AM - 5:15 PM, users can easily modify the session hours via the input settings.
DafeSPALibDafeSPALib: The Shadow Portfolio Adaptation & Strategy Selection Engine
This is not a backtester. This is a live, adaptive portfolio manager. It is a reinforcement learning system that learns which of your strategies to trust in the ever-changing chaos of the market.
█ CHAPTER 1: THE PHILOSOPHY - BEYOND A SINGLE STRATEGY
The search for a single "holy grail" trading strategy is a fool's errand. No single set of rules can perform optimally in all market conditions. A trend-following system that thrives in a bull run will be decimated by a choppy, range-bound market. A mean-reversion strategy that profits from ranges will be run over by a powerful breakout.
The DafeSPALib (Shadow Portfolio Adaptation Library) was created to solve this fundamental problem. It is built on a powerful principle from modern quantitative finance: instead of searching for one perfect strategy, a truly robust system should intelligently allocate to a portfolio of different strategies, dynamically favoring the one that is currently most effective.
This is not just a concept; it is a complete, production-grade engine built in Pine Script. It allows a developer to run multiple "shadow portfolios"—hypothetical trading accounts for each of your strategies—in parallel, in real time. The library tracks the actual equity curve, win rate, Sharpe ratio, and drawdown of each strategy. It then uses a sophisticated selection algorithm to determine which strategy is the "alpha" in the current market regime and tells you which one to follow. It is an AI portfolio manager that lives on your chart.
█ CHAPTER 2: THE CORE INNOVATIONS - WHAT MAKES THIS A REVOLUTIONARY ENGINE?
This library is not a simple strategy switcher. It is a suite of genuine, academically recognized machine learning and statistical concepts, adapted for the Pine Script environment.
Shadow Portfolio Tracking: This is the heart of the system. For each of your strategy "arms," the library maintains a complete, independent set of performance analytics. It doesn't just keep a simple "score." It tracks every hypothetical trade, calculates real P&L;, and updates a full suite of institutional metrics, including the Sharpe Ratio (risk-adjusted return), Sortino Ratio (downside-risk-adjusted return), Profit Factor , and Maximum Drawdown . This provides a rich, data-driven foundation for all decision-making.
Advanced Selection Algorithms: The library doesn't just pick the strategy with the highest recent win rate. It uses sophisticated, battle-tested algorithms from the "multi-armed bandit" problem in machine learning to solve the critical "explore vs. exploit" dilemma:
Thompson Sampling: The default and most powerful. Instead of just picking the "best" arm, it samples from each arm's learned probability distribution of success (its Beta distribution). This naturally balances "exploitation" (using the strategy that works) with "exploration" (giving less-proven strategies a chance to shine), making it incredibly robust against changing conditions.
Upper Confidence Bound (UCB): A deterministic algorithm that is "optimistic in the face of uncertainty." It favors strategies that have both a high win rate and a high degree of uncertainty (fewer trades), encouraging intelligent exploration.
Epsilon-Greedy: A classic RL algorithm that mostly exploits the best-known strategy but, with a small probability (epsilon), explores a random one to prevent getting stuck on a sub-optimal choice.
Trauma-Based Memory Compression: This is a groundbreaking, proprietary concept. When the market experiences a "regime shock" (a sudden explosion in volatility, a violent trend reversal), a simple learning system can be paralyzed or make catastrophic errors. The SPA engine's "trauma" cycle is an intelligent response. It does not erase all learned knowledge. Instead, it compresses the memory : it preserves the direction of what it has learned (e.g., "Strategy A is generally better than B") but it destroys the confidence. The AI "remembers" its experiences but becomes highly uncertain, forcing it to re-learn and adapt to the new market personality with incredible speed. Think of it like PTSD for an AI: the memory of the event remains, but the trust is shattered.
Multi-Layer Concept Drift Detection: This is the system's "earthquake detector." It is constantly scanning for signs that the market's fundamental character is changing ("concept drift"). It uses three layers of detection— Structural (trend slope changes), Volatility (ATR explosions), and Participation (volume anomalies)—to identify a regime shock and trigger the trauma compression cycle.
█ CHAPTER 3: A DUAL-PURPOSE FRAMEWORK - MODES OF OPERATION
This library, along with its companion DAFE libraries, is designed for ultimate flexibility. As a developer, you have complete freedom to use these tools independently or as a fully integrated system.
MODE 1: STANDALONE ENGINE OPERATION (Independent Power)
The DafeSPALib can be used entirely on its own to build a powerful portfolio-of-strategies indicator without any external ML. This approach is perfect for comparing, validating, and dynamically selecting from your own existing, rule-based trading ideas.
The Workflow:
Your indicator initializes the SPA engine with a set number of "arms" (e.g., 4).
On each bar, you calculate the signals for each of your independent strategies (e.g., an EMA Crossover, an RSI Mean Reversion, a Bollinger Breakout).
You feed this array of signals ( ) into the SPA's feed_signals() function.
The SPA engine updates the shadow portfolio for each of the four strategies based on these signals. You then call the select() function, and the SPA's chosen algorithm (e.g., Thompson Sampling) will return the index of the single strategy arm that it trusts the most right now.
Your indicator's final output signal is the signal from that selected arm.
The Result: A complete, self-contained meta-strategy. Your indicator is no longer just one strategy; it is an intelligent manager that dynamically switches between multiple strategies, adapting to the market by selecting the one with the best real-time, risk-adjusted performance.
MODE 2: BRIDGED SUPER-SYSTEM OPERATION (The Ultimate AI)
This is the pinnacle of the DAFE ecosystem. In this advanced mode, the DafeSPALib acts as the "strategic brain" or "portfolio manager" that is fused with a tactical machine learning engine (like the DafeRLMLLib) via a master communication protocol (the DafeMLSPABridge).
The Workflow:
The ML engine generates proposals.
The Bridge Library translates these proposals into a portfolio of micro-strategies.
The SPA engine (this library) receives this portfolio of signals, tracks their shadow performance, and uses its advanced selection algorithms to choose the single best micro-strategy to follow. This becomes the final trade decision.
The final P&L; from the SPA's selection is then routed back through the Bridge to the ML engine as a highly qualified reward signal for learning.
The Result: A hybrid intelligence that is more robust and adaptive than either system alone. The ML provides tactical creativity, while the SPA provides ruthless, performance-based strategic oversight.
█ CHAPTER 4: THE DEVELOPER'S MASTERCLASS - IMPLEMENTATION GUIDE
This library is a professional framework. This guide provides the complete, unabridged instructions and templates required to integrate the DAFE SPA engine into your own custom Pine Script indicators.
PART I: THE INPUTS TEMPLATE (THE CONTROL PANEL)
To give your users full control over the AI, copy this entire block of inputs into your indicator script. It is professionally organized with groups and detailed tooltips.
// ╔════════════════════════════════════════════════════════╗
// ║ INPUTS TEMPLATE (COPY INTO YOUR SCRIPT) ║
// ╚════════════════════════════════════════════════════════╝
// INPUT GROUPS
string G_SPA_ENGINE = "════════════ 🧠 SPA ENGINE ════════════"
string G_SPA_DRIFT = "════════════ 🌊 CONCEPT DRIFT ══════════"
string G_SPA_DASH = "════════════ 📋 DIAGNOSTICS ═══════════"
// SPA ENGINE
int i_spa_num_arms = input.int(4, "Number of Strategy Arms", minval=2, maxval=10, group=G_SPA_ENGINE,
tooltip="The number of parallel strategies the SPA will track.")
string i_spa_selection = input.string("Thompson Sampling", "🤖 Selection Algorithm",
options= , group=G_SPA_ENGINE,
tooltip="The machine learning algorithm used to select the best arm. " +
"• Thompson Sampling: Bayesian approach, samples from each arm's success probability. Balances explore/exploit perfectly (Recommended). " +
"• UCB: Optimistic approach that favors arms with high uncertainty. Excellent for exploration. " +
"• Epsilon-Greedy: Mostly exploits the best arm, but explores randomly with a small probability (epsilon). " +
"• Softmax: Selects arms based on a probability distribution weighted by their performance.")
float i_spa_epsilon = input.float(0.15, "🧭 Epsilon (for Epsilon-Greedy)", minval=0.01, maxval=0.5, step=0.01, group=G_SPA_ENGINE,
tooltip="The probability of taking a random action to explore. This value automatically decays over time.")
float i_spa_decay = input.float(0.995, "🧠 Memory Decay Rate", minval=0.98, maxval=0.9999, step=0.0005, group=G_SPA_ENGINE,
tooltip="Controls recency bias. A value of 0.995 means the AI gives slightly more weight to recent performance. Lower values create a very short-term memory.")
// CONCEPT DRIFT & TRAUMA
bool i_spa_use_drift = input.bool(true, "🌊 Enable Concept Drift & Trauma", group=G_SPA_DRIFT,
tooltip="Allows the engine to detect market regime shocks and trigger a 'Trauma Compression' cycle to accelerate re-learning.")
float i_spa_trauma_sens = input.float(2.0, "Trauma Sensitivity", minval=1.2, maxval=4.0, step=0.1, group=G_SPA_DRIFT,
tooltip="How sensitive the shock detector is. A lower value will trigger trauma cycles more frequently on smaller volatility/volume spikes.")
// DIAGNOSTICS
bool i_spa_show_dash = input.bool(true, "📋 Show Diagnostics Dashboard", group=G_SPA_DASH)
PART II: THE IMPLEMENTATION LOGIC (THE HEART OF YOUR SCRIPT)
This is the boilerplate code you will adapt to your indicator. It shows the complete loop of feeding signals, detecting drift, and selecting the best strategy.
// ╔═══════════════════════════════════════════════════════╗
// ║ USAGE EXAMPLE (ADAPT TO YOUR SCRIPT) ║
// ╚═══════════════════════════════════════════════════════╝
// 1. INITIALIZE THE ENGINE (happens only on the first bar)
int sel_method_id = i_spa_selection == "Thompson Sampling" ? 0 : i_spa_selection == "Upper Confidence Bound (UCB)" ? 1 : i_spa_selection == "Epsilon-Greedy" ? 2 : 3
var spa.SPAEngine engine = spa.init(
num_arms = i_spa_num_arms,
arm_names = array.from("TrendArm", "ReversionArm", "BreakoutArm", "MomentumArm"), // Give your arms names!
selection_method = sel_method_id,
decay_rate = i_spa_decay,
trauma_sensitivity = i_spa_trauma_sens,
epsilon = i_spa_epsilon
)
// 2. DEFINE YOUR STRATEGY SIGNALS (runs on every bar)
// These are your own custom, rule-based strategies. The signal should be +1 for Buy, -1 for Sell, 0 for Neutral.
int trend_signal = close > ta.ema(close, 200) and ta.crossover(ta.ema(close, 20), ta.ema(close, 50)) ? 1 :
close < ta.ema(close, 200) and ta.crossunder(ta.ema(close, 20), ta.ema(close, 50)) ? -1 : 0
int reversion_signal = ta.crossunder(ta.rsi(close, 14), 30) ? 1 : ta.crossover(ta.rsi(close, 14), 70) ? -1 : 0
int breakout_signal = ta.crossover(close, ta.highest(high, 20) ) ? 1 : ta.crossunder(close, ta.lowest(low, 20) ) ? -1 : 0
int momentum_signal = ta.crossover(ta.mom(close, 10), 0) ? 1 : ta.crossunder(ta.mom(close, 10), 0) ? -1 : 0
// Create an array of your signals. The order MUST be consistent.
array all_signals = array.from(trend_signal, reversion_signal, breakout_signal, momentum_signal)
// 3. THE MAIN LOOP (Feed -> Detect -> Select) - runs on every bar
// --- FEED: Update the shadow portfolios with the latest signals and price ---
engine := spa.feed_signals(engine, all_signals, close)
// --- DETECT: Run the concept drift engine ---
if i_spa_use_drift
float trend_slope = ta.linreg(close, 20, 0) - ta.linreg(close, 20, 1)
engine := spa.detect_drift(engine, close, volume, ta.atr(14), trend_slope)
engine := spa.apply_trauma_cycle(engine) // This will compress memory if a shock was detected
// --- SELECT: Ask the engine for its best choice ---
= spa.select(engine)
engine := updated_engine // CRITICAL: Always update the engine state
// --- ACT: Use the final, selected signal for your indicator's logic ---
int final_signal = array.get(all_signals, selected_arm)
string selected_name = spa.get_name(engine, selected_arm)
// Example: Color bars based on the final, SPA-vetted signal
barcolor(final_signal == 1 ? color.new(color.green, 70) : final_signal == -1 ? color.new(color.red, 70) : na)
// 4. DISPLAY DIAGNOSTICS
if i_spa_show_dash and barstate.islast
string diag_text = spa.diagnostics(engine)
label.new(bar_index, high, diag_text,
style=label.style_label_down,
color=color.new(#0A0A14, 10),
textcolor=#00E5FF,
size=size.small,
textalign=text.align_left)
█ DEVELOPMENT PHILOSOPHY
The DafeSPALib was born from the realization that market adaptation is the true holy grail of trading. While any single strategy is brittle, a portfolio of strategies, managed by an intelligent selection algorithm, is antifragile—it can learn, adapt, and potentially thrive in the face of chaos. This library is an open-source tool for the systems thinker, the quantitative analyst, and the professional developer. It is designed to provide the foundational architecture for building the most robust, adaptive, and intelligent trading systems on the TradingView platform.
This library is a tool for that wisdom. It is not about having the single smartest algorithm, but about having a disciplined, data-driven process for selecting the one that is working right now.
█ DISCLAIMER & IMPORTANT NOTES
THIS IS A LIBRARY FOR ADVANCED DEVELOPERS: This script does nothing on its own. It is a powerful engine that must be integrated into other indicators and fed with valid strategy signals.
PERFORMANCE IS HYPOTHETICAL: The shadow portfolio tracking is a simulation. It does not account for slippage, fees (unless manually added to P&L;), or the psychological pressure of live trading.
LEARNING REQUIRES DATA: The selection algorithms require a sufficient number of trades (at least 20-30 per arm) to make statistically meaningful decisions. The engine will be less reliable during the initial "warm-up" period.
"You don't need to be a rocket scientist. Investing is not a game where the guy with the 160 IQ beats the guy with the 130 IQ."
— Warren Buffett
Taking you to school. - Dskyz, Create with RL.
Daily Put Spread Signals - Final Clean v5//@version=5
indicator("Daily Put Spread Signals - Final Clean v5", overlay=true)
//========================
// Inputs
//========================
ma20Len = input.int(20, "MA20 Length")
ma50Len = input.int(50, "MA50 Length")
ma200Len = input.int(200, "MA200 Length")
pullbackPct = input.float(0.01, "Pullback proximity to MA20 (1% = 0.01)", step=0.005)
minRedDays = input.int(1, "Min red days in last 5 bars (0-5)", minval=0, maxval=5)
stopBelow200Pct = input.float(0.005, "STOP: Close below MA200 by % (0.5%=0.005)", step=0.0025)
//========================
// Moving averages
//========================
ma20 = ta.sma(close, ma20Len)
ma50 = ta.sma(close, ma50Len)
ma200 = ta.sma(close, ma200Len)
//========================
// Trend filter (bull regime)
//========================
bullTrend = close > ma50 and close > ma200 and ma50 > ma200
//========================
// Pullback condition (near MA20)
//========================
nearMA20 = close <= ma20 * (1 + pullbackPct)
//========================
// Count red candles in last 5 bars (NO ta.sum)
//========================
isRed(barBack) => close < open ? 1 : 0
redCount = isRed(0) + isRed(1) + isRed(2) + isRed(3) + isRed(4)
hasMinRed = redCount >= minRedDays
//========================
// Bounce confirmation
//========================
bounce = close > open and close > close
//========================
// Entry signal
//========================
enter = bullTrend and nearMA20 and hasMinRed and bounce
//========================
// Exit signals
//========================
takeProfit = ta.crossover(close, ma20)
stopOut = close < ma200 * (1 - stopBelow200Pct)
//========================
// Plots
//========================
plot(ma20, "MA20", linewidth=2)
plot(ma50, "MA50", linewidth=2)
plot(ma200, "MA200", linewidth=2)
plotshape(enter, title="ENTER", style=shape.labelup, location=location.belowbar, text="ENTER Sell Put Vertical", size=size.small)
plotshape(takeProfit, title="EXIT TP", style=shape.labeldown, location=location.abovebar, text="EXIT Take Profit", size=size.small)
plotshape(stopOut, title="EXIT STOP", style=shape.labeldown, location=location.abovebar, text="EXIT STOP", size=size.small)
//========================
// Alerts
//========================
alertcondition(enter, title="ENTER Alert (Daily)", message="ENTER (Daily): Bull trend + pullback near MA20 + bounce. Consider selling put credit spread (30-45 DTE).")
alertcondition(takeProfit, title="EXIT Take Profit Alert (Daily)", message="EXIT TP (Daily): Price reclaimed MA20. Consider taking profit on put spread.")
alertcondition(stopOut, title="EXIT Stop Alert (Daily)", message="EXIT STOP (Daily): Close below MA200 threshold. Consider closing/rolling defensive.")
Trading Checklist with % Score 10 itemsCreate your own custom trading checklist, up to 10 items, will calculate conviction rate % for you. Transparent.
Exponential Moving AveragesEMA of many time units.
Time units include 5, 10, 20, 60, 120, 200.
Enjoy!
BB Multi-TF Hidden Divergence Scanner2This is simple satatergies for beginer trader used for only refernces
Linear Regression Channel + 50 EMApretty self explanatory just added an ema to a lin reg for total world domination
Position Size Dashboard (Gold / Forex / Indices)A clean, MT5-accurate position sizing tool that instantly calculates lot size based on risk and stop-loss range. Designed for discretionary and prop-firm traders who want fast, no-nonsense sizing without manual math. Supports Gold (XAUUSD), Forex pairs, and Indices, with clear on-chart dashboard output.
How to Use (Step-by-Step)
Add the indicator to your chart
Open Settings → Inputs
Enter your Risk ($) (e.g., 100)
Enter SL Range
Forex → pips
Gold / Indices → price points
Enable or disable Gold / Forex / Indices rows as needed
Choose dashboard position, colors, and text size
Click OK → Lot size is calculated instantly and shown on chart






















