Dual-Frame Momentum OscillatorDual-Frame Momentum Oscillator (DFMO)
This is not just another oscillator. This is a confluence engine, built for the discerning trader who reads the story of price action and needs an objective tool to confirm the climax.
The Dual-Frame Momentum Oscillator was designed to solve a specific problem: how to differentiate a genuine, sustainable breakout from an exhaustive liquidity grab. It provides a visual confirmation for high-probability reversal and scalp setups by measuring momentum across two distinct time frames simultaneously.
This tool is for the trader who understands that indicators should not dictate trades, but rather confirm a well-defined thesis based on market structure, volume, and liquidity.
The Core Concept: Context Meets Trigger
The DFMO fuses a slow, methodical Stochastic with a hyper-sensitive RSI to give you a complete picture of momentum.
The Context (Slow Stochastic %K - default 40,4,4): This acts as your long-term momentum gauge. It tells you if the underlying trend is healthy or nearing exhaustion. A high reading suggests the market is overextended and vulnerable, while a low reading suggests the opposite.
The Trigger (Fast RSI - default 3): This is your immediate impulse reader. It measures the velocity and intensity of the current price thrust, making it incredibly sensitive to exhaustive moves, spikes, and bounces.
By themselves, they are useful. Together, they are formidable.
The Confluence Engine: Your Visual Edge
The true power of the DFMO lies in its "Confluence Engine." The indicator's background highlights in real-time when both oscillators are in agreement, visually flagging moments of maximum opportunity.
Bearish Confluence Zone (Red): The background turns red only when the Stochastic is overbought AND the RSI is overbought. This is your signal that the broader trend is exhausted and the current buying impulse has reached a climax. It is the ideal confirmation for a short entry following a liquidity sweep above a key high.
Bullish Confluence Zone (Green): The background turns green only when the Stochastic is oversold AND the RSI is oversold. This signals that the downtrend is tired and the immediate selling pressure is exhaustive, providing high-probability confirmation for a long entry at a key support level.
When these zones appear, the indicator is telling you that both the context and the trigger are aligned. This removes ambiguity and allows for decisive, confident execution.
Practical Application: The Liquidity Sweep
Imagine you're stalking a short on a futures contract like MCL or MES. You've marked the high of the day (HOD) as a key resistance level where liquidity is resting. You see a sharp, vertical impulse move that breaks the HOD, clearing out the stops.
Is this a real breakout, or is it a manipulation move—a classic liquidity grab?
You glance down at the DFMO. The moment price swept the high, the background flashed red. That's your objective confirmation. The slow Stoch was already overbought, and the fast RSI spiking confirmed the exhaustive, terminal nature of that price thrust. You now have the confidence to enter your short scalp, knowing you are aligned with the probable direction of the market's next move.
This is how you move from "feeling" the market to systematically executing a high-probability edge. This is how you aspire for greatness.
Add the Dual-Frame Momentum Oscillator to your toolkit and transform your ability to time entries with surgical precision.
Indicatori e strategie
Mid-Body 50% Candles – Support/Resistance with ConfirmationHow it works:
– Calculates the mid-body (open+close)/2 of the previous candle.
– Bullish candle → potential SUP level.
– Bearish candle → potential RES level.
– Optional next-bar confirmation (close above/below the mid-body).
– Filters available: ATR size, swing detection, upper/lower wick %.
– Lines extend until broken or removed.
– Alerts available for: level creation, touch and break.
Use cases:
– Confirm candle rejections (pin bars).
– Filter false breakouts.
– Refine entries/exits for scalping or swing trading.
What makes it unique:
Unlike generic Fibonacci or candle tools, this script focuses exclusively on the 50% body level with confirmations and multiple filters, making it more precise for price action decision points.
Grand Slam Risk ManagementGrand Slam Risk Management (GSRM) Indicator
OVERVIEW
The Grand Slam Risk Management Indicator transforms complex position sizing calculations into real-time, visual risk metrics—enabling disciplined trading decisions without the emotional guesswork that destroys accounts. This comprehensive tool is designed for active day traders and swing traders who want to automate critical risk management calculations directly on their TradingView charts. 🚀
THE GRAND SLAM RISK MANAGEMENT STRATEGY
Core Philosophy
The Grand Slam Risk Management Strategy (GSRM) gets its name from baseball's ultimate scoring play: a grand slam can only be hit when three runners are already on base, requiring at least three prior successful at-bats (hits or walks) to create the opportunity. This perfectly embodies the GSRM philosophy—consistent "base hits" in trading create the foundation for larger wins while protecting your account from devastating losses. Just as baseball teams win championships through disciplined, consistent play rather than swinging for the fences every at-bat, successful traders build wealth through reliable, repeatable profits rather than chasing home runs that often result in strikeouts. ⚾
Strategy Framework
Capital Allocation : 💰
• Working Balance: Account balance minus PDT requirement ($25,000 minimum for margin accounts)
• Allocated Buying Power: Working balance × leverage (4:1 for day trading, 2:1 for swing, 1:1 for cash)
• Daily Profit Target: 5% of allocated buying power (default)
The Base Hit System : 🎯
• Daily profit target divided into 4 "base hits"
• Each base hit represents 25% of daily goal
• Max risk per trade: 50% of base hit target (maintains 2:1 reward/risk minimum)
• Daily max loss: 2 base hits (recoverable with 2 winning trades)
Three-Tier Profit Structure : 🚀
• Tier 1 (5%): Minimum acceptable profit - "Why else take the trade?"
• Tier 2 (10%): Solid win - the target "base hit"
• Tier 3 (20%): Home run - when momentum is strongly in your favor 🏠🏃
Position Sizing Levels : 📊
• Quarter Position (25% of max): Testing the waters, lower conviction setups
• Half Position (50% of max): Standard confidence trades
• Max Position (100%): High conviction, ideal setup conditions
INDICATOR FEATURES
Real-Time Calculations ⚡
• Dynamic Position Sizing: Automatically calculates share quantities based on account balance and current price
• Profit & Loss Targets: Displays dollar amounts for profit targets and stop-losses across all position sizes
• Risk Metrics: Shows daily profit goals, max loss thresholds, and P&L ratios
Advanced Stop-Loss Methods 🛡️
1. Percentage-Based Stops : Fixed 50% of profit target (maintains 2:1 reward/risk)
2. ATR-Based Stops : Dynamic stops that adapt to market volatility using Average True Range (ATR)
• Tier 1: 0.5× ATR (tight/scalping)
• Tier 2: 1.0× ATR (standard)
• Tier 3: 1.5× ATR (wide/trending)
Cost Basis Options 📈
• Last Close: Uses previous bar's closing price for stable calculations
• VWMA: Volume-Weighted Moving Average (default: 9) estimate cost-basis from recent volume-weighted price action
• SMA/EMA: Use Simple or Exponential Moving Average (default: 9) useful for planning entries at SMA/EMA cross-overs and bounces.
• VWAP: Volume-Weighted Average Price (default: daily) for entry point planning at bounce or break of VWAP.
* Ask/Bid: Entry point calculations based on current Ask or Bid price (only available on 1T charts)
Visual Risk Management 🔑
• Color-Coded P&L Ratio :
- Green (≤0.5): Conservative, favorable risk ✅
- Yellow (0.5-1.0): Balanced risk ⚠️
- Red (>1.0): Aggressive, requires higher win rate 🛑
• Position Size Color Coding : Green (quarter) → Yellow (half) → Red (max) for quick risk assessment
HOW TO USE THE GSRM INDICATOR
Initial Setup (One-Time Configuration) ⚙️
1. Set Account Balance: Enter your total trading account value
2. Configure PDT Protection: Enable for margin accounts ≥$25,000 to protect required funds
3. Select Leverage: 4:1 (day trading), 2:1 (swing), or 1:1 (cash account)
4. Adjust Risk Percentage: Default 5% of allocated buying power; reduce for conservative approach
Trading Workflow
Pre-Market Preparation: 🌅
1. Review daily profit target and max loss displayed in green/red
2. Note your base hit target - this is your standard trade goal
3. Check P&L ratio - ensure it's sustainable for your win rate
Trade Execution: 🚀
1. Assess Setup Quality :
• Strong setup → Consider half or max position 💪
• Decent setup → Quarter or half position 👍
• Testing idea → Quarter position only 🧪
2. Select Profit Tier Based on Market Conditions :
• Choppy market → Target Tier 1 (5%) 🌊
• Normal conditions → Target Tier 2 (10%) ➡️
• Strong momentum → Target Tier 3 (20%) 🚀
3. Choose Stop Method :
• Percentage stops: Best for stocks with clear support/resistance
• ATR stops: Better for volatile stocks or news-driven trades. WARNING: this may result in tighter stops, negatively affecting your P&L. To offset this effect, try increasing the number of base hits to achieve your daily profit target and recover from a daily max loss. Be sure the resultant P&L ratio is in the conservative range ≤0.5. This will allow you to adjust your per-trade P&L targets without reducing your daily profit target or increasing your max risk.
4. Execute Using Table Values :
• 🔎 Find your position size group (🟢quarter/🟡half/🔴max)
• 🔎 Find your profit target row (5%/10%/20%) for your position size group
• ⚠️ Do not exceed the share count and stop-loss values displayed ⚠️
Risk Management Rules 🛡️
Daily Limits : 🚨
• Stop trading after hitting daily max loss (prevent tilt/revenge trading)
• Stop trading when a low-risk, minimum-loss trade would exceed your daily max loss (prevent exceeding max)
• Stop trading if you fall below the Daily Profit Target after having achieved it (prevent tilt/revenge trading)
• Cold Market: Stop trading after reaching daily profit target (preserve gains) ❄️
• Hot Market: Three Strikes - stop trading after 3 total max loss trades in a day (prevent tilt/revenge trading) 🔥
Position Management : 📏
• Never exceed max position size shown (protects from overleverage)
• Use quarter positions when daily P&L is negative or below first profit goal (40% of target)
• Use half positions only while daily P&L is above first profit goal (40% of target)
• Use full positions only while daily P&L is above profit goal (100% of target)
A/B Testing Features 🧪
Stop-Loss Methods :
• Week 1: Use percentage-based stops
• Week 2: Use ATR-based stops
• Compare win rates and average losses to optimize
Cost Basis Models :
Pick the highest probable cost-basis and keep your entry position below the share count shown to protect from overleveraging your buying power.
⚠️ IMPORTANT: COST BASIS ESTIMATIONS ARE FOR RISK MANAGEMENT CALCULATIONS ONLY - DO NOT USE THIS INFORMATION TO EXECUTE BUY OR SELL ORDERS.
• Fast movers: Use Last Close for stability 🏃or Bid/Ask for real-time price updates (Bid/Ask is only available on 1T charts).
• Liquid stocks: Try VWMA for better entry estimation 💧
• Reversals/Break of VWAP: Use VWAP when anticipating an entry at the Volume-Weighted Average Price 🔄
• Reversals/Break SMA 200: Use SMA when anticipating an entry at the SMA 📉
• Momentum/Trending: Use EMA when anticipating an entry at the EMA bounce 📈
• Price Offset: Plus/Minus $1.00 in $0.10 increments to compensate for slippage, market orders, etc.
Track which method provides better fill estimates. There is no right or wrong choice here because it depends on your style of trading. You can also use the Price Offset option if you find it helps with consistency.
BEST PRACTICES ⭐
1. Start Conservative : Use quarter positions and default settings until familiar with the system 🐣
2. Track Results : Document whether you hit Tier 1, 2, or 3 targets 📝
3. Respect the Math : The calculations assume a 50%+ win rate - if yours is lower, reduce position sizes 🧮
4. Daily Review : Compare actual P&L to base hit targets to calibrate expectations 🔍
5. Adapt to Conditions : Use ATR stops in volatile markets, percentage stops in stable conditions 🌡️
GLOSSARY 📚
• ATR (Average True Range) : A volatility indicator measuring the average range of price movement
• PDT (Pattern Day Trader) : SEC rule requiring $25,000 minimum for accounts making 4+ day trades in 5 business days
• VWAP (Volume-Weighted Average Price) : Average price weighted by volume for the trading session
• VWMA (Volume-Weighted Moving Average) : Moving average that gives more weight to periods with higher volume
• SMA (Simple Moving Average) : Unweighted moving average where each data point is of equal importance
• EMA (Exponential Moving Average) : Moving average that emphasizes the most recent data and information from the market
• P&L : Profit & Loss
IMPORTANT DISCLAIMERS ⚠️
• This indicator and any information provided is for educational and informational purposes only and should not be construed as investment advice, financial advice, trading advice, or any other type of advice. You should not make any investment decision based solely on this indicator.
• All investments and trading involve substantial risk of loss and are not suitable for every investor. You should carefully consider whether trading is suitable for you in light of your experience, objectives, financial resources, and other relevant circumstances. 📉
• Actual trade results may vary from calculated targets due to slippage, market gaps, and execution delays
• The creator of this indicator is not a registered investment advisor, broker-dealer, or financial advisor. Nothing contained herein constitutes a recommendation or solicitation to buy or sell any financial instrument.
• In no event shall the creator be liable for any direct, indirect, incidental, special, or consequential damages arising out of the use of this indicator.
• This indicator DOES NOT calculate support/resistance levels
• This indicator DOES NOT provide buy/sell signals
• This indicator DOES NOT calculate entry prices
• It is the trader's responsibility to determine an appropriate entry price for their chosen strategy
• This indicator provides calculations only - execution discipline remains the trader's responsibility
• Default settings assume PDT margin account rules; adjust for cash accounts
• P&L ratio colors are guidelines - your actual win rate determines sustainable ratios
• Always verify position sizes don't exceed account buying power before executing
SUPPORT AND FEEDBACK 💬
This indicator represents years of trading experience condensed into automated calculations. It's designed to remove emotional decision-making from position sizing while maintaining flexibility for different market conditions and trading styles.
For questions, suggestions, or to share your results using the GSRM strategy, please comment on the TradingView publication page. 🚀
---
Remember: The goal isn't to hit home runs - it's to get on base consistently while avoiding strikeouts. Small wins compound into large gains over time. ⚾💰
Version: 1.0
License: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
- creativecommons.org
Compatibility: TradingView Pine Script v6
MACD, RSI & Stoch + Divergences (RU)WARNING: This script is fully localized in Russian and is supported by the Russian-speaking community. All tooltips, settings, and descriptions are provided in Russian for maximum usability by Russian-speaking users.
This script combines MACD, RSI, and Stochastic oscillators with automatic detection and visualization of regular and hidden divergences. It highlights potential reversal and trend continuation points, draws divergence lines and labels, and provides flexible settings for trend analysis and oscillator calculation. The script also includes advanced session timing and daily change visualization for intraday trading.
Данный скрипт объединяет индикаторы MACD, RSI и Стохастик, а также автоматически определяет и визуализирует обычные и скрытые дивергенции. Он выделяет потенциальные точки разворота и продолжения тренда, строит линии и метки дивергенций, а также предоставляет гибкие настройки для анализа тренда и расчёта осцилляторов.
Скрипт дополнительно отображает временные торговые сессии и динамику дневных изменений для удобства внутридневной торговли. Все параметры снабжены подробными русскоязычными подсказками (тултипами), что делает работу с инструментом максимально понятной и удобной для русскоязычных пользователей.
[CRYPTOWELT] Liquidation Heatmap v2🚀 Liquidation Heatmap v2 - Advanced Liquidity Zone Detection
Professional-grade indicator that identifies potential liquidation zones based on volume-weighted pivot points. This powerful tool creates dynamic heatmap zones showing areas where significant liquidations may occur, helping traders identify key support and resistance levels with high liquidity concentration.
📊 What This Indicator Does:
• Detects confirmed pivot highs and lows using customizable length parameters
• Creates liquidity zones above pivot highs and below pivot lows
• Uses ATR (Average True Range) for dynamic zone sizing that adapts to market volatility
• Applies volume-weighted color intensity to show zone strength
• Automatically manages zone lifecycle - zones extend until price touches the center
• Provides real-time updates with performance-optimized analysis range filtering
🎯 Key Features:
• Pivot-based liquidation zones (above confirmed highs/below confirmed lows)
• Dynamic zone height with ATR-resize (optional, enabled by default)
• Volume-weighted color gradient (Purple → Cyan → Yellow)
• Auto-opacity based on signal strength (volume intensity)
• Optional zone midlines that extend until touched
• Configurable analysis range (Bars Back / Price Range % / Off)
• Real-time zone updates and cleanup when touched by price
• Advanced color scaling options for focused analysis
⚙️ Main Settings:
• Pivot Length: Pivot confirmation (smaller = faster, larger = more robust)
• ATR Length: Base ATR calculation period (default 200)
• Auto ATR Multiplier: Automatic timeframe-based scaling (0.2-0.4 range)
• Dynamic Zone Height: ATR-based zone resizing with pivot anchor
• Zone Depth × ATR: Additional depth multiplier for zone size
• Min Zone Height: Minimum zone size in ticks (prevents tiny zones)
Visual Controls:
• Gradient Colors: Customize start/mid/end colors for personal preference
• Auto Opacity: Volume-based transparency with configurable min/max range
• Zone Lines: Optional midlines with custom width and transparency
• Zone Borders: Optional visible outlines for better definition
• Scale Legend: Right/left position with gradient color reference
📈 Analysis Range Options:
• Bars Back: Limit analysis to last N bars (performance optimization)
• Price Range %: Focus on ±% around current price (e.g., ±10%)
• Scale to Range: Color scaling limited to selected analysis area
• Off: No range filtering (global analysis)
💡 Usage Tips:
• Use smaller pivot length (1-2) for more reactive signals
• Increase zone depth multiplier for longer-lasting zones
• Enable "Bars Back" mode for better performance on longer timeframes
• Use zone borders on light chart backgrounds for better visibility
• Fine-tune auto-opacity range (20-85) for optimal chart readability
• Combine with other indicators for confirmation
Technical Details:
• Auto ATR multiplier: 60+ min (0.2), minutes (0.25), daily (0.2), other (0.4)
• Volume intensity: 200-period SMA normalization with piecewise mapping
• Maximum 500 live zones (configurable up to 5000)
• Automatic cleanup when zones are touched by price
• Pivot anchor points maintained during dynamic resizing
• Memory-optimized with synchronized object pools
⚠️ Important Notes:
• Zones automatically end when price touches the center (midpoint)
• Overlay indicator - draws directly on main chart
• Performance optimized with analysis range filtering
• Compatible with all timeframes and instruments
• Based on volume-weighted pivot analysis methodology
🌟 About Cryptowelt:
This indicator is part of the Cryptowelt trading community - your premier destination for professional-grade trading tools and education. Join our community for:
• 🚀 Advanced trading indicators and strategies
• 📚 Comprehensive trading education and courses
• 💬 Active community discussions and support
• 🎯 Professional-grade tools for serious traders
• 📈 Regular updates and new indicator releases
Connect with Cryptowelt:
• Telegram: t.me/+9WWwDamOJsk2MGI0
• Join our moderated community for high-quality crypto trading information
Perfect for identifying key liquidity levels, potential liquidation zones, and high-probability support/resistance areas with advanced visual feedback and customizable analysis parameters. Essential tool for serious traders who want to understand market structure and liquidity dynamics.
PSDIGreen Zone → Potential Buy Area
Price is near support.
Red Zone → Potential Sell Area
Price is near resistance.
EMA Lines
Blue (EMA50) above Orange (EMA200): Trend up → favors buys.
Blue below Orange: Trend down → favors sells.
How to Use
Look at zones and trend.
Price near green + trend up → consider long.
Price near red + trend down → consider short.
NOTE: When in uptrend, only follow green zones. When in down trend only follow red zones.
Target Trend+vova13this indicator shows trend plus alerts
The Target Trend indicator is a trend-following tool designed to assist traders in capturing directional moves while managing entry, stop loss, and profit targets visually on the chart. Using adaptive SMA bands as the core trend detection method, this indicator dynamically identifies shifts in trend direction and provides structured exit points through customizable target levels.
Alto/Bajo Día y Semana Anterior + Interno y semanal📊 High/Low Daily & Weekly + Internal
Instantly visualize key support and resistance levels:
🔹 Previous day’s highs/lows (red/green)
🔹 Current day’s internal highs/lows (orange/yellow)
🔹 Previous week’s highs/lows (blue/aqua) – visible on all timeframes
✨ Optional labels with exact values
✨ Fully customizable lines
Perfect for spotting liquidity zones and key levels in your trading.
📊 Alto/Bajo Día & Semana + Interno
Visualiza soportes y resistencias clave al instante:
🔹 Altos/bajos del día anterior (rojo/verde)
🔹 Altos/bajos internos del día (naranja/amarillo)
🔹 Altos/bajos de la semana anterior (azul/aqua) – visibles en todas las temporalidades
✨ Labels opcionales con valores exactos
✨ Líneas personalizables
Ideal para detectar zonas de liquidez y niveles clave en tu trading.
ATM & ITM Strike Table (NIFTY & BANKNIFTY)This script is like a cheat sheet for option traders.
When you put it on your chart, it shows you a small table with:
The current spot price (the real market price).
The futures price (another version of the same index that sometimes trades a bit higher or lower).
The ATM strike (the strike price closest to the market price).
Which call option and put option are “in the money” and most relevant right now.
A little note to remind you if you’re looking at the right chart.
In short:
It saves you from doing mental math every time by automatically pointing out the key option strike prices you should be aware of.
Reference timesThe theory behind this indicator is that sometimes the graph reaches a certain price at at a certain time according to the price it had at the same time and day in any of the previous weeks. If you could easily see what happened a few weeks ago on this day's weekday and half an hour from now, you might theoretically gain more assurance as to where the graph might go in the next half an hour.
This of course relies of the premise that some traders choose to enter or exit positions according to historical times they are referencing. Hence the name - Reference times.
Example:
it is now 08:00 ET Wednesday. I want to guess what the graph will do in the next half hour. I enter in the indicator the weekday "Wednesday", the time "8:30", and go to 30 minute candles.
I will then see all the candles the graph has been on historical Wednesdays at 8:30. If the candles are below the 08:00 price, we might guess that the graph might want to descent. If they are above the graph, we might guess that the graph might ascend.
How it works:
The user defines a weekday and time he wants to inquire on.
The script searches for past weekdays and similar hours.
It marks these bars at their wicks.
The user can also inquire "opposite hours" - 12 hours ahead or earlier.
The user can also inquire "opposite days" - Monday<->Wednesday, Tuesday<->Thursday.
In addition, the User may inquire the previous day of his selected weekday, which will mark the most recent previous day existent.
Side note: The Time zone offset is set for Jerusalem time. and so it may need future adjustment.
send debugging instances if you find any
Thank you
Assaf Fogelman 2025
FiniteStateMachine🟩 OVERVIEW
A flexible framework for creating, testing and implementing a Finite State Machine (FSM) in your script. FSMs use rules to control how states change in response to events.
This is the first Finite State Machine library on TradingView and it's quite a different way to think about your script's logic. Advantages of using this vs hardcoding all your logic include:
• Explicit logic : You can see all rules easily side-by-side.
• Validation : Tables show your rules and validation results right on the chart.
• Dual approach : Simple matrix for straightforward transitions; map implementation for concurrent scenarios. You can combine them for complex needs.
• Type safety : Shows how to use enums for robustness while maintaining string compatibility.
• Real-world examples : Includes both conceptual (traffic lights) and practical (trading strategy) demonstrations.
• Priority control : Explicit control over which rules take precedence when multiple conditions are met.
• Wildcard system : Flexible pattern matching for states and events.
The library seems complex, but it's not really. Your conditions, events, and their potential interactions are complex. The FSM makes them all explicit, which is some work. However, like all "good" pain in life, this is front-loaded, and *saves* pain later, in the form of unintended interactions and bugs that are very hard to find and fix.
🟩 SIMPLE FSM (MATRIX-BASED)
The simple FSM uses a matrix to define transition rules with the structure: state > event > state. We look up the current state, check if the event in that row matches, and if it does, output the resulting state.
Each row in the matrix defines one rule, and the first matching row, counting from the top down, is applied.
A limitation of this method is that you can supply only ONE event.
You can design layered rules using widlcards. Use an empty string "" or the special string "ANY" for any state or event wildcard.
The matrix FSM is foruse where you have clear, sequential state transitions triggered by single events. Think traffic lights, or any logic where only one thing can happen at a time.
The demo for this FSM is of traffic lights.
🟩 CONCURRENT FSM (MAP-BASED)
The map FSM uses a more complex structure where each state is a key in the map, and its value is an array of event rules. Each rule maps a named condition to an output (event or next state).
This FSM can handle multiple conditions simultaneously. Rules added first have higher priority.
Adding more rules to existing states combines the entries in the map (if you use the supplied helper function) rather than overwriting them.
This FSM is for more complex scenarios where multiple conditions can be true simultaneously, and you need to control which takes precedence. Like trading strategies, or any system with concurrent conditions.
The demo for this FSM is a trading strategy.
🟩 HOW TO USE
Pine Script libraries contain reusable code for importing into indicators. You do not need to copy any code out of here. Just import the library and call the function you want.
For example, for version 1 of this library, import it like this:
import SimpleCryptoLife/FiniteStateMachine/1
See the EXAMPLE USAGE sections within the library for examples of calling the functions.
For more information on libraries and incorporating them into your scripts, see the Libraries section of the Pine Script User Manual.
🟩 TECHNICAL IMPLEMENTATION
Both FSM implementations support wildcards using blank strings "" or the special string "ANY". Wildcards match in this priority order:
• Exact state + exact event match
• Exact state + empty event (event wildcard)
• Empty state + exact event (state wildcard)
• Empty state + empty event (full wildcard)
When multiple rules match the same state + event combination, the FIRST rule encountered takes priority. In the matrix FSM, this means row order determines priority. In the map FSM, it's the order you add rules to each state.
The library uses user-defined types for the map FSM:
• o_eventRule : Maps a condition name to an output
• o_eventRuleWrapper : Wraps an array of rules (since maps can't contain arrays directly)
Everything uses strings for maximum library compatibility, though the examples show how to use enums for type safety by converting them to strings.
Unlike normal maps where adding a duplicate key overwrites the value, this library's `m_addRuleToEventMap()` method *combines* rules, making it intuitive to build rule sets without breaking them.
🟩 VALIDATION & ERROR HANDLING
The library includes comprehensive validation functions that catch common FSM design errors:
Error detection:
• Empty next states
• Invalid states not in the states array
• Duplicate rules
• Conflicting transitions
• Unreachable states (no entry/exit rules)
Warning detection:
• Redundant wildcards
• Empty states/events (potential unintended wildcards)
• Duplicate conditions within states
You can display validation results in tables on the chart, with tooltips providing detailed explanations. The helper functions to display the tables are exported so you can call them from your own script.
🟩 PRACTICAL EXAMPLES
The library includes four comprehensive demos:
Traffic Light Demo (Simple FSM) : Uses the matrix FSM to cycle through traffic light states (red → red+amber → green → amber → red) with timer events. Includes pseudo-random "break" events and repair logic to demonstrate wildcards and priority handling.
Trading Strategy Demo (Concurrent FSM) : Implements a realistic long-only trading strategy using BOTH FSM types:
• Map FSM converts multiple technical conditions (EMA crosses, gaps, fractals, RSI) into prioritised events
• Matrix FSM handles state transitions (idle → setup → entry → position → exit → re-entry)
• Includes position management, stop losses, and re-entry logic
Error Demonstrations : Both FSM types include error demos with intentionally malformed rules to showcase the validation system's capabilities.
🟩 BRING ON THE FUNCTIONS
f_printFSMMatrix(_mat_rules, _a_states, _tablePosition)
Prints a table of states and rules to the specified position on the chart. Works only with the matrix-based FSM.
Parameters:
_mat_rules (matrix)
_a_states (array)
_tablePosition (simple string)
Returns: The table of states and rules.
method m_loadMatrixRulesFromText(_mat_rules, _rulesText)
Loads rules into a rules matrix from a multiline string where each line is of the form "current state | event | next state" (ignores empty lines and trims whitespace).
This is the most human-readable way to define rules because it's a visually aligned, table-like format.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_rulesText (string)
Returns: No explicit return. The matrix is modified as a side-effect.
method m_addRuleToMatrix(_mat_rules, _currentState, _event, _nextState)
Adds a single rule to the rules matrix. This can also be quite readble if you use short variable names and careful spacing.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_currentState (string)
_event (string)
_nextState (string)
Returns: No explicit return. The matrix is modified as a side-effect.
method m_validateRulesMatrix(_mat_rules, _a_states, _showTable, _tablePosition)
Validates a rules matrix and a states array to check that they are well formed. Works only with the matrix-based FSM.
Checks: matrix has exactly 3 columns; no empty next states; all states defined in array; no duplicate states; no duplicate rules; all states have entry/exit rules; no conflicting transitions; no redundant wildcards. To avoid slowing down the script unnecessarily, call this method once (perhaps using `barstate.isfirst`), when the rules and states are ready.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_a_states (array)
_showTable (bool)
_tablePosition (simple string)
Returns: `true` if the rules and states are valid; `false` if errors or warnings exist.
method m_getStateFromMatrix(_mat_rules, _currentState, _event, _strictInput, _strictTransitions)
Returns the next state based on the current state and event, or `na` if no matching transition is found. Empty (not na) entries are treated as wildcards if `strictInput` is false.
Priority: exact match > event wildcard > state wildcard > full wildcard.
Namespace types: matrix
Parameters:
_mat_rules (matrix)
_currentState (string)
_event (string)
_strictInput (bool)
_strictTransitions (bool)
Returns: The next state or `na`.
method m_addRuleToEventMap(_map_eventRules, _state, _condName, _output)
Adds a single event rule to the event rules map. If the state key already exists, appends the new rule to the existing array (if different). If the state key doesn't exist, creates a new entry.
Namespace types: map
Parameters:
_map_eventRules (map)
_state (string)
_condName (string)
_output (string)
Returns: No explicit return. The map is modified as a side-effect.
method m_addEventRulesToMapFromText(_map_eventRules, _configText)
Loads event rules from a multiline text string into a map structure.
Format: "state | condName > output | condName > output | ..." . Pairs are ordered by priority. You can have multiple rules on the same line for one state.
Supports wildcards: Use an empty string ("") or the special string "ANY" for state or condName to create wildcard rules.
Examples: " | condName > output" (state wildcard), "state | > output" (condition wildcard), " | > output" (full wildcard).
Splits lines by , extracts state as key, creates/appends to array with new o_eventRule(condName, output).
Call once, e.g., on barstate.isfirst for best performance.
Namespace types: map
Parameters:
_map_eventRules (map)
_configText (string)
Returns: No explicit return. The map is modified as a side-effect.
f_printFSMMap(_map_eventRules, _a_states, _tablePosition)
Prints a table of map-based event rules to the specified position on the chart.
Parameters:
_map_eventRules (map)
_a_states (array)
_tablePosition (simple string)
Returns: The table of map-based event rules.
method m_validateEventRulesMap(_map_eventRules, _a_states, _a_validEvents, _showTable, _tablePosition)
Validates an event rules map to check that it's well formed.
Checks: map is not empty; wrappers contain non-empty arrays; no duplicate condition names per state; no empty fields in o_eventRule objects; optionally validates outputs against matrix events.
NOTE: Both "" and "ANY" are treated identically as wildcards for both states and conditions.
To avoid slowing down the script unnecessarily, call this method once (perhaps using `barstate.isfirst`), when the map is ready.
Namespace types: map
Parameters:
_map_eventRules (map)
_a_states (array)
_a_validEvents (array)
_showTable (bool)
_tablePosition (simple string)
Returns: `true` if the event rules map is valid; `false` if errors or warnings exist.
method m_getEventFromConditionsMap(_currentState, _a_activeConditions, _map_eventRules)
Returns a single event or state string based on the current state and active conditions.
Uses a map of event rules where rules are pre-sorted by implicit priority via load order.
Supports wildcards using empty string ("") or "ANY" for flexible rule matching.
Priority: exact match > condition wildcard > state wildcard > full wildcard.
Namespace types: series string, simple string, input string, const string
Parameters:
_currentState (string)
_a_activeConditions (array)
_map_eventRules (map)
Returns: The output string (event or state) for the first matching condition, or na if no match found.
o_eventRule
o_eventRule defines a condition-to-output mapping for the concurrent FSM.
Fields:
condName (series string) : The name of the condition to check.
output (series string) : The output (event or state) when the condition is true.
o_eventRuleWrapper
o_eventRuleWrapper wraps an array of o_eventRule for use as map values (maps cannot contain collections directly).
Fields:
a_rules (array) : Array of o_eventRule objects for a specific state.
Bullish_Mayank_entry_Indicator with AlertsIt is a indicator that uses EMAs , RSI and Weighted Mean Average RSI and multitimeframe analysis
AI+ Scalper [BigMoneyMazz Enhanced]Overview:
A professional-grade multi-factor trading indicator that combines trend, momentum, volatility, and volume analysis into a single composite oscillator. It provides clear visual buy/sell signals on your chart with automatic stop-loss and take-profit levels.
How It Works:
4-Way Market Analysis: Analyzes trend strength (ADX), momentum (your choice of 3 oscillators), volatility (ATR), and volume (OBV)
Smart Signal Generation: Only generates signals when multiple factors align (price above/below dynamic thresholds, trend confirmation, and sufficient volatility)
Visual Trading Plan: Plots clear LONG/SHORT labels on your chart with dashed lines showing exact stop-loss (red) and take-profit (green) levels
Live Dashboard: Real-time monitoring of all market conditions in a handy table
Key Features:
🎯 Clear Chart Signals: Green "LONG" and red "SHORT" labels with arrows
⚡ Risk Management: Automatic ATR-based stop-loss and take-profit levels
📊 Smart Dashboard: All key metrics in one view (ADX, Oscillator, Trend, Volume)
🔒 Non-Repainting: Uses only confirmed closing prices for reliable signals
⚙️ Fully Customizable: Adjust every aspect to your trading style
Recommended Settings for Day Trading:
Timeframe: 5-15 minutes
ATR Multiplier SL: 1.5 (tight stop)
ATR Multiplier TP: 3.0 (2:1 risk-reward)
Momentum Mode: Stochastic RSI (most responsive)
Use HTF Filter: ON (15-minute timeframe)
Latching Mode: ON (avoids whipsaws)
Recommended Settings for Swing Trading:
Timeframe: 1H-4H
ATR Multiplier SL: 2.0
ATR Multiplier TP: 4.0 (2:1 risk-reward)
Momentum Mode: Fisher RSI (smoother)
Use HTF Filter: ON (4H or Daily timeframe)
Latching Mode: ON
How to Use:
Wait for LONG/SHORT labels to appear on your chart
Enter trade when price touches your preferred entry level
Set stop-loss at the red dashed line
Set take-profit at the green dashed line
Use the dashboard to confirm market conditions (ADX > 25 = strong trend)
Signal Interpretation:
LONG ▲: Strong buy signal - trend bullish, oscillator above upper threshold
SHORT ▼: Strong sell signal - trend bearish, oscillator below lower threshold
EXIT: Close position (SL/TP hit)
Pro Tip: The dashboard is your best friend! Check that ADX is above 25 (strong trend) and volume is confirming before entering any trade.
This indicator works best as a confirmation tool alongside your existing strategy rather than a completely automated system. Always practice proper risk management!
Weinstein Stage Analyzer — Table Only (more padding)What it does
This indicator applies Stan Weinstein’s Stage Analysis (Stages 1–4) and presents the result in a clean, compact table only—no lines, labels, or overlays. It shows:
• Previous Stage
• Current Stage (with Early / Mature / Late tag)
• Duration (how long price has been in the current stage, in HTF bars)
• Sentiment (Bullish / Bearish / Balanced / Cautious, derived from stage & maturity)
Timeframe-aware logic
• Weekly charts: classic 30-period MA (Weinstein’s original 30-week concept).
• Daily & Intraday: computed on Daily 150 as a practical daily translation of the 30-week idea.
• Monthly: ~7-period MA (~30 weeks ≈ 7 months).
The stage classification itself is evaluated on this HTF context and then displayed on your active chart.
EMA/SMA toggle
Choose EMA (default) or SMA for the trend line used in stage detection.
How stages are decided (practical rules)
• Stage 2 (Advance): MA rising with price above an upper band.
• Stage 4 (Decline): MA falling with price below a lower band.
• Flat MA zones become Stage 1 (Base) or Stage 3 (Top) depending on the prior trend.
“Maturity” tags (Early/Mature/Late) come from run length and extension beyond the band.
Inputs you can tweak
• MA Type: EMA / SMA
• Price Band (±%) and Slope Threshold to tighten/loosen stage flips
• Maturity thresholds: min/max bars & late-extension %
Notes
• Duration is for the entire current stage (e.g., total time in Stage 4), not just the maturity slice.
• A Top Padding Rows input is included to nudge the table lower if it overlaps your OHLC readout.
Disclaimer
For educational use only. Not financial advice. Always confirm with your own analysis, risk management, and market context.
EMA Cross By Crypto collective Xეს ინდიკატორი გაძლევთ საშუალებას ნახოთ ყველაზე პოპულარული EMA წყვილები ერთ გრაფიკზე:
EMA 9/21
EMA 20/50
EMA 50/200
EMA 100/200
და საკუთარი, მომხმარებლის მიერ შერჩეული Custom წყვილი.
👉 თითოეულ წყვილს შეგიძლია ჩართო/გამორთო ინდიკატორის პარამეტრებიდან.
👉 შესაძლებელია ფერების შეცვლა, ასევე სურვილის შემთხვევაში EMA-ების higher timeframe-ზე გამოტანა (მაგ. 1D EMA 4H გრაფიკზე).
ეს ინსტრუმენტი განსაკუთრებით გამოსადეგია:
ტრენდების დადგენისთვის
გრძელვადიანი და მოკლევადიანი გადაკვეთების შესადარებლად
საკუთარი სტრატეგიის ტესტირებისთვის
This indicator lets you plot and compare the most commonly used EMA pairs on a single chart:
EMA 9/21
EMA 20/50
EMA 50/200
EMA 100/200
plus a fully customizable user-defined EMA pair.
👉 Each pair can be toggled on/off from the settings.
👉 Colors are customizable, and you can optionally display EMAs from a higher timeframe (e.g., show Daily EMAs on a 4H chart).
This tool is especially useful for:
Trend confirmation
Comparing short-term vs. long-term crosses
Backtesting your own strategies
HeatCandleHeatCandle - AOC Indicator
✨ Features
📊 Heat-Map Candles: Colors candles based on the price’s deviation from a Triangular Moving Average (TMA), creating a heat-map effect to visualize price zones.
📏 Zone-Based Coloring: Assigns colors to 20 distinct zones (Z0 to Z19) based on the percentage distance from the TMA, with customizable thresholds.
⚙️ Timeframe-Specific Zones: Tailored zone thresholds for 1-minute, 5-minute, 15-minute, 30-minute, 1-hour, and 4-hour timeframes for precise analysis.
🎨 Customizable Visuals: Gradient color scheme from deep blue (oversold) to red (overbought) for intuitive price movement interpretation.
🛠️ Adjustable Parameters: Configure TMA length and threshold multiplier to fine-tune sensitivity.
🛠️ How to Use
Add to Chart: Apply the "HeatCandle - AOC" indicator on TradingView.
Configure Inputs:
TMA Length: Set the period for the Triangular Moving Average (default: 150).
Threshold Multiplier: Adjust the multiplier to scale zone sensitivity (default: 1.0).
Analyze: Observe colored candles on the chart, where colors indicate the price’s deviation from the TMA:
Dark blue (Z0) indicates strong oversold conditions.
Red (Z19) signals strong overbought conditions.
Track Trends: Use the color zones to identify potential reversals, breakouts, or trend strength based on price distance from the TMA.
🎯 Why Use It?
Visual Clarity: The heat-map candle coloring simplifies identifying overbought/oversold conditions at a glance.
Timeframe Flexibility: Zone thresholds adapt to the selected timeframe, ensuring relevance across short and long-term trading.
Customizable Sensitivity: Adjust TMA length and multiplier to match your trading style or market conditions.
Versatile Analysis: Ideal for scalping, swing trading, or trend analysis when combined with other indicators.
📝 Notes
Ensure sufficient historical data for accurate TMA calculations, especially with longer lengths.
The indicator is most effective on volatile markets where price deviations are significant.
Pair with momentum indicators (e.g., RSI, MACD) or support/resistance levels for enhanced trading strategies.
Happy trading! 🚀📈
Z-Score For Loop | MisinkoMasterThe Z-Score For Loop is a new trend following oscillator designed to capture reversals, optimize speed while giving a low amount of noise. The behaviour this interesting and unique tool provides allows traders/investors to get a unique insight into the market trend.
How does it work?
The Z-Score For Loop works like so:
1. Calculate the Z-Score with the following formula:
(source - mean)/Standard Deviation
Where:
source = user defined input, for example close, low, high, hl2 and so on
mean = average of source, using different methods like EMA, recommended approach is not using anything different then EMA, WMA or SMA, since the other options are too noisy and can mess up signals, but you can try them out :)
Standard Deviation = Standard Deviation of the source
2. How many bars back have lower Z-Score value then the current one from start to end
For example:
From 6-55 bars ago how many bars had a lower/higher Z-score?
The methodology & Usage
Combining the classical Z-Score with the For Loop creates an indicator, which like mentioned before creates a unique, smooth & fast signal allowing investors to get an insight into the market, create new advanced strategies and capture the big moves.
Hope you enjoy Gs :)
Multi Straddle-Strangle ChartThis powerful indicator is designed for options traders who want to visualize and track the combined premium of multiple straddle and strangle strategies in a single, dedicated pane.
Quickly analyze and compare up to five different options strategies at a glance, directly on your chart. This tool is perfect for monitoring volatility, tracking potential profits/losses on a position, and spotting key support and resistance levels based on option premiums.
Key Features:
Plot Up to 5 Strategies: Simultaneously plot any combination of up to 5 straddles or strangles.
Real-Time Data: Fetches live data for both Call and Put options to give you an up-to-the-second view of the combined price.
Dynamic Symbol Generation: Automatically detects the underlying symbol (e.g., NIFTY, BANKNIFTY, stocks) and builds the correct option symbols based on your input.
Customizable Inputs: Easily configure the expiry date, strike prices and line colors for each of the 5 lines.
In-Chart Summary Table: A clean and clear table in the corner of your chart provides a quick summary of each enabled strategy and its current price.
Important Note on Usage:
This tool requires you to input a strike price in all fields, even if you do not plan to use all five lines. This is necessary because of a fundamental rule in the Pine Script language: every input must have a constant, non-empty default value. The indicator is optimized to only fetch data for the lines you have explicitly enabled with the "Enable Line X" checkbox.
TQQQ – 200 SMA ±5% Entry / –3% Exit (since 2010) • Metrics by DE✅ In plain words:
You only buy TQQQ when it’s trading 5% above its 200-day SMA (a sign of strong uptrend momentum).
You stay long as long as the price holds above 3% below the 200-day SMA.
If price falls below that lower threshold, you exit to limit drawdown.
The strategy is designed to catch strong uptrends while cutting losses early.
AKTProfessional Style
“This tool helps in marking lines for options and forex, making trading easier and more effective for you.”
“We apply it to mark key lines in options and forex markets, and it provides great value for traders like you.”
“Used for marking support and resistance lines in options and forex, it’s a highly useful tool for your trades.”
🔹 Simple & Direct Style
“We use it to mark lines in options and forex — very useful for you.”
“It helps mark lines for options and forex, making it useful in your trading.”
“A handy way to mark lines in options and forex, and it’s very useful for you.”
High and Low - MS - 2.0"Showing the high and low points with numbers.
Micha the leftist didn’t say how it’s called in his video.
#LeftismIsAMentalIllness"
נותן לראות את הנקודות הגבוהות והנמוכות עם מספרים
מיכה השמאלן לא אמר איך קוראים לזה בסרטון שלו
#שמאלנותזומחלתנפש
14/09/2025