2Saucy custom MA'sEMA's 9/21/50/200 - Designated for "scalping" 1m/3m/5m/15/1h/4h. Works best as it EMA's move faster with price.
SMA's 10/20/50/200 - Works more for swing trading and/or finding setups on weekly and daily time frames.
By combining these two simultaneously trading intra-day is made much simpler.
Yours truly,
#2Saucy
Forecasting
Institutional Sweep Zone (Range-Based)Institutional Sweep Zone (Range-Based)
This indicator models potential stop sweep zones based on institutional capital ranges, helping traders visualize where high-probability liquidity grabs are likely to occur.
Unlike traditional volatility bands, this tool estimates price movement by calculating how far a specific amount of capital—entered into the market—can push price. By defining a lower and upper capital range (in millions of USD), the indicator dynamically draws bands representing the distance institutions could realistically move price in either direction.
It supports directional control, allowing you to focus on long sweeps, short sweeps, or both simultaneously. The pip cost is auto-calibrated based on the selected currency pair, making it highly adaptive to major FX pairs.
Key Features:
-Capital input range (in millions of USD)
-Directional sweep targeting: Long, Short, or Both
-Auto-detection of pip value based on FX pair
-Visual sweep zone mapped above and below current price
-Designed to highlight areas of institutional stop hunts
Why use it?
-Helps avoid setting stops inside common sweep zones
-Improves trade survivability when paired with higher timeframe strategies
-Offers a unique way to view price through an institutional lens
Created by: The_Forex_Steward
Explore more advanced tools and concepts on my TradingView profile.
Golden Ratio Trend Persistence [EWT]Golden Ratio Trend Persistence
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Overview
The Golden Ratio Trend Persistence is a dynamic tool designed to identify the strength and persistence of market trends. It operates on a simple yet powerful premise: a trend is likely to continue as long as it doesn't retrace beyond the key Fibonacci golden ratio of 61.8%.
This indicator automatically identifies the most significant swing high or low and plots a single, dynamic line representing the 61.8% retracement level of the current move. This line acts as a "line in the sand" for the prevailing trend. The background color also changes to provide an immediate visual cue of the current market direction.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Power of the Golden Ratio (61.8%)
The golden ratio (ϕ≈1.618) and its inverse (0.618, or 61.8%) are fundamental mathematical constants that appear throughout nature, art, and science, often representing harmony and structure. In financial markets, this ratio is a cornerstone of Fibonacci analysis and is considered one of the most critical levels for price retracements.
Market movements are not linear; they progress in waves of impulse and correction. The 61.8% level often acts as the ultimate point of support or resistance. A trend that can hold this level demonstrates underlying strength and is likely to persist. A breach of this level, however, suggests a fundamental shift in market sentiment and a potential reversal.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to Use This Indicator
This indicator is designed for clarity and ease of use.
Identifying the Trend : The visual cues make the current trend instantly recognizable.
A teal line with a teal background signifies a bullish trend. The line acts as dynamic support.
A maroon line with a maroon background signifies a bearish trend. The line acts as dynamic resistance.
Confirming Trend Persistence : As long as the price respects the plotted level, the trend is considered intact.
In an uptrend, prices should remain above the teal line. The indicator will automatically adjust its anchor to new, higher lows, causing the support line to trail the price.
In a downtrend, prices should remain below the maroon line.
Spotting Trend Reversals : The primary signal is a trend reversal, which occurs when the price closes decisively beyond the plotted level.
Potential Sell Signal : When the price closes below the teal support line, it indicates that buying pressure has failed, and the uptrend is likely over.
Potential Buy Signal : When the price closes above the maroon resistance line, it indicates that selling pressure has subsided, and a new uptrend may be starting.
Think of this tool as an intelligent, adaptive trailing stop that is based on market structure and the time-tested principles of Fibonacci analysis.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Input Parameters
You can customize the indicator's sensitivity through the following inputs in the settings menu:
Pivot Lookback Left : This number defines how many bars to the left of a candle must be lower (for a pivot high) or higher (for a pivot low) to identify a potential swing point. A higher value will result in fewer, but more significant, pivots being detected.
Pivot Lookback Right : This defines the number of bars that must close to the right before a swing point is confirmed. This parameter prevents the indicator from repainting. A higher value increases confirmation strength but also adds a slight lag.
Fibonacci Ratio : While the default is the golden ratio (0.618), you can adjust this to other key Fibonacci levels, such as 0.5 (50%) or 0.382 (38.2%), to test for different levels of trend persistence.
Adjusting these parameters allows you to fine-tune the indicator for different assets, timeframes, and trading styles, from short-term scalping to long-term trend following.
Quantum Harmonic Oscillator Overlay🧪 Quantum Harmonic Oscillator Overlay
A visual model of price behavior using quantum harmonic oscillation principles
📜 Indicator Overview
The Quantum Harmonic Oscillator Overlay applies concepts from both classical physics (harmonic motion) and quantum mechanics (energy states) to model and visualize how price orbits around a central trend line. It overlays a Linear Regression line (representing the “mean position” or ground state of price) and calculates surrounding energy levels (σ-zones) akin to quantum shells that price can "jump" between.
This indicator is particularly useful for visualizing mean reversion, volatility compression/expansion, and momentum-driven price breakthroughs.
🧠 Core Concepts
Linear Regression Line (LSR): This is the calculated center of gravity or equilibrium path of price over a user-defined period. Think of it like the lowest energy state or central axis around which price vibrates.
Standard Deviation Zones (σ-levels):
1σ: The majority of normal price activity; within this range, price tends to fluctuate if in balance.
2σ: Indicates volatility or possible breakout pressure.
3σ: Represents extreme movement — a phase shift in energy, potentially leading to reversal or continuation with higher momentum.
Quantum Analogy: Just like in a quantum harmonic oscillator, particles (here, prices) move probabilistically between discrete energy states. The further the price moves from the center, the more "energy" (momentum, volume, volatility) is implied.
⚙️ Input Parameters
Setting Description
Linear Regression Length The number of bars used to calculate the regression trend (default 100). Affects the central path and responsiveness.
σ Multipliers (1σ, 2σ, 3σ) Determine how far each band is from the regression line. Adjusting these can highlight different price behaviors.
Show Energy Level Zones Toggle visibility of the colored bands around the regression line.
Show LSR Center Line Toggles visibility of the white Linear Regression line itself.
🎨 Visual Components
Color Zone Interpretation
✅ Green ±1σ Normal oscillation / mean reversion area. Ideal for range-bound strategies.
🟧 Orange ±2σ Warning zone; price may be gaining momentum or volatility.
🔴 Red ±3σ High-momentum state or anomaly. These regions may imply trend exhaustion, reversals, or breakouts.
White Line: The LSR — the average trajectory of the price movement.
Pink Dots: Appear when price exceeds Zone 3 (outside ±3σ) — a signal of extreme behavior or a possible regime shift.
📈 How to Use This Indicator
1. Detect Overextensions
When price touches or breaches the 3σ zone, it is likely overextended. This can be used to anticipate potential snapbacks or strong breakout trends.
2. Identify Mean Reversion Trades
If price exits the 2σ or 3σ zones and returns toward the center line, this signals a likely mean reversion setup.
3. Volatility Compression or Expansion
Flat zones between σ levels suggest calm markets; widening bands suggest expanding volatility.
4. Use with Confirmation Tools
Combine with momentum oscillators (MACD, RSI) or volume-based signals to confirm reversals or continuation outside Zone 3.
🔮 Philosophical Note
This indicator embodies the metaphor that the market behaves like a quantum oscillator — price particles exist in a probabilistic field and jump between discrete zones of volatility and energy. Tracking these transitions allows the trader to see price behavior as rhythmic, wave-like, and multidimensional rather than purely linear.
Tiny Candle + High Volume DetectorTiny Candle + High Volume Detector
This simple indicator highlights candles with:
A very small body (user-defined % of the close)
A significant volume spike (volume > X times average)
📊 Use this to spot:
Compression zones before breakout
Smart money absorption
Hidden accumulation
⚙️ Adjustable Parameters:
Max Body Size (% of close)
Volume Spike Multiplier
Volume SMA Period
🔔 Alerts are included.
Works on all timeframes and instruments. Best used in trending or consolidating environments to detect buildup before expansion.
Futures Support & Resistance LevelsMulti-Timeframe Support & Resistance Levels for Futures Trading
Description:
This indicator automatically identifies and displays key support and resistance levels using multiple technical analysis methods. Designed specifically for futures traders (ES, NQ, etc.), it provides a clean, organized view of important price levels.
Key Features:
Multiple Detection Methods: Combines pivot points, daily ranges, and psychological levels
Smart Ranking System: Levels are numbered by strength (1 = strongest)
Clean Visualization: Extended lines across the chart with clear price labels
Confluence Detection: Highlights areas where multiple levels converge
Customizable Display: Adjust colors, line styles, and label sizes
Level Types Identified:
Daily High/Low (current session)
Previous Daily High/Low
Pivot-based Support/Resistance
Psychological Round Numbers
Confluence Zones (multiple levels clustering)
Technical Approach:
The indicator uses a strength-scoring algorithm to rank levels by importance. Daily levels receive the highest weighting (2.0), followed by previous daily levels (1.5), pivot points (1.0), and psychological levels (0.5). This helps traders focus on the most significant levels.
Visual Elements:
Solid lines = Strong levels
Dashed lines = Medium levels
Dotted lines = Weak levels
Optional technical condition markers for educational analysis
Best Used For:
Identifying key intraday levels for futures trading
Finding high-probability reversal zones
Setting logical stop-loss and take-profit levels
Recognizing confluence areas for stronger setups
Note:
This is a technical analysis tool for educational purposes. No indicator can predict future price movements. Always use proper risk management and combine with other forms of analysis.
Mongoose Capital: BTC ETF DriftScope ProMongoose Capital: BTC ETF DriftScope Pro
A proprietary indicator for monitoring drift between Bitcoin Spot (BTCUSD) and Bitcoin Spot ETFs (such as IBIT). Designed to detect ETF premium/discount zones and generate actionable Fade or Long bias signals.
What it Does
Tracks IBIT and BTCUSD spread to highlight ETF price deviations.
Calculates correlation Z-Score for ETF/Spot alignment.
Outputs numeric bias signals: Fade (1), Long (1), Neutral (1).
How to Use
Apply to a BTCUSD chart (4H, 1D, or higher recommended).
Open the Data Window to view:
IBIT Spread %
Correlation Z-Score
Correlation %
Bias Flags (Fade, Long, Neutral)
Configure alerts for Fade and Long Bias conditions.
Confirm all signals with your trade plan and risk management.
Methodology
This tool calculates the percentage spread between IBIT and BTC Spot. A rolling Z-Score of the correlation is used to detect periods of significant divergence.
Fade Bias suggests potential short setups in premium zones with high Z-Scores.
Long Bias suggests potential long setups in discount zones with low Z-Scores.
Disclaimer
This indicator is for educational purposes only. It is not financial advice. Use at your own risk and verify signals independently.
Universal Trade Levels & Signal Classifierscript has been enhanced and generalized for all instruments — not just ES or SPX.
You now get the following classifications:
💎 Perfect Trade – trend confirmed, strong signal, ATR + VWAP + volume aligned
🚀 Sure Shot Trade – very high volume + ATR breakout + directional bias
⚡ Quick Call/Put – fast actionable setups
❌ No Trade – avoid/no confirmation
The logic works across any timeframe and any ticker.
You can now test this live on any instrument in TradingView. Let me know if you’d like to add things like:
Multi-timeframe confirmation
Re-entry logic
Heatmap table of confidence levels
Signal filtering based on RSI, OBV, etc.
Profit Sniper RSI Based Buy/Sell📌 Profit Sniper RSI – Intelligent Buy/Sell Signals Based on Adaptive RSI Zones
Profit Sniper RSI is a precision-engineered indicator that generates high-confidence Buy and Sell signals by dynamically interpreting the Relative Strength Index (RSI) across five market zones. It is designed to reduce signal noise and avoid false breakouts using a combination of crossover logic, zone validation, and trend sentiment detection.
🔍 Underlying Concept:
This script divides the RSI into five structured zones:
- **0–24**: Power Sell (Extreme bearish momentum)
- **24–40**: Sell (Weak price action with downward pressure)
- **40–60**: Neutral/Consolidation (No clear trend)
- **60–76**: Buy (Bullish initiation zone)
- **76–100**: Power Buy (Strong bullish momentum)
Signals are generated **only after the RSI crosses a zone boundary** (e.g., from below 60 to above 60), and only **after the candle closes**, which helps filter out noise from intra-bar RSI fluctuations.
📈 Signal Logic:
- **Buy signals** are triggered when RSI crosses key thresholds (24, 40, or 60) upward, indicating rising strength.
- **Sell signals** are triggered when RSI crosses downward below 76, 60, or 40, suggesting trend weakness or reversal.
- **Power Buy and Power Sell signals** are reserved for extreme crossovers beyond 76 and below 24, respectively.
- The script avoids repeated signals (e.g., Buy after Buy) by tracking the last confirmed signal state.
🔧 Customization:
- Users can toggle visibility of Buy, Sell, Power Buy, and Power Sell signals independently.
- Adjustable RSI length input to fit different market conditions or timeframes.
- Displays a real-time info panel showing the current RSI, last signal type, the RSI level at the time of the last signal, and the price when the signal was triggered.
🧠 How It Helps Traders:
- Reduces false entries by only generating signals **after candle closure**.
- Designed to work across **any timeframe** and **any market** (Crypto, Forex, Stocks).
- Ideal for traders who rely on **RSI-based confirmation** before entry and prefer minimal visual clutter.
- Acts as a sniper tool — waiting for clear RSI structure and crossover before acting.
⚠️ Note:
This script does **not repaint**. All signals are based on closed-bar RSI logic. While no indicator guarantees profitability, this tool is built for serious traders who value disciplined entries backed by momentum structure.
💡 Tip: Combine Profit Sniper RSI with key support/resistance or trendline zones for added confluence and trade precision.
Silver Bull Flag Breakout AlertDescription:
This script detects a bullish breakout in Silver (XAGUSD) above $37.60, confirming a bull flag continuation pattern on the daily chart. It optionally plots a 21 EMA as a trailing stop and includes a customizable alert condition for trade execution or monitoring.
Features:
• Alerts on daily close above $37.60
• Optional trailing stop (21 EMA)
• Visual breakout marker
• Ideal for swing trades targeting $41–$45
Tesla's 3-6-9 Grid – BTC Price LevelsThis indicator plots horizontal levels on the chart at every $1800 step, up to $180,000.
It’s inspired by Tesla’s 3-6-9 theory and the magic of the number 18 – the only number divisible by 3, 6, and 9, and whose digital root is 9.
Historically, many Bitcoin all-time highs have aligned closely with $1800 multiples, such as:
* $19,800 (2017 ATH)
* $64,800 and $68,400 (2021 double tops)
* $73,800 (2024 ATH)
This grid helps you visualize whether BTC respects these “Tesla levels” and how price interacts with them across cycles.
Created to assist multi-chart BTC traders who need quick reference levels without drawing lines manually.
F2D Highlighter + FTFC + Volume Spike + Dashboard🧪 Why F2D Works
It traps short sellers who expect a breakdown
When it reclaims prior ranges, buyers flood back in
Paired with timeframe continuity (green on higher timeframes), it increases the edge
💸 F2D in Options Trading
Ideal for Calls when:
You're near a key level (VWAP, support, inside week/day)
Volume surges on reclaim
You catch a 2D that flips into a 2U (strong reversal)
🔧 Strike selection: ATM or 1–2 strikes OTM
⏰ Expiration: Same day or next day (if late in the day)
💥 Targets: 30–50% profit, then trail or scale out
IU Inside/Harami candlestick patternDESCRIPTION
The IU Inside/Harami Candlestick Pattern indicator is designed to detect bullish and bearish inside bar formations, also known as Harami patterns. This tool gives users flexibility by allowing pattern detection based on candle wicks, bodies, or a combination of both. It highlights detected patterns using colored boxes and optional text labels on the chart, helping traders quickly identify areas of consolidation and potential reversals.
USER INPUTS :
Pattern Recognition Based on =
Choose between "Wicks", "Body", or "Both" to determine how the inside candle pattern is identified.
Show Box =
Toggle the appearance of colored boxes that highlight the pattern zone.
Show Text =
Toggle on-screen labels for "Bullish Inside" or "Bearish Inside" when patterns are detected.
INDICATOR LOGIC :
Bullish Inside Bar (Harami) is detected when:
* The current candle's high is lower and low is higher than the previous candle (wick-based),
* or the current candle’s open and close are inside the previous candle’s body (body-based),
* and the current candle is bullish while the previous is bearish.
Bearish Inside Bar (Harami) is detected when:
* The current candle's high is lower and low is higher than the previous candle (wick-based),
* or the current candle’s open and close are inside the previous candle’s body (body-based),
* and the current candle is bearish while the previous is bullish.
The user can choose wick-based, body-based, or both logics for pattern confirmation.
Boxes are drawn between the highs and lows of the pattern, and alert messages are generated upon confirmation.
Optional labels show the pattern name for quick visual identification.
WHY IT IS UNIQUE :
Offers three different logic modes: wick-based, body-based, or combined.
Highlights patterns visually with customizable boxes and labels.
Includes built-in alerts for immediate notifications.
Uses clean and transparent plotting without repainting.
HOW USER CAN BENEFIT FROM IT :
Receive real-time alerts when Inside/Harami patterns are formed.
Use the boxes and text labels to spot price compression zones and breakout potential.
Combine it with other tools like trendlines or support/resistance for enhanced accuracy.
Suitable for scalpers, swing traders, and price action traders looking to trade inside bar breakouts or reversals.
DISCLAIMER :
This indicator is not financial advice, it's for educational purposes only highlighting the power of coding( pine script) in TradingView, I am not a SEBI-registered advisor. Trading and investing involve risk, and you should consult with a qualified financial advisor before making any trading decisions. I do not guarantee profits or take responsibility for any losses you may incur.
Smart Money Premium | Made by EF (Improved)📊 Smart Money Premium | Made by EF (Improved)
A powerful all-in-one toolkit built for Smart Money / ICT traders.
It helps you clearly identify market structure, liquidity, order blocks, fair value gaps, and high-probability entry signals — all visualized directly on your chart.
✨ Key features:
✅ Automatic detection of Swing High / Swing Low points
✅ Real-time BOS / CHOCH (Break of Structure / Change of Character) labeling
✅ Dynamic Order Blocks with adjustable duration and color
✅ Detection of Fair Value Gaps (FVG) and visualization with customizable zones
✅ Liquidity zones (EQH/EQL) with tolerance settings
✅ Smart Swing Failure Patterns (SFP) with instant labels
✅ Built-in Kill Zones for London & New York sessions
✅ Automatic adaptation of key parameters to your timeframe
✅ Volume filter for additional signal confirmation
✅ Clear SL/TP levels with customizable Risk:Reward
✅ Interactive status panel showing trend, structure, session, and live signal readiness
⚙️ How to use:
1️⃣ Add the indicator to your chart
2️⃣ Choose your preferred settings (or let it auto-tune by timeframe)
3️⃣ Follow the on-chart signals: BOS, CHOCH, SFP, OB & FVG zones
4️⃣ Use the SL/TP levels and Risk:Reward built into each signal to plan your trades
✅ Designed for:
• Traders who follow Smart Money Concepts / ICT methodology
• Those who want a clean, visual and data-driven approach
• Both beginners and advanced traders looking to save time and keep discipline
🛠 All logic is transparent and customizable — colors, lookback periods, OB/FVG duration, liquidity sensitivity and more.
🔔 Alerts included for Long and Short setups.
Range Breakout Statistics [Honestcowboy]
⯁ Overview
The Range Breakout Statistics uses a very simple system to detect ranges/consolidating markets. The principle is simple, it looks for areas where the slope of a moving average is flat compared to past values. If the moving average is flat for X amount of bars that's a range and it will draw a box.
The statistics part of the script is a bit more complicated. The aim of this script is to expand analysis of trading signals in a different way than a regular backtest. It also highlights the polyline tool, one of my favorite drawing tools on the tradingview platform.
⯁ Statistics Methods
The script has 2 different modes of analyzing a trading signals strength/robustness. It will do that for 2 signals native to the script.
Upper breakout: first price breakout at top of box, before max bars (100 bars by default)
Lower breakout: first price breakout at bottom of box, before max bars
The analysis methods themselves are straightforward and it should be possible for tradingview community to expand this type of analysis to other trading signals. This script is a demo for this analysis, yet some might still find the native signals helpful in their trading, that's why the script includes alerts for the 2 native signals. I've also added a setting to disable any data gathering, which makes script run faster if you want to automate it.
For both of the analysis methods it uses the same data, just with different calculations and drawing methods. The data set is all past price action reactions to the signals saved in a matrix. Below a chart for explaining this visually.
⯁ Method 1: Averages Projection
The idea behind this is that just showing all price action that happened after signal does not give actionable insights. It's more a spaghetti jumble mess of price action lines. So instead the script averages the data out using 3 different approaches, all selectable in the settings menu.
Geometric Average: useful as it accurately reflects compound returns over time, smoothing out the impact of large gains or losses. Accounts for volatility drift.
Arithmetic Average: a standard average calculation, can be misleading in trading due to volatility drift. It is the most basic form of averaging so I included it.
Median: useful as any big volatility huge moves after a signal does not really impact the mean as it's just the middle value of all values.
These averages are the 2 lines you will find in the middle of the projection. Having a clear difference between a lower break average and upper break average price reaction can signal significance of the trading signal instead of pure chaos.
Outside of this I also included calculations for the maximum and minimum values in the dataset. This is useful for seeing price reactions range to the signal, showing extreme losses or wins are possible. For this range I also included 2 matrices of highs and lows data. This makes it possible to draw a band between the range based on closing price and the one using high/low data.
Below is a visualisation of how the averages data is shown on chart.
⯁ Method 2: Equity Simulation
This method will feel closer to home for traders as it more closely resembles a backtest. It does not include any commissions however and also is just a visualisation of price reaction to a signal. This method will simulate what would happen if you would buy at the breakout point and hold the trade for X amount of bars. With 0 being sell at same bar close. To test robustness I've given the option to visualise Equity simulation not just for 1 simulation but a bunch of simulations.
On default settings it will draw the simulations for 0 bars holding all the way to 10 bars holding. The idea behind it is to check how stable the effect is, to have further confirmation of the significance of the signal. If price simulation line moves up on average for 0 bars all the way to 10 bars holding time that means the signal is steady.
Below is a visualisation of the Equity Simulation.
⯁ Signal filtering
For the boxes themselves where breakouts come from I've included a simple filter based on the size of the box in ATR or %. This will filter out all the boxes that are larger top to bottom than the ATR or % value you setup.
⯁ Coloring of Script
The script includes 5 color themes, each carefully created using color themes from the pantone color institute. There are no color settings or other visual settings in the script, the script themes are simple and always have colors that work well together. Equity simulation uses a gradient based on lightness to color the different lines so it's easier to differentiate them while still upper breaks having a different color than lower breaks.
This script is not created to be used in conjunction with other scripts, it will force you into a background color that matches the theme. It's purpose is a research tool for systematic trading, to analyse signals in more depth.
Metaverse color theme:
⯁ Conclusion
I hope this script will help traders get a deeper understanding of how different assets react to their assets. It should be possible to convert this script into other signals if you know how to code on the platform. It is my intention to make more publications that include this type of analysis. It is especially useful when dealing with signals that do not happen often enough, so a regular backtest is not enough to test their significance.
Position Size Calculator with Fees# Position Size Calculator with Portfolio Management - Manual
## Overview
The Position Size Calculator with Portfolio Management is an advanced Pine Script indicator designed to help traders calculate optimal position sizes based on their total portfolio value and risk management strategy. This tool automatically calculates your risk amount based on portfolio allocation percentages and determines the exact position size needed while accounting for trading fees.
## Key Features
- **Portfolio-Based Risk Management**: Calculates risk based on total portfolio value
- **Tiered Risk Allocation**: Separates trading allocation from total portfolio
- **Automatic Trade Direction Detection**: Determines long/short based on entry vs stop loss
- **Fee Integration**: Accounts for trading fees in position size calculations
- **Risk Factor Adjustment**: Allows scaling of position size up or down
- **Visual Display**: Shows all calculations in a clear, color-coded table
- **Automatic Risk Calculation**: No need to manually input risk amount
## Input Parameters
### Total Portfolio ($)
- **Purpose**: The total value of your investment portfolio
- **Default**: 0.0
- **Range**: Any positive value
- **Step**: 0.01
- **Example**: If your total portfolio is worth $100,000, enter 100000
### Trading Portfolio Allocation (%)
- **Purpose**: The percentage of your total portfolio allocated to active trading
- **Default**: 20.0%
- **Range**: 0.0% to 100.0%
- **Step**: 0.01
- **Example**: If you allocate 20% of your portfolio to trading, enter 20
### Risk from Trading (%)
- **Purpose**: The percentage of your trading allocation you're willing to risk per trade
- **Default**: 0.1%
- **Range**: Any positive value
- **Step**: 0.01
- **Example**: If you risk 0.1% of your trading allocation per trade, enter 0.1
### Entry Price ($)
- **Purpose**: The price at which you plan to enter the trade
- **Default**: 0.0
- **Range**: Any positive value
- **Step**: 0.01
### Stop Loss ($)
- **Purpose**: The price at which you will exit if the trade goes against you
- **Default**: 0.0
- **Range**: Any positive value
- **Step**: 0.01
### Risk Factor
- **Purpose**: A multiplier to scale your position size up or down
- **Default**: 1.0 (no scaling)
- **Range**: 0.0 to 10.0
- **Step**: 0.1
- **Examples**:
- 1.0 = Normal position size
- 2.0 = Double the position size
- 0.5 = Half the position size
### Fee (%)
- **Purpose**: The percentage fee charged per transaction
- **Default**: 0.01% (0.01)
- **Range**: 0.0% to 1.0%
- **Step**: 0.001
## How Risk Amount is Calculated
The script automatically calculates your risk amount using this formula:
```
Risk Amount = Total Portfolio × Trading Allocation (%) × Risk % ÷ 10,000
```
### Example Calculation:
- Total Portfolio: $100,000
- Trading Allocation: 20%
- Risk per Trade: 0.1%
**Risk Amount = $100,000 × 20 × 0.1 ÷ 10,000 = $20**
This means you would risk $20 per trade, which is 0.1% of your $20,000 trading allocation.
## Portfolio Structure Example
Let's say you have a $100,000 portfolio:
### Allocation Structure:
- **Total Portfolio**: $100,000
- **Trading Allocation (20%)**: $20,000
- **Long-term Investments (80%)**: $80,000
### Risk Management:
- **Risk per Trade (0.1% of trading)**: $20
- **Maximum trades at risk**: Could theoretically have 1,000 trades before risking entire trading allocation
## How Position Size is Calculated
### Trade Direction Detection
- **Long Trade**: Entry price > Stop loss price
- **Short Trade**: Entry price < Stop loss price
### Position Size Formulas
#### For Long Trades:
```
Position Size = -Risk Factor × Risk Amount / (Stop Loss × (1 - Fee) - Entry Price × (1 + Fee))
```
#### For Short Trades:
```
Position Size = -Risk Factor × Risk Amount / (Entry Price × (1 - Fee) - Stop Loss × (1 + Fee))
```
## Output Display
The indicator displays a comprehensive table with color-coded sections:
### Portfolio Information (Light Blue Background)
- **Portfolio (USD)**: Your total portfolio value
- **Trading Portfolio Allocation (%)**: Percentage allocated to trading
- **Risk as % of Trading**: Risk percentage per trade
### Trade Setup (Gray Background)
- **Entry Price**: Your specified entry price
- **Stop Loss**: Your specified stop loss price
- **Fee (%)**: Trading fee percentage
- **Risk Factor**: Position size multiplier
### Risk Analysis (Red Background)
- **Risk Amount**: Automatically calculated dollar risk
- **Effective Entry**: Actual entry cost including fees
- **Effective Exit**: Actual exit value including fees
- **Expected Loss**: Calculated loss if stop loss is hit
- **Deviation from Risk %**: Accuracy of risk calculation
### Final Result (Blue Background)
- **Position Size**: Number of shares/units to trade
## Usage Examples
### Example 1: Conservative Long Trade
- **Total Portfolio**: $50,000
- **Trading Allocation**: 15%
- **Risk per Trade**: 0.05%
- **Entry Price**: $25.00
- **Stop Loss**: $24.00
- **Risk Factor**: 1.0
- **Fee**: 0.01%
**Calculated Risk Amount**: $50,000 × 15% × 0.05% ÷ 100 = $3.75
### Example 2: Aggressive Short Trade
- **Total Portfolio**: $200,000
- **Trading Allocation**: 30%
- **Risk per Trade**: 0.2%
- **Entry Price**: $150.00
- **Stop Loss**: $155.00
- **Risk Factor**: 2.0
- **Fee**: 0.01%
**Calculated Risk Amount**: $200,000 × 30% × 0.2% ÷ 100 = $120
**Actual Risk**: $120 × 2.0 = $240 (due to risk factor)
## Color Coding System
- **Green/Red Header**: Trade direction (Long/Short)
- **Light Blue**: Portfolio management parameters
- **Gray**: Trade setup parameters
- **Red**: Risk-related calculations and results
- **Blue**: Final position size result
## Best Practices
### Portfolio Management
1. **Keep trading allocation reasonable** (typically 10-30% of total portfolio)
2. **Use conservative risk percentages** (0.05-0.2% per trade)
3. **Don't risk more than you can afford to lose**
### Risk Management
1. **Start with small risk factors** (1.0 or less) until comfortable
2. **Monitor your total exposure** across all open positions
3. **Adjust risk based on market conditions**
### Trade Execution
1. **Always validate calculations** before placing trades
2. **Account for slippage** in volatile markets
3. **Consider position size relative to liquidity**
## Risk Management Guidelines
### Conservative Approach
- Trading Allocation: 10-20%
- Risk per Trade: 0.05-0.1%
- Risk Factor: 0.5-1.0
### Moderate Approach
- Trading Allocation: 20-30%
- Risk per Trade: 0.1-0.15%
- Risk Factor: 1.0-1.5
### Aggressive Approach
- Trading Allocation: 30-40%
- Risk per Trade: 0.15-0.25%
- Risk Factor: 1.5-2.0
## Troubleshooting
### Common Issues
1. **Position Size shows 0**
- Verify all portfolio inputs are greater than 0
- Check that entry price differs from stop loss
- Ensure calculated risk amount is positive
2. **Very small position sizes**
- Increase risk percentage or risk factor
- Check if your risk amount is too small for the price difference
3. **Large risk deviation**
- Normal for very small positions
- Consider adjusting entry/stop loss levels
### Validation Checklist
- Total portfolio value is realistic
- Trading allocation percentage makes sense
- Risk percentage is conservative
- Entry and stop loss prices are valid
- Trade direction matches your intention
## Advanced Features
### Risk Factor Usage
- **Scaling up**: Use risk factors > 1.0 for high-confidence trades
- **Scaling down**: Use risk factors < 1.0 for uncertain trades
- **Never exceed**: Risk factors that would risk more than your comfort level
### Multiple Timeframe Analysis
- Use different risk factors for different timeframes
- Consider correlation between positions
- Adjust trading allocation based on market conditions
## Disclaimer
This tool is for educational and planning purposes only. Always verify calculations manually and consider market conditions, liquidity, and correlation between positions. The automated risk calculation assumes you're comfortable with the mathematical relationship between portfolio allocation and individual trade risk. Past performance doesn't guarantee future results, and all trading involves risk of loss.
Easy Position Size Calculator with Fees# Easy Position Size Calculator with Fees - Manual
## Overview
The Easy Position Size Calculator is a Pine Script indicator designed to help traders calculate the optimal position size for their trades while accounting for trading fees. This tool automatically determines whether you're planning a long or short position and calculates the exact position size needed to risk a specific dollar amount.
## Key Features
- **Automatic Trade Direction Detection**: Determines if you're going long or short based on entry price vs stop loss
- **Fee Integration**: Accounts for trading fees in position size calculations
- **Risk Management**: Calculates position size based on your specified risk amount
- **Risk Factor Adjustment**: Allows you to scale your position size up or down
- **Visual Display**: Shows all calculations in a clear, organized table
## Input Parameters
### Entry Price ($)
- **Purpose**: The price at which you plan to enter the trade
- **Default**: 0.0
- **Range**: Any positive value
- **Step**: 0.01
### Stop Loss ($)
- **Purpose**: The price at which you will exit the trade if it goes against you
- **Default**: 0.0
- **Range**: Any positive value
- **Step**: 0.01
### Risk ($)
- **Purpose**: The maximum dollar amount you're willing to lose on this trade
- **Default**: 0.0
- **Range**: Any positive value
- **Step**: 0.01
### Risk Factor
- **Purpose**: A multiplier to scale your position size up or down
- **Default**: 1.0 (no scaling)
- **Range**: 0.0 to 10.0
- **Step**: 0.1
- **Examples**:
- 1.0 = Normal position size
- 2.0 = Double the position size
- 0.5 = Half the position size
### Fee (%)
- **Purpose**: The percentage fee charged per transaction (buy/sell)
- **Default**: 0.01% (0.01)
- **Range**: 0.0% to 1.0%
- **Step**: 0.001
## How It Works
### Trade Direction Detection
The script automatically determines your trade direction:
- **Long Trade**: Entry price > Stop loss price
- **Short Trade**: Entry price < Stop loss price
### Position Size Calculation
#### For Long Trades:
```
Position Size = -Risk Factor × Risk Amount / (Stop Loss × (1 - Fee) - Entry Price × (1 + Fee))
```
#### For Short Trades:
```
Position Size = -Risk Factor × Risk Amount / (Entry Price × (1 - Fee) - Stop Loss × (1 + Fee))
```
### Fee Adjustment
The script accounts for fees on both entry and exit:
- **Long trades**: You pay fees when buying (entry) and selling (exit)
- **Short trades**: You pay fees when shorting (entry) and covering (exit)
## Output Display
The indicator displays a table with the following information:
### Trade Information
- **Trade Type**: Shows whether it's a LONG, SHORT, or INVALID trade
- **Entry Price**: Your specified entry price
- **Stop Loss**: Your specified stop loss price
- **Fee (%)**: The fee percentage being used
### Risk Parameters
- **Risk Amount**: The dollar amount you're willing to risk
- **Risk Factor**: The multiplier being applied
### Calculated Values
- **Effective Entry**: The actual cost per share including fees
- **Effective Exit**: The actual exit value per share including fees
- **Expected Loss**: The calculated loss if stop loss is hit
- **Deviation from Risk %**: Shows how close the expected loss is to your target risk
- **Position Size**: The number of shares/units to trade
## Usage Examples
### Example 1: Long Trade
- Entry Price: $100.00
- Stop Loss: $95.00
- Risk Amount: $500.00
- Risk Factor: 1.0
- Fee: 0.01%
**Result**: The script will calculate how many shares to buy so that if the stop loss is hit, you lose approximately $500 (accounting for fees). Position Size: 99.61152
### Example 2: Short Trade
- Entry Price: $50.00
- Stop Loss: $55.00
- Risk Amount: $300.00
- Risk Factor: 1.0
- Fee: 0.01%
**Result**: The script will calculate how many shares to short so that if the stop loss is hit, you lose approximately $300 (accounting for fees). Position Size: 59.87426
## Important Notes
### Validation Requirements
For the script to work properly, all of the following must be true:
- Entry price > 0
- Stop loss > 0
- Risk amount > 0
- Entry price ≠ Stop loss (to determine direction)
### Negative Position Sizes
The script may show negative position sizes, which is normal:
- **Negative values for long trades**: Represents shares to buy
- **Negative values for short trades**: Represents shares to short
### Risk Deviation
The "Deviation from Risk %" shows how closely the calculated position size matches your target risk. Small deviations are normal due to:
- Fee calculations
- Rounding
- Market precision
## Color Coding
The table uses color coding for easy identification:
- **Green**: Long trade information
- **Red**: Short trade information
- **Gray**: Invalid trade (when inputs are incorrect)
- **Blue**: Final position size
- **Red background**: Risk-related calculations
## Troubleshooting
### Common Issues
1. **Position Size shows 0**
- Check that all inputs are greater than 0
- Ensure entry price is different from stop loss
2. **Trade Type shows INVALID**
- Verify that entry price and stop loss are both positive
- Make sure entry price ≠ stop loss
3. **Large Risk Deviation**
- This is normal for very small position sizes
- Consider adjusting your risk amount or price levels
## Best Practices
1. **Always validate your inputs** before placing actual trades
2. **Double-check the trade direction** shown in the table
3. **Review the expected loss** to ensure it aligns with your risk management
4. **Consider the effective entry/exit prices** which include fees
5. **Use appropriate risk factors** - avoid extreme values that could lead to overexposure
## Disclaimer
This tool is for educational and planning purposes only. Always verify calculations manually and consider market conditions, liquidity, and other factors before placing actual trades. The script assumes that fees are charged on both entry and exit transactions.
VIX-Price Covariance MonitorThe VIX-Price Covariance Monitor is a statistical tool that measures the evolving relationship between a security's price and volatility indices such as the VIX (or VVIX).
It can give indication of potential market reversal, as typically, volatility and the VIX increase before markets turn red,
This indicator calculates the Pearson correlation coefficient using the formula:
ρ(X,Y) = cov(X,Y) / (σₓ × σᵧ)
Where:
ρ is the correlation coefficient
cov(X,Y) is the covariance between price and the volatility index
σₓ and σᵧ are the standard deviations of price and the volatility index
Enjoy!
Features
Dual Correlation Periods: Analyze both short-term and long-term correlation trends simultaneously
Adaptive Color Coding: Correlation strength is visually represented through color intensity
Market Condition Assessment: Automatic interpretation of correlation values into actionable market insights
Leading/Lagging Analysis: Optional time-shift analysis to detect predictive relationships
Detailed Information Panel: Real-time statistics including current correlation values, historical averages, and trading implications
Interpretation
Positive Correlation (Red): Typically bearish for price, as rising VIX correlates with falling markets. This is what traders should be looking for.
Negative Correlation (Green): Typically bullish for price, as falling VIX correlates with rising markets
How to use it
Apply the indicator to any chart to see its correlation with the default VIX index
Adjust the correlation length to match your trading timeframe (shorter for day trading, longer for swing trading)
Enable the secondary correlation period to compare different timeframes simultaneously
For advanced analysis, enable the Leading/Lagging feature to detect if VIX changes precede or follow price movements
Use the information panel to quickly assess the current market condition and potential trading implications
HSHS Volume Divergence MTF v6 (Final Fix)HSHS Volume Divergence MTF v6
Zmienność
Dywergencja
Momentum
RSI
Smart Directional Fib Zone (Selectable Session)🎯 Overview
This indicator plots a dynamic Fibonacci zone between the 0.5 and 0.618 levels , calculated from the previous day’s price action , and is designed specifically for intraday traders.
It visually highlights key retracement or reaction areas where the market often pauses or reverses.
🔍 How it works
At the start of each day, the script automatically captures:
the previous day’s open (pdo),
high (pdh),
low (pdl),
and close (pdc).
It then determines if the previous day was bullish (Close > Open) or bearish (Close < Open).
Based on that:
If the previous day was bullish, it projects the Fibonacci levels down from the high (typical for expecting retracements).
If bearish, it projects them up from the low.
The two key levels are:
0.5 (50%) retracement / projection
0.618 (61.8%) retracement / projection
A colored zone is plotted between these levels to act as a leading guide for intraday setups.
⏰ Time filtering & session customization
A unique feature is the dynamic session filtering:
By default, the zone is only plotted during active market hours, keeping your chart clean outside trading hours.
The script provides a dropdown selector so you can quickly switch between:
India session (9:15 to 15:30)
Europe session (9:00 to 17:30)
US session (9:30 to 16:00)
Or even define your own custom session times.
This makes it ideal for intraday traders in any region.
🎨 Visual features
The fill zone changes color based on the previous day’s sentiment:
Green zone if the previous day was bullish
Red zone if the previous day was bearish
🚨 Alerts
The script includes an alert condition, so you can easily set up TradingView alerts to notify you when:
Price enters the Fibonacci zone.
This is extremely helpful for catching retracements or reversals without staring at the screen all day.
⚙️ How to use
✅ Works on any intraday timeframe (1 min, 5 min, 15 min, etc.).
✅ Simply add it to your chart, pick your session in the dropdown, and watch the Fibonacci zone automatically adjust to your selected market hours.
Use it as a confluence tool alongside other indicators like VWAP, EMAs, Bollinger Bands, or price action patterns to time entries and exits.
💪 Why this is powerful
This is more than a simple Fib retracement tool:
It dynamically adapts to the previous day’s sentiment, helping you trade in alignment with recent market psychology.
The session filtering ensures your charts are focused only on the periods
DAX Setup ScreenerPine Script – Setup Screener
This code detects:
Range trading zone
Breakout long & breakdown short signals
With visual overlay
Use it like this:
Adjust rangeHigh, rangeLow, and breakoutBuffer
Enabled: Draws signals on the live chart
Dynamic Gap Probability ToolDynamic Gap Probability Tool measures the percentage gap between price and a chosen moving average, then analyzes your chart history to estimate the likelihood of the next candle moving up or down. It dynamically adjusts its sample size to ensure statistical robustness while focusing on the exact deviation level.
Originality and Value:
• Combines gap-based analysis with dynamic sample aggregation to balance precision and reliability.
• Automatically extends the sample when exact matches are scarce, avoiding misleading signals on rare extreme moves.
• Provides real “next-candle” probabilities based on historical occurrences rather than fixed thresholds or untested heuristics.
• Adds value by giving traders an evidence-based edge: you see how similar past deviations actually played out.
How It Works:
1. Calculate gap = (close – moving average) / moving average * 100.
2. Round the absolute gap to nearest percent (X%).
3. Count historical bars where gap ≥ X% above or ≤ –X% below.
4. If exact X% count is below the minimum occurrences threshold, include gaps at X+1%, X+2%, etc., until threshold is reached.
5. Compute “next-candle” green vs. red probabilities from the aggregated sample.
6. Display current gap, sample size, green probability, and red probability in a table.
Inputs:
• Moving Average Type (SMA, EMA, WMA, VWMA, HMA, SMMA, TMA)
• Moving Average Period (default 200)
• Minimum Occurrences Threshold (default 50)
• Table position and styling options
Examples:
• If price is 3% above the 200-period SMA and 120 occurrences ≥3% are found, with 84 green next candles (70%) and 36 red (30%), the script displays “3% | 120 | 70% green | 30% red.”
• If price is 8% below the SMA but only 20 exact matches exist, the script will include 9% and 10% gaps until it reaches 50 samples, then calculate probabilities from that broader set.
Why It’s Useful:
• Mean-reversion traders see green-probability signals at extreme overbought or oversold levels.
• Trend-followers identify continuation likelihood when red probability is high.
• Risk managers gauge reliability by inspecting sample size before acting on any signal.
Limitations:
• Historical probabilities do not guarantee future performance.
• Results depend on timeframe and symbol, backtest with your data before trading.
• Use realistic slippage and commission when overlaying on strategy scripts.