ENTRY CONFIRMATION V2An indicator from candle man. Helps determine whether supply and demand zone are truly supply or demand.
在脚本中搜索"entry"
Entry Percent: EssamThis Pine Script code is designed to perform the task of computing and showcasing the profit percentage, profit value, and the duration for which a specific asset is held, all in real-time. The script effectively leverages the built-in resources to provide a seamless and robust experience, as it presents the calculated figures in an easily readable format on the chart, without causing any lag or disruptions to the chart.
MA_Script- Entry Point : base on MA20, MA50, MA100, MA200.
- Exit Point : base on stop loss, MA and trailing stop.
sa-strategy with HTF-TSLEntry- based on HA close above HMA confirmation done with ST and HTF ATR
Exit- based on close below ATR which works as trailing SL
[MV] %B with SMA + Volume Based Colored Bars
Entry Signal when %B Crosses with SMA and this is more meaningful if it supports colored bars.
Black Bar when prices go down and volume is bigger than 150% of its average, that indicates us price action is supported by a strong bearish volume
Blue Bar when prices go up and volume bigger than 150% of its average, that indicates us price action is supported by a strong bullish volume
VBC author @KIVANCfr3762
FX Sniper: T3-CCI Strategy - With 100 IndicatorsEntry signal when moving above -100, sell signal when going below 100
Amazing Crossover SystemEntry Rules
BUY when the 5 EMA crosses above the 10 EMA from underneath and the RSI crosses above the 50.0 mark from the bottom.
SELL when the 5 EMA crosses below the 10 EMA from the top and the RSI crosses below the 50.0 mark from the top.
Make sure that the RSI did cross 50.0 from the top or bottom and not just ranging tightly around the level.
How to setup Alert:
1) Add the Amazing Crossover System to your chart via Indicators
2) Find your currency pair
3) Set the timeframe on the chart to 1 hour
4) Press 'Alt + A' (create alert shortcut)
5) Set the following criteria for the alert:
Condition = 'Amazing Crossover System', Plot, ' BUY Signal'
The rest of the alert can be customized to your preferences
5) Repeat steps 1 - 4, but set the Condition = 'Amazing Crossover System', Plot, ' SELL Signal'
NexusNexus is a swing trading indicator designed specifically for the 4-Hour and Daily timeframes.
Unlike standard indicators that react to every minor candle flicker, Nexus uses a "Macro" approach to filter out market noise and identify significant structural pivots.
It combines three distinct mathematical engines into one consensus signal:
The Anchor (Trend): A Rational Quadratic Kernel (Length 50) + Gann High/Low Activator (Length 20). This defines the heavy, long-term flow of the market.
The Guard (Risk): A modified UT Bot (ATR Trailing Stop). This manages volatility and provides your Stop Loss levels.
The Map (Structure): Smart Money Concepts (SMC) engine that detects Major Pivots, Fair Value Gaps (FVG), Break of Structure (BOS), and Change of Character (CHoCH).
Visual Legend
Dark Green/Red Line (The Baseline): This is the Kernel Regression line. It represents the "floor" or "ceiling" of the macro trend. If price is above this, the bias is Long. If below, the bias is Short.
Neon Green/Red Line (The Risk Line): This is your Trailing Stop. It moves tighter to price as the trend matures.
Large Triangles (or Custom Shape): These are your Entry Signals. They only appear when the Trend, Risk, and Momentum engines all align perfectly.
Small Circles (BOS): "Break of Structure." These appear when price breaks a high in an uptrend (or low in a downtrend). It means the trend is healthy and continuing.
Small Diamonds (CHoCH): "Change of Character." These appear when price breaks a significant structural level against the current trend. This is an early warning sign that a reversal might be coming.
Colored Boxes (FVG): Fair Value Gaps. These are magnetic zones where price often returns to "rebalance" before continuing.
How to Trade with Nexus
Recommended Timeframes: 4 Hour (4H) or Daily (1D).
1. The Entry
Wait for a Neon Buy/Sell Signal (Default: Triangle).
Check the Dashboard: Ensure the "ACTION" cell is colored (Green for Buy, Red for Sell) and matches your signal.
Strict Alternation: The script prevents "signal spam." Once a Buy signal fires, you will not see another Buy signal until the trend flips and produces a Sell signal.
2. Stop Loss Placement
Initial Stop: Place your Stop Loss slightly beyond the Neon Risk Line at the time of entry.
Trailing: As the trade progresses, move your Stop Loss along the Neon Line. If the candle closes on the wrong side of this line, the trade is invalid.
3. Take Profit & Exits
Target 1: The next opposing FVG Box (Support/Resistance magnet).
Target 2: A CHoCH Diamond appearing against your trade. This indicates the market structure has shifted, and you should consider locking in profits.
4. Filtering Chop
If the Baseline is flat and price is weaving through it, stay out.
The "Rec. TF" on the dashboard reminds you to stick to higher timeframes where these signals are most accurate.
Disclaimer
Trading financial assets involves a high level of risk and may not be suitable for all investors. The content provided here and the "Nexus" indicator are for educational and informational purposes only and do not constitute financial, investment, or trading advice. Past performance is not indicative of future results. You are solely responsible for your own trading decisions and should always practice risk management.
Psychological LevelsADVANCED PSYCHOLOGICAL LEVELS - PROFESSIONAL FOREX INDICATOR
This highly customizable indicator automatically identifies and visualizes all major psychological price levels across any Forex chart. Psychological levels represent critical price zones where traders naturally congregate their orders due to human psychology's attraction to round numbers. These levels consistently act as powerful support and resistance zones in the market.
🎯 KEY FEATURES:
✅ Four Distinct Level Types - Choose from 1000-pip, 100-pip, 50-pip, 25-pip, and 10-pip psychological levels
✅ Individual Color Customization - Each level type has its own customizable zone and line colors
✅ Separate Zone Width Control - Adjust zone width independently for each level type
✅ Universal Forex Compatibility - Automatically adapts to JPY pairs and all other currency pairs
✅ Extended Coverage - Displays levels far beyond the visible chart area for comprehensive analysis
✅ Fixed Positioning - Levels remain stationary when scrolling or zooming
✅ Fully Customizable Styling - Choose between solid, dashed, or dotted line styles
📊 LEVEL TYPES EXPLAINED:
🟣 1000-pip Levels (e.g., EUR/USD: 1.0000, 2.0000 | USD/JPY: 100.00, 110.00, 120.00)
The strongest macro-level psychological barriers in the Forex market
Represent massive institutional, long-term price zones
Extremely important for position traders, swing traders, and macro analysis
Used by hedge funds, banks, and large liquidity providers for major order placement
Ideal for identifying long-term support/resistance, trend reversals, and market structure shifts
Default color: Purple (highest, macro-level importance)
🔴 100-pip Levels (e.g., EUR/USD: 1.1000, 1.1100, 1.1200 | USD/JPY: 150.00, 151.00, 152.00)
The most significant psychological barriers in Forex trading
Major round numbers where institutional traders place large orders
Strongest support and resistance zones with highest reaction probability
Essential for swing trading and position trading strategies
Default color: Red (highest importance)
🟠 50-pip Levels (e.g., EUR/USD: 1.1050, 1.1150, 1.1250 | USD/JPY: 150.50, 151.50, 152.50)
Secondary psychological levels positioned midway between 100-pip levels
Important intermediate zones for profit-taking and order clustering
Highly effective for day trading strategies
Reliable targets for partial profit exits
Default color: Orange (medium-high importance)
🔵 25-pip Levels (e.g., EUR/USD: 1.1025, 1.1075, 1.1125 | USD/JPY: 150.25, 150.75, 151.25)
Quartile levels providing granular market structure
Perfect for scalping and short-term trading approaches
Excellent confluence zones with technical indicators
Ideal for tight stop-loss placement
Default color: Blue (medium importance)
🟢 10-pip Levels (e.g., EUR/USD: 1.1010, 1.1020, 1.1030 | USD/JPY: 150.10, 150.20, 150.30)
Most detailed psychological levels for precision trading
Optimal for micro scalping and high-frequency strategies
Provides fine-grained market structure analysis
Useful for optimizing entry and exit timing
Default color: Green (detailed analysis)
⚙️ CUSTOMIZATION OPTIONS:
Color Settings (Individual for Each Level):
Zone Color - Customize fill color with adjustable transparency
Line Color - Set center line color independently
Default color scheme uses traffic light logic (Purple → Red → Orange → Blue → Green)
Zone Width Settings (Separate for Each Level):
1000-pip Levels: Default 15 pips (widest zones for long-term significance)
100-pip Levels: Default 8 pips (wider zones for major levels)
50-pip Levels: Default 5 pips (medium zones)
25-pip Levels: Default 3 pips (smaller zones)
10-pip Levels: Default 2 pips (narrowest zones for precision)
Display Settings:
Line Style: Choose between Solid, Dashed, or Dotted
Line Thickness: Adjustable from 1 to 5 pixels
Level Selection: Toggle each level type on/off independently
💡 TRADING APPLICATIONS:
📈 Support & Resistance Identification
Instantly recognize where price is likely to react
Identify key reversal zones before they occur
Combine with price action for high-probability setups
🎯 Optimal Entry & Exit Points
Enter trades at psychological support/resistance
Set realistic profit targets at the next psychological level
Improve win rate by trading with market psychology
🛡️ Strategic Stop-Loss Placement
Position stops just beyond psychological levels to avoid stop hunts
Reduce premature stop-outs by understanding where others place stops
Protect profits by moving stops to psychological levels
💰 Profit Target Optimization
Set take-profit orders at psychological levels where profit-taking occurs
Scale out positions at multiple psychological levels
Maximize gains by understanding where demand/supply shifts
📊 Breakout Trading
Identify when price decisively breaks through major psychological barriers
Trade momentum when psychological levels are breached
Confirm breakouts using multiple level types as confluence
⚖️ Risk Management Enhancement
Calculate better risk-reward ratios using psychological levels
Size positions based on distance to next psychological level
Improve overall trading consistency
🔬 WHY PSYCHOLOGICAL LEVELS WORK:
Psychological levels are self-fulfilling prophecies in financial markets. Because thousands of traders worldwide monitor the same round numbers, these levels naturally attract significant order flow:
Order Clustering: Pending buy/sell orders accumulate at round numbers
Profit Taking: Traders instinctively close positions at psychological levels
Stop Hunts: Market makers often push price to psychological levels to trigger stops
Institutional Activity: Banks and funds use round numbers for large order placement
Pattern Recognition: Human brains naturally gravitate toward simple, round numbers
📋 TECHNICAL SPECIFICATIONS:
✓ Pine Script Version 6 (latest)
✓ Compatible with all Forex pairs (majors, minors, exotics)
✓ Works on all timeframes (M1 to Monthly)
✓ Automatic JPY pair detection and adjustment
✓ Maximum 500 lines and 500 boxes for optimal performance
✓ Levels extend infinitely across the chart
✓ No repainting - levels are fixed once drawn
✓ Efficient calculation prevents performance issues
✓ Clean visualization without chart clutter
👥 IDEAL FOR:
Day Traders: Use 100-pip and 50-pip levels for intraday setups
Swing Traders: Focus on major 100-pip levels for multi-day positions
Scalpers: Enable 25-pip and 10-pip levels for precision entries
Position Traders: Use 100-pip levels for long-term support/resistance analysis
Beginner Traders: Learn to recognize important market structure easily
Algorithm Developers: Incorporate psychological levels into automated strategies
🚀 HOW TO USE:
Add the indicator to any Forex chart
Select which level types you want to display (100, 50, 25, 10)
Customize colors to match your chart theme
Adjust zone widths based on your trading style and timeframe
Choose line style (solid, dashed, or dotted)
Watch for price reactions at the highlighted psychological zones
Use the levels to plan entries, exits, and stop-loss placement
💎 BEST PRACTICES:
✓ Combine with candlestick patterns for confirmation signals
✓ Wait for price action confirmation before entering trades
✓ Use multiple timeframes to identify the most significant levels
✓ Disable 10-pip levels on higher timeframes to reduce visual noise
✓ Enable only 100-pip levels for clean, uncluttered analysis on Daily/Weekly charts
✓ Adjust zone widths based on pair volatility (wider for volatile pairs)
✓ Use color coding to instantly recognize level importance
⚡ PERFORMANCE OPTIMIZED:
This indicator is engineered for maximum efficiency:
Smart calculation only within visible price range
Duplicate prevention system avoids overlapping levels
Optimized loops with early break conditions
Extended coverage (500 bars) without performance degradation
Handles thousands of levels across all timeframes smoothly
🎨 VISUAL DESIGN:
The default color scheme follows intuitive importance levels:
Purple (1000-pip): Macro-level, highest significance
Red (100-pip): Highest importance - major barriers
Orange (50-pip): Medium-high importance - secondary levels
Blue (25-pip): Medium importance - tertiary levels
Green (10-pip): Detailed analysis - precision levels
This traffic-light inspired system allows instant visual recognition of level significance.
📚 EDUCATIONAL VALUE:
Beyond being a trading tool, this indicator serves as an excellent educational resource for understanding market psychology and how professional traders think. It visually demonstrates where the "crowd" is likely to place orders, helping you develop better market intuition.
🔄 CONTINUOUS UPDATES:
This indicator displays levels dynamically based on the current price range, ensuring you always see relevant psychological levels no matter where price moves on the chart.
✨ WHAT MAKES THIS INDICATOR UNIQUE:
Unlike simple horizontal line indicators, this advanced tool offers:
Individual customization for each level type (colors, widths)
Automatic currency pair detection and adjustment
Visual zones (not just lines) for better support/resistance visualization
Extended coverage ensuring levels are always visible
Professional color-coding system for instant level importance recognition
Performance-optimized for handling hundreds of levels simultaneously
⭐ PERFECT FOR ALL TRADING STYLES:
Whether you're a conservative position trader looking at weekly charts or an aggressive scalper on 1-minute timeframes, this indicator adapts to your needs. Simply enable the appropriate level types and adjust the visualization to match your strategy.
Transform your Forex trading with professional-grade psychological level analysis. Add this indicator to your chart today and start trading with the market psychology on your side!
Titan AI: EWO Pro + Divergencias de VolumenBINANCE:BTCUSDT.P The indicator is only in Spanish.
Titan AI: EWO Pro is not your standard Elliott Wave Oscillator. It is a next-generation Order Flow & Volume engine designed to detect the true intent of the market. Unlike traditional oscillators that rely solely on price action, Titan EWO Pro incorporates a "Volume Efficiency" algorithm normalized via Z-Score (Standard Deviation).
This indicator is built for traders who need to see what is happening inside the candles. It answers the critical question: "Is the price moving with real institutional backing, or is it a fake-out with no volume?"
With the integrated "GOD MODE" Dashboard, you get a tactical Heads-Up Display (HUD) that translates complex mathematical data into clear, actionable signals in real-time.
💎 Key Features
Z-Score Normalized EWO:
Standard EWO indicators can vary wildly depending on the asset price (BTC vs. Forex).
Titan EWO Pro normalizes the data using Standard Deviations (Z-Score). This means a value of +2.0 represents a statistically significant extreme move, regardless of the timeframe or asset.
Volume Efficiency Algorithm:
The core calculation measures (Close - Open) / Volume. This determines how much volume was required to move the price.
High efficiency means price is moving easily (strong trend). Low efficiency means high volume but little movement (absorption/reversal).
Volume Divergences:
Automatically detects discrepancies between Price Action and Order Flow.
Bullish Divergence: Price makes a Lower Low, but Titan EWO makes a Higher Low (Accumulation).
Bearish Divergence: Price makes a Higher High, but Titan EWO makes a Lower High (Distribution).
Institutional Extremes (Reversals):
The indicator marks the +2.0 and -2.0 Standard Deviation levels.
When the histogram crosses these levels, the market is statistically overextended. Watch for Triangle Signals indicating a potential "V" reversal or exhaustion.
GOD MODE Dashboard (HUD):
A professional panel fixed to your screen (customizable position).
Trend: Displays strict Bullish (Green) or Bearish (Red) status.
Strength (Z): The exact Z-Score value.
Momentum: Tells you if the move is "Accelerating" or "Braking" (Decelerating).
Divergence: Real-time alert status.
🚀 How to Use
1. Trend Following (The Wave)
Green Bars: Look for Longs. Momentum is bullish and Order Flow supports the move.
Red Bars: Look for Shorts. Momentum is bearish.
Darker Colors: If the bars turn dark green or dark red, momentum is slowing down (Deceleration). This is a warning to tighten Stop Losses or wait for a new impulse.
2. Trading Reversals (The Extremes)
Statistical Extremes: If the histogram punches through the +2.0 or -2.0 dotted lines, the move is overextended (climax).
Triangles: Small triangles appear at the top/bottom of the chart when these extremes are hit. This is often a "Take Profit" signal or a contrarian entry point if confirmed by price action.
3. Divergences (The Smart Entry)
Look for the "Vol" circles.
A Green Circle at the bottom indicates that sellers are exhausted, but volume flow is shifting bullish.
A Red Circle at the top indicates that buyers are exhausted (price up, but volume flow down).
4. The Dashboard
Use the dashboard for confirmation.
Ideally: You want "ALCISTA" (Bullish), "ACELERANDO" (Accelerating), and a high Z-Score (> 0.5) for a strong Long trade.
⚙️ Settings
EWO Length: The lookback period for the oscillator (Default: 12).
Smoothing: Helps reduce noise in the histogram (Default: 10).
Pivot Lookback: Sensitivity for divergence detection (Default: 5).
Dashboard: You can toggle the panel ON/OFF, change its size (Tiny/Small/Normal), and move it to any corner of the chart.
Disclaimer
This tool is for educational and analytical purposes only. Trading involves risk. Always use proper risk management. Past performance does not guarantee future results.
Psychological levelsADVANCED PSYCHOLOGICAL LEVELS - PROFESSIONAL FOREX INDICATOR
This highly customizable indicator automatically identifies and visualizes all major psychological price levels across any Forex chart. Psychological levels represent critical price zones where traders naturally congregate their orders due to human psychology's attraction to round numbers. These levels consistently act as powerful support and resistance zones in the market.
🎯 KEY FEATURES:
✅ Four Distinct Level Types - Choose from 100-pip, 50-pip, 25-pip, and 10-pip psychological levels
✅ Individual Color Customization - Each level type has its own customizable zone and line colors
✅ Separate Zone Width Control - Adjust zone width independently for each level type
✅ Universal Forex Compatibility - Automatically adapts to JPY pairs and all other currency pairs
✅ Extended Coverage - Displays levels far beyond the visible chart area for comprehensive analysis
✅ Fixed Positioning - Levels remain stationary when scrolling or zooming
✅ Fully Customizable Styling - Choose between solid, dashed, or dotted line styles
📊 LEVEL TYPES EXPLAINED:
🔴 100-pip Levels (e.g., EUR/USD: 1.1000, 1.1100, 1.1200 | USD/JPY: 150.00, 151.00, 152.00)
The most significant psychological barriers in Forex trading
Major round numbers where institutional traders place large orders
Strongest support and resistance zones with highest reaction probability
Essential for swing trading and position trading strategies
Default color: Red (highest importance)
🟠 50-pip Levels (e.g., EUR/USD: 1.1050, 1.1150, 1.1250 | USD/JPY: 150.50, 151.50, 152.50)
Secondary psychological levels positioned midway between 100-pip levels
Important intermediate zones for profit-taking and order clustering
Highly effective for day trading strategies
Reliable targets for partial profit exits
Default color: Orange (medium-high importance)
🔵 25-pip Levels (e.g., EUR/USD: 1.1025, 1.1075, 1.1125 | USD/JPY: 150.25, 150.75, 151.25)
Quartile levels providing granular market structure
Perfect for scalping and short-term trading approaches
Excellent confluence zones with technical indicators
Ideal for tight stop-loss placement
Default color: Blue (medium importance)
🟢 10-pip Levels (e.g., EUR/USD: 1.1010, 1.1020, 1.1030 | USD/JPY: 150.10, 150.20, 150.30)
Most detailed psychological levels for precision trading
Optimal for micro scalping and high-frequency strategies
Provides fine-grained market structure analysis
Useful for optimizing entry and exit timing
Default color: Green (detailed analysis)
⚙️ CUSTOMIZATION OPTIONS:
Color Settings (Individual for Each Level):
Zone Color - Customize fill color with adjustable transparency
Line Color - Set center line color independently
Default color scheme uses traffic light logic (Red → Orange → Blue → Green)
Zone Width Settings (Separate for Each Level):
100-pip Levels: Default 10 pips (wider zones for major levels)
50-pip Levels: Default 7 pips (medium zones)
25-pip Levels: Default 5 pips (smaller zones)
10-pip Levels: Default 3 pips (narrowest zones for precision)
Display Settings:
Line Style: Choose between Solid, Dashed, or Dotted
Line Thickness: Adjustable from 1 to 5 pixels
Level Selection: Toggle each level type on/off independently
💡 TRADING APPLICATIONS:
📈 Support & Resistance Identification
Instantly recognize where price is likely to react
Identify key reversal zones before they occur
Combine with price action for high-probability setups
🎯 Optimal Entry & Exit Points
Enter trades at psychological support/resistance
Set realistic profit targets at the next psychological level
Improve win rate by trading with market psychology
🛡️ Strategic Stop-Loss Placement
Position stops just beyond psychological levels to avoid stop hunts
Reduce premature stop-outs by understanding where others place stops
Protect profits by moving stops to psychological levels
💰 Profit Target Optimization
Set take-profit orders at psychological levels where profit-taking occurs
Scale out positions at multiple psychological levels
Maximize gains by understanding where demand/supply shifts
📊 Breakout Trading
Identify when price decisively breaks through major psychological barriers
Trade momentum when psychological levels are breached
Confirm breakouts using multiple level types as confluence
⚖️ Risk Management Enhancement
Calculate better risk-reward ratios using psychological levels
Size positions based on distance to next psychological level
Improve overall trading consistency
🔬 WHY PSYCHOLOGICAL LEVELS WORK:
Psychological levels are self-fulfilling prophecies in financial markets. Because thousands of traders worldwide monitor the same round numbers, these levels naturally attract significant order flow:
Order Clustering: Pending buy/sell orders accumulate at round numbers
Profit Taking: Traders instinctively close positions at psychological levels
Stop Hunts: Market makers often push price to psychological levels to trigger stops
Institutional Activity: Banks and funds use round numbers for large order placement
Pattern Recognition: Human brains naturally gravitate toward simple, round numbers
📋 TECHNICAL SPECIFICATIONS:
✓ Pine Script Version 6 (latest)
✓ Compatible with all Forex pairs (majors, minors, exotics)
✓ Works on all timeframes (M1 to Monthly)
✓ Automatic JPY pair detection and adjustment
✓ Maximum 500 lines and 500 boxes for optimal performance
✓ Levels extend infinitely across the chart
✓ No repainting - levels are fixed once drawn
✓ Efficient calculation prevents performance issues
✓ Clean visualization without chart clutter
👥 IDEAL FOR:
Day Traders: Use 100-pip and 50-pip levels for intraday setups
Swing Traders: Focus on major 100-pip levels for multi-day positions
Scalpers: Enable 25-pip and 10-pip levels for precision entries
Position Traders: Use 100-pip levels for long-term support/resistance analysis
Beginner Traders: Learn to recognize important market structure easily
Algorithm Developers: Incorporate psychological levels into automated strategies
🚀 HOW TO USE:
Add the indicator to any Forex chart
Select which level types you want to display (100, 50, 25, 10)
Customize colors to match your chart theme
Adjust zone widths based on your trading style and timeframe
Choose line style (solid, dashed, or dotted)
Watch for price reactions at the highlighted psychological zones
Use the levels to plan entries, exits, and stop-loss placement
💎 BEST PRACTICES:
✓ Combine with candlestick patterns for confirmation signals
✓ Wait for price action confirmation before entering trades
✓ Use multiple timeframes to identify the most significant levels
✓ Disable 10-pip levels on higher timeframes to reduce visual noise
✓ Enable only 100-pip levels for clean, uncluttered analysis on Daily/Weekly charts
✓ Adjust zone widths based on pair volatility (wider for volatile pairs)
✓ Use color coding to instantly recognize level importance
⚡ PERFORMANCE OPTIMIZED:
This indicator is engineered for maximum efficiency:
Smart calculation only within visible price range
Duplicate prevention system avoids overlapping levels
Optimized loops with early break conditions
Extended coverage (500 bars) without performance degradation
Handles thousands of levels across all timeframes smoothly
🎨 VISUAL DESIGN:
The default color scheme follows intuitive importance levels:
Red (100-pip): Highest importance - major barriers
Orange (50-pip): Medium-high importance - secondary levels
Blue (25-pip): Medium importance - tertiary levels
Green (10-pip): Detailed analysis - precision levels
This traffic-light inspired system allows instant visual recognition of level significance.
📚 EDUCATIONAL VALUE:
Beyond being a trading tool, this indicator serves as an excellent educational resource for understanding market psychology and how professional traders think. It visually demonstrates where the "crowd" is likely to place orders, helping you develop better market intuition.
🔄 CONTINUOUS UPDATES:
This indicator displays levels dynamically based on the current price range, ensuring you always see relevant psychological levels no matter where price moves on the chart.
✨ WHAT MAKES THIS INDICATOR UNIQUE:
Unlike simple horizontal line indicators, this advanced tool offers:
Individual customization for each level type (colors, widths)
Automatic currency pair detection and adjustment
Visual zones (not just lines) for better support/resistance visualization
Extended coverage ensuring levels are always visible
Professional color-coding system for instant level importance recognition
Performance-optimized for handling hundreds of levels simultaneously
⭐ PERFECT FOR ALL TRADING STYLES:
Whether you're a conservative position trader looking at weekly charts or an aggressive scalper on 1-minute timeframes, this indicator adapts to your needs. Simply enable the appropriate level types and adjust the visualization to match your strategy.
Fixed Dollar Risk Lines V2*This is a small update to the original concept that adds greater customization of the visual elements of the script. Since some folks have liked the original I figured I'd put this out there.*
Fixed Dollar Risk Lines is a utility indicator that converts a user-defined dollar risk into price distance and plots risk lines above and below the current price for popular futures contracts. It helps you place stops or entries at a consistent dollar risk per trade, regardless of the market’s tick value or tick size.
What it does:
-You choose a dollar amount to risk (e.g., $100) and a futures contract (ES, NQ, GC, YM, RTY, PL, SI, CL, BTC).
The script automatically:
-Looks up the contract’s tick value and tick size
-Converts your dollar risk into number of ticks
-Converts ticks into price distance
Plots:
-Long Risk line below current price
-Short Risk line above current price
-Optional labels show exact price levels and an information table summarizes your settings.
Key features
-Consistent dollar risk across instruments
-Supports major futures contracts with built‑in tick values and sizes
-Toggle Long and Short risk lines independently
-Customizable line width and colors (lines and labels)
-Right‑axis price level display for quick reading
-Compact info table with contract, risk, and computed prices
Typical use
-Long setups: use the green line as a stop level below entry to match your chosen dollar risk.
-Short setups: use the red line as a stop level above entry to match your chosen dollar risk.
-Quickly compare how the same dollar risk translates to distance on different contracts.
Inputs
-Risk Amount (USD)
-Futures Contract (ES, NQ, GC, YM, RTY, PL, SI, CL, BTC)
-Show Long/Short lines (toggles)
-Line Width
-Colors for lines and labels
Notes
-Designed for futures symbols that match the listed contracts’ tick specs. If your symbol has different tick value/size than the defaults, results will differ.
-Intended for educational/informational use; not financial advice.
-This tool streamlines risk placement so you can focus on execution while keeping dollar risk consistent across markets.
Trend Flip Exhaustion SignalsThis Pine Script is designed to generate buy and short trading signals based on a combination of technical indicators. It calculates fast and slow EMAs, RSI, a linear regression channel, and a simplified TTM squeeze histogram to measure momentum.
- Short signals trigger when price is above both EMAs, near the upper regression channel, momentum is weakening, volume is fading, and RSI is overbought.
- Buy signals trigger when price is below both EMAs, near the lower regression channel, momentum is strengthening, volume is surging, and RSI is oversold.
- Signals are displayed as labels anchored to price bars (with optional plotshape arrows for backup).
- The script also plots the EMAs and regression channel for visual context.
In short - it’s a trend‑following entry tool that highlights potential exhaustion points for shorts and potential reversals for buys, with clear on‑chart markers to guide decision‑making.
Third eye • StrategyThird eye • Strategy – User Guide
1. Idea & Concept
Third eye • Strategy combines three things into one system:
Ichimoku Cloud – to define market regime and support/resistance.
Moving Average (trend filter) – to trade only in the dominant direction.
CCI (Commodity Channel Index) – to generate precise entry signals on momentum breakouts.
The script is a strategy, not an indicator: it can backtest entries, exits, SL, TP and BreakEven logic automatically.
2. Indicators Used
2.1 Ichimoku
Standard Ichimoku settings (by default 9/26/52/26) are used:
Conversion Line (Tenkan-sen)
Base Line (Kijun-sen)
Leading Span A & B (Kumo Cloud)
Lagging Span is calculated but hidden from the chart (for visual simplicity).
From the cloud we derive:
kumoTop – top of the cloud under current price.
kumoBottom – bottom of the cloud under current price.
Flags:
is_above_kumo – price above the cloud.
is_below_kumo – price below the cloud.
is_in_kumo – price inside the cloud.
These conditions are used as trend / regime filters and for stop-loss & trailing stops.
2.2 Moving Average
You can optionally display and use a trend MA:
Types: SMA, EMA, DEMA, WMA
Length: configurable (default 200)
Source: default close
Filter idea:
If MA Direction Filter is ON:
When Close > MA → strategy allows only Long signals.
When Close < MA → strategy allows only Short signals.
The MA is plotted on the chart (if enabled).
2.3 CCI & Panel
The CCI (Commodity Channel Index) is used for entry timing:
CCI length and source are configurable (default length 20, source hlc3).
Two thresholds:
CCI Upper Threshold (Long) – default +100
CCI Lower Threshold (Short) – default –100
Signals:
Long signal:
CCI crosses up through the upper threshold
cci_val < upper_threshold and cci_val > upper_threshold
Short signal:
CCI crosses down through the lower threshold
cci_val > lower_threshold and cci_val < lower_threshold
There is a panel (table) in the bottom-right corner:
Shows current CCI value.
Shows filter status as colored dots:
Green = filter enabled and passed.
Red = filter enabled and blocking trades.
Gray = filter is disabled.
Filters shown in the panel:
Ichimoku Cloud filter (Long/Short)
Ichimoku Lines filter (Conversion/Base vs Cloud)
MA Direction filter
3. Filters & Trade Direction
All filters can be turned ON/OFF independently.
3.1 Ichimoku Cloud Filter
Purpose: trade only when price is clearly above or below the Kumo.
Long Cloud Filter (Use Ichimoku Cloud Filter) – when enabled:
Long trades only if close > cloud top.
Short Cloud Filter – when enabled:
Short trades only if close < cloud bottom.
If the cloud filter is disabled, this condition is ignored.
3.2 Ichimoku Lines Above/Below Cloud
Purpose: stronger trend confirmation: Ichimoku lines should also be on the “correct” side of the cloud.
Long Lines Filter:
Long allowed only if Conversion Line and Base Line are both above the cloud.
Short Lines Filter:
Short allowed only if both lines are below the cloud.
If this filter is OFF, the conditions are not checked.
3.3 MA Direction Filter
As described above:
When ON:
Close > MA → only Longs.
Close < MA → only Shorts.
4. Anti-Re-Entry Logic (Cloud Touch Reset)
The strategy uses internal flags to avoid continuous re-entries in the same direction without a reset.
Two flags:
allowLong
allowShort
After a Long entry, allowLong is set to false, allowShort to true.
After a Short entry, allowShort is set to false, allowLong to true.
Flags are reset when price touches the Kumo:
If Low goes into the cloud → allowLong = true
If High goes into the cloud → allowShort = true
If Close is inside the cloud → both allowLong and allowShort are set to true
There is a key option:
Wait Position Close Before Flag Reset
If ON: cloud touch will reset flags only when there is no open position.
If OFF: flags can be reset even while a trade is open.
This gives a kind of regime-based re-entry control: after a trend leg, you wait for a “cloud interaction” to allow new signals.
5. Risk Management
All risk management is handled inside the strategy.
5.1 Position Sizing
Order Size % of Equity – default 10%
The strategy calculates:
position_value = equity * (Order Size % / 100)
position_qty = position_value / close
So position size automatically adapts to your current equity.
5.2 Take Profit Modes
You can choose one of two TP modes:
Percent
Fibonacci
5.2.1 Percent Mode
Single Take Profit at X% from entry (default 2%).
For Long:
TP = entry_price * (1 + tp_pct / 100)
For Short:
TP = entry_price * (1 - tp_pct / 100)
One strategy.exit per side is used: "Long TP/SL" and "Short TP/SL".
5.2.2 Fibonacci Mode (2 partial TPs)
In this mode, TP levels are based on a virtual Fib-style extension between entry and stop-loss.
Inputs:
Fib TP1 Level (default 1.618)
Fib TP2 Level (default 2.5)
TP1 Share % (Fib) (default 50%)
TP2 share is automatically 100% - TP1 share.
Process for Long:
Compute a reference Stop (see SL section below) → sl_for_fib.
Compute distance: dist = entry_price - sl_for_fib.
TP levels:
TP1 = entry_price + dist * (Fib TP1 Level - 1)
TP2 = entry_price + dist * (Fib TP2 Level - 1)
For Short, the logic is mirrored.
Two exits are used:
TP1 – closes TP1 share % of position.
TP2 – closes remaining TP2 share %.
Same stop is used for both partial exits.
5.3 Stop-Loss Modes
You can choose one of three Stop Loss modes:
Stable – fixed % from entry.
Ichimoku – fixed level derived from the Kumo.
Ichimoku Trailing – dynamic SL following the cloud.
5.3.1 Stable SL
For Long:
SL = entry_price * (1 - Stable SL % / 100)
For Short:
SL = entry_price * (1 + Stable SL % / 100)
Used both for Percent TP mode and as reference for Fib TP if Kumo is not available.
5.3.2 Ichimoku SL (fixed, non-trailing)
At the time of a new trade:
For Long:
Base SL = cloud bottom minus small offset (%)
For Short:
Base SL = cloud top plus small offset (%)
The offset is configurable: Ichimoku SL Offset %.
Once computed, that SL level is fixed for this trade.
5.3.3 Ichimoku Trailing SL
Similar to Ichimoku SL, but recomputed each bar:
For Long:
SL = cloud bottom – offset
For Short:
SL = cloud top + offset
A red trailing SL line is drawn on the chart to visualize current stop level.
This trailing SL is also used as reference for BreakEven and for Fib TP distance.
6. BreakEven Logic (with BE Lines)
BreakEven is optional and supports two modes:
Percent
Fibonacci
Inputs:
Percent mode:
BE Trigger % (from entry) – move SL to BE when price goes this % in profit.
BE Offset % from entry – SL will be set to entry ± this offset.
Fibonacci mode:
BE Fib Level – Fib level at which BE will be activated (default 1.618, same style as TP).
BE Offset % from entry – how far from entry to place BE stop.
The logic:
Before BE is triggered, SL follows its normal mode (Stable/Ichimoku/Ichimoku Trailing).
When BE triggers:
For Long:
New SL = max(current SL, BE SL).
For Short:
New SL = min(current SL, BE SL).
This means BE will never loosen the stop – only tighten it.
When BE is activated, the strategy draws a violet horizontal line at the BreakEven level (once per trade).
BE state is cleared when the position is closed or when a new position is opened.
7. Entry & Exit Logic (Summary)
7.1 Long Entry
Conditions for a Long:
CCI signal:
CCI crosses up through the upper threshold.
Ichimoku Cloud Filter (optional):
If enabled → price must be above the Kumo.
Ichimoku Lines Filter (optional):
If enabled → Conversion Line and Base Line must be above the Kumo.
MA Direction Filter (optional):
If enabled → Close must be above the chosen MA.
Anti-re-entry flag:
allowLong must be true (cloud-based reset).
Position check:
Long entries are allowed when current position size ≤ 0 (so it can also reverse from short to long).
If all these conditions are true, the strategy sends:
strategy.entry("Long", strategy.long, qty = calculated_qty)
After entry:
allowLong = false
allowShort = true
7.2 Short Entry
Same structure, mirrored:
CCI signal:
CCI crosses down through the lower threshold.
Cloud filter: price must be below cloud (if enabled).
Lines filter: conversion & base must be below cloud (if enabled).
MA filter: Close must be below MA (if enabled).
allowShort must be true.
Position check: position size ≥ 0 (allows reversal from long to short).
Then:
strategy.entry("Short", strategy.short, qty = calculated_qty)
Flags update:
allowShort = false
allowLong = true
7.3 Exits
While in a position:
The strategy continuously recalculates SL (depending on chosen mode) and, in Percent mode, TP.
In Fib mode, fixed TP levels are computed at entry.
BreakEven may raise/tighten the SL if its conditions are met.
Exits are executed via strategy.exit:
Percent mode: one TP+SL exit per side.
Fib mode: two partial exits (TP1 and TP2) sharing the same SL.
At position open, the script also draws visual lines:
White line — entry price.
Green line(s) — TP level(s).
Red line — SL (if not using Ichimoku Trailing; with trailing, the red line is updated dynamically).
Maximum of 30 lines are kept to avoid clutter.
8. How to Use the Strategy
Choose market & timeframe
Works well on trending instruments. Try crypto, FX or indices on H1–H4, or intraday if you prefer more trades.
Adjust Ichimoku settings
Keep defaults (9/26/52/26) or adapt to your timeframe.
Configure Moving Average
Typical: EMA 200 as a trend filter.
Turn MA Direction Filter ON if you want to trade only with the main trend.
Set CCI thresholds
Default ±100 is classic.
Lower thresholds → more signals, higher noise.
Higher thresholds → fewer but stronger signals.
Enable/disable filters
Turn on Ichimoku Cloud and Ichimoku Lines if you want only “clean” trend trades.
Use Wait Position Close Before Flag Reset to control how often re-entries are allowed.
Choose TP & SL mode
Percent mode is simpler and easier to understand.
Fibonacci mode is more advanced: it aligns TP levels with the distance to stop, giving asymmetric RR setups (two partial TPs).
Choose Stable SL for fixed-risk trades, or Ichimoku / Ichimoku Trailing to tie stops to the cloud structure.
Set BreakEven
Enable BE if you want to lock in risk-free trades after a certain move.
Percent mode is straightforward; Fib mode keeps BreakEven in harmony with your Fib TP setup.
Run Backtest & Optimize
Press “Add to chart” → go to Strategy Tester.
Adjust parameters to your market and timeframe.
Look at equity curve, PF, drawdown, average trade, etc.
Live / Paper Trading
After you’re satisfied with backtest results, use the strategy to generate signals.
You can mirror entries/exits manually or connect them to alerts (if you build an alert-based execution layer).
BAY_PIVOT S/R(4 Full Lines + ALL Labels)//@version=5
indicator("BAY_PIVOT S/R(4 Full Lines + ALL Labels)", overlay=true, max_labels_count=500, max_lines_count=500)
// ────────────────────── TOGGLES ──────────────────────
showPivot = input.bool(true, "Show Pivot (Full Line + Label)")
showTarget = input.bool(true, "Show Target (Full Line + Label)")
showLast = input.bool(true, "Show Last Close (Full Line + Label)")
showPrevClose = input.bool(true, "Show Previous Close (Full Line + Label)")
useBarchartLast = input.bool(true, "Use Barchart 'Last' (Settlement Price)")
showR1R2R3 = input.bool(true, "Show R1 • R2 • R3")
showS1S2S3 = input.bool(true, "Show S1 • S2 • S3")
showStdDev = input.bool(true, "Show ±1σ ±2σ ±3σ")
showFib4W = input.bool(true, "Show 4-Week Fibs")
showFib13W = input.bool(true, "Show 13-Week Fibs")
showMonthHL = input.bool(true, "Show 1M High / Low")
showEntry1 = input.bool(false, "Show Manual Entry 1")
showEntry2 = input.bool(false, "Show Manual Entry 2")
entry1 = input.float(0.0, "Manual Entry 1", step=0.25)
entry2 = input.float(0.0, "Manual Entry 2", step=0.25)
stdLen = input.int(20, "StdDev Length", minval=1)
fib4wBars = input.int(20, "4W Fib Lookback")
fib13wBars = input.int(65, "13W Fib Lookback")
// ────────────────────── DAILY CALCULATIONS ──────────────────────
high_y = request.security(syminfo.tickerid, "D", high , lookahead=barmerge.lookahead_on)
low_y = request.security(syminfo.tickerid, "D", low , lookahead=barmerge.lookahead_on)
close_y = request.security(syminfo.tickerid, "D", close , lookahead=barmerge.lookahead_on)
pivot = (high_y + low_y + close_y) / 3
r1 = pivot + 0.382 * (high_y - low_y)
r2 = pivot + 0.618 * (high_y - low_y)
r3 = pivot + (high_y - low_y)
s1 = pivot - 0.382 * (high_y - low_y)
s2 = pivot - 0.618 * (high_y - low_y)
s3 = pivot - (high_y - low_y)
prevClose = close_y
last = useBarchartLast ? request.security(syminfo.tickerid, "D", close , lookahead=barmerge.lookahead_off) : close
target = pivot + (pivot - prevClose)
// StdDev + Fibs + Monthly (unchanged)
basis = ta.sma(close, stdLen)
dev = ta.stdev(close, stdLen)
stdRes1 = basis + dev
stdRes2 = basis + dev*2
stdRes3 = basis + dev*3
stdSup1 = basis - dev
stdSup2 = basis - dev*2
stdSup3 = basis - dev*3
high4w = ta.highest(high, fib4wBars)
low4w = ta.lowest(low, fib4wBars)
fib382_4w = high4w - (high4w - low4w) * 0.382
fib50_4w = high4w - (high4w - low4w) * 0.500
high13w = ta.highest(high, fib13wBars)
low13w = ta.lowest(low, fib13wBars)
fib382_13w_high = high13w - (high13w - low13w) * 0.382
fib50_13w = high13w - (high13w - low13w) * 0.500
fib382_13w_low = low13w + (high13w - low13w) * 0.382
monthHigh = ta.highest(high, 30)
monthLow = ta.lowest(low, 30)
// ────────────────────── COLORS ──────────────────────
colRed = color.rgb(255,0,0)
colLime = color.rgb(0,255,0)
colYellow = color.rgb(255,255,0)
colOrange = color.rgb(255,165,0)
colWhite = color.rgb(255,255,255)
colGray = color.rgb(128,128,128)
colMagenta = color.rgb(255,0,255)
colPink = color.rgb(233,30,99)
colCyan = color.rgb(0,188,212)
colBlue = color.rgb(0,122,255)
colPurple = color.rgb(128,0,128)
colRed50 = color.new(colRed,50)
colGreen50 = color.new(colLime,50)
// ────────────────────── 4 KEY FULL LINES ──────────────────────
plot(showPivot ? pivot : na, title="PIVOT", color=colYellow, linewidth=3, style=plot.style_linebr)
plot(showTarget ? target : na, title="TARGET", color=colOrange, linewidth=2, style=plot.style_linebr)
plot(showLast ? last : na, title="LAST", color=colWhite, linewidth=2, style=plot.style_linebr)
plot(showPrevClose ? prevClose : na, title="PREV CLOSE",color=colGray, linewidth=1, style=plot.style_linebr)
// ────────────────────── LABELS FOR ALL 4 KEY LEVELS (SAME STYLE AS OTHERS) ──────────────────────
f_label(price, txt, bgColor, txtColor) =>
if barstate.islast and not na(price)
label.new(bar_index, price, txt, style=label.style_label_left, color=bgColor, textcolor=txtColor, size=size.small)
if barstate.islast
showPivot ? f_label(pivot, "PIVOT\n" + str.tostring(pivot, "#.##"), colYellow, color.black) : na
showTarget ? f_label(target, "TARGET\n" + str.tostring(target, "#.##"), colOrange, color.white) : na
showLast ? f_label(last, "LAST\n" + str.tostring(last, "#.##"), colWhite, color.black) : na
showPrevClose ? f_label(prevClose, "PREV CLOSE\n"+ str.tostring(prevClose, "#.##"), colGray, color.white) : na
// ────────────────────── OTHER LEVELS – line stops at label ──────────────────────
f_level(p, txt, tc, lc, w=1) =>
if barstate.islast and not na(p)
lbl = label.new(bar_index, p, txt, style=label.style_label_left, color=lc, textcolor=tc, size=size.small)
line.new(bar_index-400, p, label.get_x(lbl), p, extend=extend.none, color=lc, width=w)
if barstate.islast
if showR1R2R3
f_level(r1, "R1\n" + str.tostring(r1, "#.##"), color.white, colRed)
f_level(r2, "R2\n" + str.tostring(r2, "#.##"), color.white, colRed)
f_level(r3, "R3\n" + str.tostring(r3, "#.##"), color.white, colRed, 2)
if showS1S2S3
f_level(s1, "S1\n" + str.tostring(s1, "#.##"), color.black, colLime)
f_level(s2, "S2\n" + str.tostring(s2, "#.##"), color.black, colLime)
f_level(s3, "S3\n" + str.tostring(s3, "#.##"), color.black, colLime, 2)
if showStdDev
f_level(stdRes1, "+1σ\n" + str.tostring(stdRes1, "#.##"), color.white, colPink)
f_level(stdRes2, "+2σ\n" + str.tostring(stdRes2, "#.##"), color.white, colPink)
f_level(stdRes3, "+3σ\n" + str.tostring(stdRes3, "#.##"), color.white, colPink, 2)
f_level(stdSup1, "-1σ\n" + str.tostring(stdSup1, "#.##"), color.white, colCyan)
f_level(stdSup2, "-2σ\n" + str.tostring(stdSup2, "#.##"), color.white, colCyan)
f_level(stdSup3, "-3σ\n" + str.tostring(stdSup3, "#.##"), color.white, colCyan, 2)
if showFib4W
f_level(fib382_4w, "38.2% 4W\n" + str.tostring(fib382_4w, "#.##"), color.white, colMagenta)
f_level(fib50_4w, "50% 4W\n" + str.tostring(fib50_4w, "#.##"), color.white, colMagenta)
if showFib13W
f_level(fib382_13w_high, "38.2% 13W High\n" + str.tostring(fib382_13w_high, "#.##"), color.white, colMagenta)
f_level(fib50_13w, "50% 13W\n" + str.tostring(fib50_13w, "#.##"), color.white, colMagenta)
f_level(fib382_13w_low, "38.2% 13W Low\n" + str.tostring(fib382_13w_low, "#.##"), color.white, colMagenta)
if showMonthHL
f_level(monthHigh, "1M HIGH\n" + str.tostring(monthHigh, "#.##"), color.white, colRed50, 2)
f_level(monthLow, "1M LOW\n" + str.tostring(monthLow, "#.##"), color.white, colGreen50, 2)
// Manual entries
plot(showEntry1 and entry1 > 0 ? entry1 : na, "Entry 1", color=colBlue, linewidth=2, style=plot.style_linebr)
plot(showEntry2 and entry2 > 0 ? entry2 : na, "Entry 2", color=colPurple, linewidth=2, style=plot.style_linebr)
// Background
bgcolor(close > pivot ? color.new(color.blue, 95) : color.new(color.red, 95))
Big Candle Identifier with RSI Divergence and Advanced Stops1. Strategy Objective
The main goal of this strategy is to:
Identify significant price momentum (big candles).
Enter trades at opportune moments based on market signals (candlestick patterns and RSI divergence).
Limit initial risk through a fixed stop loss.
Maximize profits by using a trailing stop that activates only after the trade moves a specified distance in the profitable direction.
2. Components of the Strategy
A. Big Candle Identification
The strategy identifies big candles as indicators of strong momentum.
A big candle is defined as:
The body (absolute difference between close and open) of the current candle (body0) is larger than the bodies of the last five candles.
The candle is:
Bullish Big Candle: If close > open.
Bearish Big Candle: If open > close.
Purpose: Big candles signal potential continuation or reversal of trends, serving as the primary entry trigger.
B. RSI Divergence
Relative Strength Index (RSI): A momentum oscillator used to detect overbought/oversold conditions and divergence.
Fast RSI: A 5-period RSI, which is more sensitive to short-term price movements.
Slow RSI: A 14-period RSI, which smoothens fluctuations over a longer timeframe.
Divergence: The difference between the fast and slow RSIs.
Positive divergence (divergence > 0): Bullish momentum.
Negative divergence (divergence < 0): Bearish momentum.
Visualization: The divergence is plotted on the chart, helping traders confirm momentum shifts.
C. Stop Loss
Initial Stop Loss:
When entering a trade, an immediate stop loss of 200 points is applied.
This stop loss ensures the maximum risk is capped at a predefined level.
Implementation:
Long Trades: Stop loss is set below the entry price at low - 200 points.
Short Trades: Stop loss is set above the entry price at high + 200 points.
Purpose:
Prevents significant losses if the price moves against the trade immediately after entry.
D. Trailing Stop
The trailing stop is a dynamic risk management tool that adjusts with price movements to lock in profits. Here’s how it works:
Activation Condition:
The trailing stop only starts trailing when the trade moves 200 ticks (profit) in the right direction:
Long Position: close - entry_price >= 200 ticks.
Short Position: entry_price - close >= 200 ticks.
Trailing Logic:
Once activated, the trailing stop:
For Long Positions: Trails behind the price by 150 ticks (trail_stop = close - 150 ticks).
For Short Positions: Trails above the price by 150 ticks (trail_stop = close + 150 ticks).
Exit Condition:
The trade exits automatically if the price touches the trailing stop level.
Purpose:
Ensures profits are locked in as the trade progresses while still allowing room for price fluctuations.
E. Trade Entry Logic
Long Entry:
Triggered when a bullish big candle is identified.
Stop loss is set at low - 200 points.
Short Entry:
Triggered when a bearish big candle is identified.
Stop loss is set at high + 200 points.
F. Trade Exit Logic
Trailing Stop: Automatically exits the trade if the price touches the trailing stop level.
Fixed Stop Loss: Exits the trade if the price hits the predefined stop loss level.
G. 21 EMA
The strategy includes a 21-period Exponential Moving Average (EMA), which acts as a trend filter.
EMA helps visualize the overall market direction:
Price above EMA: Indicates an uptrend.
Price below EMA: Indicates a downtrend.
H. Visualization
Big Candle Identification:
The open and close prices of big candles are plotted for easy reference.
Trailing Stop:
Plotted on the chart to visualize its progression during the trade.
Green Line: Indicates the trailing stop for long positions.
Red Line: Indicates the trailing stop for short positions.
RSI Divergence:
Positive divergence is shown in green.
Negative divergence is shown in red.
3. Key Parameters
trail_start_ticks: The number of ticks required before the trailing stop activates (default: 200 ticks).
trail_distance_ticks: The distance between the trailing stop and price once the trailing stop starts (default: 150 ticks).
initial_stop_loss_points: The fixed stop loss in points applied at entry (default: 200 points).
tick_size: Automatically calculates the minimum tick size for the trading instrument.
4. Workflow of the Strategy
Step 1: Entry Signal
The strategy identifies a big candle (bullish or bearish).
If conditions are met, a trade is entered with a fixed stop loss.
Step 2: Initial Risk Management
The trade starts with an initial stop loss of 200 points.
Step 3: Trailing Stop Activation
If the trade moves 200 ticks in the profitable direction:
The trailing stop is activated and follows the price at a distance of 150 ticks.
Step 4: Exit the Trade
The trade is exited if:
The price hits the trailing stop.
The price hits the initial stop loss.
5. Advantages of the Strategy
Risk Management:
The fixed stop loss ensures that losses are capped.
The trailing stop locks in profits after the trade becomes profitable.
Momentum-Based Entries:
The strategy uses big candles as entry triggers, which often indicate strong price momentum.
Divergence Confirmation:
RSI divergence helps validate momentum and avoid false signals.
Dynamic Profit Protection:
The trailing stop adjusts dynamically, allowing the trade to capture larger moves while protecting gains.
6. Ideal Market Conditions
This strategy performs best in:
Trending Markets:
Big candles and momentum signals are more effective in capturing directional moves.
High Volatility:
Larger price swings improve the probability of reaching the trailing stop activation level (200 ticks).
Nef33 Forex & Crypto Trading Signals PRO
1. Understanding the Indicator's Context
The indicator generates signals based on confluence (trend, volume, key zones, etc.), but it does not include predefined SL or TP levels. To establish them, we must:
Use dynamic or static support/resistance levels already present in the script.
Incorporate volatility (such as ATR) to adjust the levels based on market conditions.
Define a risk/reward ratio (e.g., 1:2).
2. Options for Determining SL and TP
Below, I provide several ideas based on the tools available in the script:
Stop Loss (SL)
The SL should protect you from adverse movements. You can base it on:
ATR (Volatility): Use the smoothed ATR (atr_smooth) multiplied by a factor (e.g., 1.5 or 2) to set a dynamic SL.
Buy: SL = Entry Price - (atr_smooth * atr_mult).
Sell: SL = Entry Price + (atr_smooth * atr_mult).
Key Zones: Place the SL below a support (for buys) or above a resistance (for sells), using Order Blocks, Fair Value Gaps, or Liquidity Zones.
Buy: SL below the nearest ob_lows or fvg_lows.
Sell: SL above the nearest ob_highs or fvg_highs.
VWAP: Use the daily VWAP (vwap_day) as a critical level.
Buy: SL below vwap_day.
Sell: SL above vwap_day.
Take Profit (TP)
The TP should maximize profits. You can base it on:
Risk/Reward Ratio: Multiply the SL distance by a factor (e.g., 2 or 3).
Buy: TP = Entry Price + (SL Distance * 2).
Sell: TP = Entry Price - (SL Distance * 2).
Key Zones: Target the next resistance (for buys) or support (for sells).
Buy: TP at the next ob_highs, fvg_highs, or liq_zone_high.
Sell: TP at the next ob_lows, fvg_lows, or liq_zone_low.
Ichimoku: Use the cloud levels (Senkou Span A/B) as targets.
Buy: TP at senkou_span_a or senkou_span_b (whichever is higher).
Sell: TP at senkou_span_a or senkou_span_b (whichever is lower).
3. Practical Implementation
Since the script does not automatically draw SL/TP, you can:
Calculate them manually: Observe the chart and use the levels mentioned.
Modify the code: Add SL/TP as labels (label.new) at the moment of the signal.
Here’s an example of how to modify the code to display SL and TP based on ATR with a 1:2 risk/reward ratio:
Modified Code (Signals Section)
Find the lines where the signals (trade_buy and trade_sell) are generated and add the following:
pinescript
// Calculate SL and TP based on ATR
atr_sl_mult = 1.5 // Multiplier for SL
atr_tp_mult = 3.0 // Multiplier for TP (1:2 ratio)
sl_distance = atr_smooth * atr_sl_mult
tp_distance = atr_smooth * atr_tp_mult
if trade_buy
entry_price = close
sl_price = entry_price - sl_distance
tp_price = entry_price + tp_distance
label.new(bar_index, low, "Buy: " + str.tostring(math.round(bull_conditions, 1)), color=color.green, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_up, size=size.tiny)
if trade_sell
entry_price = close
sl_price = entry_price + sl_distance
tp_price = entry_price - tp_distance
label.new(bar_index, high, "Sell: " + str.tostring(math.round(bear_conditions, 1)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_down, size=size.tiny)
Code Explanation
SL: Calculated by subtracting/adding sl_distance to the entry price (close) depending on whether it’s a buy or sell.
TP: Calculated with a double distance (tp_distance) for a 1:2 risk/reward ratio.
Visualization: Labels are added to the chart to display SL (red) and TP (blue).
4. Practical Strategy Without Modifying the Code
If you don’t want to modify the script, follow these steps manually:
Entry: Take the trade_buy or trade_sell signal.
SL: Check the smoothed ATR (atr_smooth) on the chart or calculate a fixed level (e.g., 1.5 times the ATR). Also, review nearby key zones (OB, FVG, VWAP).
TP: Define a target based on the next key zone or multiply the SL distance by 2 or 3.
Example:
Buy at 100, ATR = 2.
SL = 100 - (2 * 1.5) = 97.
TP = 100 + (2 * 3) = 106.
5. Recommendations
Test in Demo: Apply this logic in a demo account to adjust the multipliers (atr_sl_mult, atr_tp_mult) based on the market (forex or crypto).
Combine with Zones: If the ATR-based SL is too wide, use the nearest OB or FVG as a reference.
Risk/Reward Ratio: Adjust the TP based on your tolerance (1:1, 1:2, 1:3)
Risk & Position DashboardRisk & Position Dashboard
Overview
The Risk & Position Dashboard is a comprehensive trading tool designed to help traders calculate optimal position sizes, manage risk, and visualize potential profit/loss scenarios before entering trades. This indicator provides real-time calculations for position sizing based on account size, risk percentage, and stop-loss levels, while displaying multiple take-profit targets with customizable risk-reward ratios.
Key Features
Position Sizing & Risk Management:
Automatic position size calculation based on account size and risk percentage
Support for leveraged trading with maximum leverage limits
Fractional shares support for brokers that allow partial share trading
Real-time fee calculation including entry, stop-loss, and take-profit fees
Break-even price calculation including trading fees
Multi-Target Profit Management:
Support for up to 3 take-profit levels with individual portion allocations
Customizable risk-reward ratios for each take-profit target
Visual profit/loss zones displayed as colored boxes on the chart
Individual profit calculations for each take-profit level
Visual Dashboard:
Clean, customizable table display showing all key metrics
Configurable label positioning and styling options
Real-time tracking of whether stop-loss or take-profit levels have been reached
Color-coded visual zones for easy identification of risk and reward areas
Advanced Configuration:
Comprehensive input validation and error handling
Support for different chart timeframes and symbols
Customizable colors, fonts, and display options
Hide/show individual data fields for personalized dashboard views
How to Use
Set Account Parameters: Configure your account size, maximum risk percentage per trade, and trading fees in the "Account Settings" section.
Define Trade Setup: Use the "Entry" time picker to select your entry point on the chart, then input your entry price and stop-loss level.
Configure Take Profits: Set your desired risk-reward ratios and portion allocations for each take-profit level. The script supports 1-3 take-profit targets.
Analyze Results: The dashboard will automatically calculate and display position size, number of shares, potential profits/losses, fees, and break-even levels.
Visual Confirmation: Colored boxes on the chart show profit zones (green) and loss zones (red), with lines extending to current price levels.
Reset Entry and SL:
You can easily reset the entry and stop-loss by clicking the "Reset points..." button from the script's "More" menu.
This is useful if you want to quickly clear your current trade setup and start fresh without manually adjusting the points on the chart.
Calculations
The script performs sophisticated calculations including:
Position size based on risk amount and price difference between entry and stop-loss
Leverage requirements and position amount calculations
Fee-adjusted risk-reward ratios for realistic profit expectations
Break-even price including all trading costs
Individual profit calculations for partial position closures
Detailed Take-Profit Calculation Formula:
The take-profit prices are calculated using the following mathematical formula:
// Core variables:
// risk_amount = account_size * (risk_percentage / 100)
// total_risk_per_share = |entry_price - sl_price| + (entry_price * fee%) + (sl_price * fee%)
// shares = risk_amount / total_risk_per_share
// direction_factor = 1 for long positions, -1 for short positions
// Take-profit calculation:
net_win = total_risk_per_share * shares * RR_ratio
tp_price = (net_win + (direction_factor * entry_price * shares) + (entry_price * fee% * shares)) / (direction_factor * shares - fee% * shares)
Step-by-step example for a long position (based on screenshot):
Account Size: 2,000 USDT, Risk: 2% = 40 USDT
Entry: 102,062.9 USDT, Stop Loss: 102,178.4 USDT, Fee: 0.06%
Risk per share: |102,062.9 - 102,178.4| + (102,062.9 × 0.0006) + (102,178.4 × 0.0006) = 115.5 + 61.24 + 61.31 = 238.05 USDT
Shares: 40 ÷ 238.05 = 0.168 shares (rounded to 0.17 in display)
Position Size: 0.17 × 102,062.9 = 17,350.69 USDT
Position Amount (with 9x leverage): 17,350.69 ÷ 9 = 1,927.85 USDT
For 2:1 RR: Net win = 238.05 × 0.17 × 2 = 80.94 USDT
TP1 price = (80.94 + (1 × 102,062.9 × 0.17) + (102,062.9 × 0.0006 × 0.17)) ÷ (1 × 0.17 - 0.0006 × 0.17) = 101,464.7 USDT
For 3:1 RR: TP2 price = 101,226.7 USDT (following same formula with RR=3)
This ensures that after accounting for all fees, the actual risk-reward ratio matches the specified target ratio.
Risk Management Features
Maximum Trade Amount: Optional setting to limit position size regardless of account size
Leverage Limits: Built-in maximum leverage protection
Fee Integration: All calculations include realistic trading fees for accurate expectations
Validation: Automatic checking that take-profit portions sum to 100%
Historical Tracking: Visual indication when stop-loss or take-profit levels are reached (within last 5000 bars)
Understanding Max Trade Amount - Multiple Simultaneous Trades:
The "Max Trade Amount" feature is designed for traders who want to open multiple positions simultaneously while maintaining proper risk management. Here's how it works:
Key Concept:
- Risk percentage (2%) always applies to your full Account Size
- Max Trade Amount limits the capital allocated per individual trade
- This allows multiple trades with full risk on each trade
Example from Screenshot:
Account Size: 2,000 USDT
Max Trade Amount: 500 USDT
Risk per Trade: 2% × 2,000 = 40 USDT per trade
Stop Loss Distance: 0.11% from entry
Result: Position Size = 17,350.69 USDT with 35x leverage
Total Risk (including fees): 40.46 USDT
Multiple Trades Strategy:
With this setup, you can open:
Trade 1: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Trade 2: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Trade 3: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Trade 4: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Total Portfolio Exposure:
- 4 simultaneous trades = 4 × 495.73 = 1,982.92 USDT position amount
- Total risk exposure = 4 × 40 = 160 USDT (8% of account)
PivotBoss VWAP Bands (Auto TF) - FixedWhat this indicator shows (high level)
The indicator plots a VWAP line and three bands above (R1, R2, R3) and three bands below (S1, S2, S3).
Band spacing is computed from STD(abs(VWAP − price), N) and multiplied by 1, 2 and 3 to form R1–R3 / S1–S3. The script is timeframe-aware: on 30m/1H charts it uses Weekly VWAP and weekly bands; on Daily charts it uses Monthly VWAP and monthly bands; otherwise it uses the session/chart VWAP.
VWAP = the market’s volume-weighted average price (a measure of fair value). Bands = volatility-scaled zones around that fair value.
Trading idea — concept summary
VWAP = fair value. Price above VWAP implies bullish bias; below VWAP implies bearish bias.
Bands = graded overbought/oversold zones. R1/S1 are near-term limits, R2/S2 are stronger, R3/S3 are extreme.
Use trend alignment + price action + volume to choose higher-probability trades. VWAP bands give location and magnitude; confirmations reduce false signals.
Entry rules (multiple strategies with examples)
A. Momentum breakout (trend-following) — preferred on trending markets
Setup: Price consolidates near or below R1 and then closes above R1 with above-average volume. Chart: 30m/1H (Weekly VWAP) or Daily (Monthly VWAP) depending on your timeframe.
Entry: Enter long at the close of the breakout bar that closes above R1.
Stop-loss: Place initial stop below the higher of (VWAP or recent swing low). Example: if price broke R1 at ₹1,200 and VWAP = ₹1,150, set stop at ₹1,145 (5 rupee buffer below VWAP) or below the last swing low if that is wider.
Target: Partial target at R2, full target at R3. Trail stop to VWAP or to R1 after price reaches R2.
Example numeric: Weekly VWAP = ₹1,150, R1 = ₹1,200, R2 = ₹1,260. Buy at ₹1,205 (close above R1), stop ₹1,145, target1 ₹1,260 (R2), target2 ₹1,320 (R3).
B. Mean-reversion fade near bands — for range-bound markets
Setup: Market is not trending (VWAP flatish). Price rallies up to R2 or R3 and shows rejection (pin bar, bearish engulfing) on increasing or neutral volume.
Entry: Enter short after a confirmed rejection candle that fails to sustain above R2 or R3 (prefer confirmation: close back below R1 or below the rejection candle low).
Stop-loss: Just above the recent high (e.g., 1–2 ATR or a fixed buffer above R2/R3).
Target: First target VWAP, second target S1. Reduce size if taking R3 fade as it’s an extreme.
Example numeric: VWAP = ₹950, R2 = ₹1,020. Price spikes to ₹1,025 and forms a bearish engulfing candle. Enter short at ₹1,015 after the next close below ₹1,020. Stop at ₹1,035, target VWAP ₹950.
C. Pullback entries in trending markets — higher probability
Setup: Price is above VWAP and trending higher (higher highs and higher lows). Price pulls back toward VWAP or S1 with decreasing downside volume and a reversal candle forms.
Entry: Long when price forms a bullish reversal (hammer/inside-bar) with a close back above the pullback candle.
Stop-loss: Below the pullback low (or below S2 if a larger stop is justified).
Target: VWAP then R1; if momentum resumes, trail toward R2/R3.
Example numeric: Price trending above Weekly VWAP at ₹1,400; pullback to S1 at ₹1,360. Enter long at ₹1,370 when a bullish candle closes; stop at ₹1,350; first target VWAP ₹1,400, second target R1 ₹1,450.
Exit rules and money management
Basic exit hierarchy
Hard stop exit — when price hits initial stop-loss. Always use.
Target exit — take partial profits at R1/R2 (for longs) or S1/S2 (for shorts). Use trailing stops for the remainder.
VWAP invalidation — if you entered long above VWAP and price returns and closes significantly below VWAP, consider exiting (condition depends on timeframe and trade size).
Price action exit — reversal patterns (strong opposite candle, bearish/bullish engulfing) near targets or beyond signals to exit.
Trailing rules
After price reaches R2, move stop to breakeven + a small buffer or to VWAP.
After price reaches R3, trail by 1 ATR or lock a defined profit percentage.
Position sizing & risk
Risk per trade: commonly 0.5–2% of account equity.
Determine position size by RiskAmount ÷ (EntryPrice − StopPrice).
If the stop distance is large (e.g., trading R3 fades), reduce position size.
Filters & confirmation (to reduce false signals)
Volume filter: For breakouts, require volume above short-term average (e.g., >20-period average). Breakouts on low volume are suspect.
Trend filter: Only take breakouts in the direction of the higher-timeframe trend (for example, use Daily/Weekly trend when trading 30m/1H).
Candle confirmation: Prefer entries on close of the confirming candle (not intrabar noise).
Multiple confirmations: When R1 break happens but RSI/plotted momentum indicator does not confirm, treat signal as lower probability.
Special considerations for timeframe-aware logic
On 30m/1H the script uses Weekly VWAP/bands. That means band levels change only on weekly candles — they are strong, structural levels. Treat R1/R2/R3 as significant and expect fewer, stronger signals.
On Daily, the script uses Monthly VWAP/bands. These are wider; trades should allow larger stops and smaller position sizes (or be used for swing trades).
On other intraday charts you get session VWAP (useful for intraday scalps).
Example: If you trade 1H and the Weekly R1 is at ₹2,400 while session VWAP is ₹2,350, a close above Weekly R1 represents a weekly-level breakout — prefer that for swing entries rather than scalps.
Example trade walkthrough (step-by-step)
Context: 1H chart, auto-mapped → Weekly VWAP used.
Weekly VWAP = ₹3,000; R1 = ₹3,080; R2 = ₹3,150.
Price consolidates below R1. A large bullish candle closes at ₹3,085 with volume 40% above the 20-bar average.
Entry: Buy at close ₹3,085.
Stop: Place stop at ₹2,995 (just under Weekly VWAP). Risk = ₹90.
Position size: If risking ₹900 per trade → size = 900 ÷ 90 = 10 units.
Targets: Partial take-profit at R2 = ₹3,150; rest trailed with stop moved to breakeven after R2 is hit.
If price reverses and closes below VWAP within two bars, exit immediately to limit drawdown.
When to avoid trading these signals
High-impact news (earnings, macro announcements) that can gap through bands unpredictably.
Thin markets with low volume — VWAP loses significance when volumes are extremely low.
When weekly/monthly bands are flat but intraday price is volatile without clear structure — prefer session VWAP on smaller timeframes.
Alerts & automation suggestions
Alert on close above R1 / below S1 (use the built-in alertcondition the script adds). For higher-confidence alerts, require volume filter in the alert condition.
Automated order rules (if you automate): use limit entry at breakout close plus a small slippage buffer, immediate stop order, and OCO for TP and SL.
BackTestLibLibrary "BackTestLib"
Allows backtesting indicator performance. Tracks typical metrics such as won/loss, profit factor, draw down, etc. Trading View strategy library provides similar (and more comprehensive)
functionality but only works with strategies. This libary was created to address performance tracking within indicators.
Two primary outputs are generated:
1. Summary Table: Displays overall performance metrics for the indicator over the chart's loaded timeframe and history
2. Details Table: Displays a table of individual trade entries and exits. This table can grow larger than the available chart space. It does have a max number of rows supported. I haven't
found a way to add scroll bars or scroll bar equivalents yet.
f_init(data, _defaultStopLoss, _defaultTakeProfit, _useTrailingStop, _useTraingStopToBreakEven, _trailingStopActivation, _trailingStopOffset)
f_init Initialize the backtest data type. Called prior to using the backtester functions
Parameters:
data (backtesterData) : backtesterData to initialize
_defaultStopLoss (float) : Default trade stop loss to apply
_defaultTakeProfit (float) : Default trade take profit to apply
_useTrailingStop (bool) : Trailing stop enabled
_useTraingStopToBreakEven (bool) : When trailing stop active, trailing stop will increase no further than the entry price
_trailingStopActivation (int) : When trailing stop active, trailing will begin once price exceeds base stop loss by this number of points
_trailingStopOffset (int) : When trailing stop active, it will trail the max price achieved by this number of points
Returns: Initialized data set
f_buildResultStr(_resultType, _price, _resultPoints, _numWins, _pointsWon, _numLoss, _pointsLost)
f_buildResultStr Helper function to construct a string of resutling data for exit tooltip labels
Parameters:
_resultType (string)
_price (float)
_resultPoints (float)
_numWins (int)
_pointsWon (float)
_numLoss (int)
_pointsLost (float)
f_buildResultLabel(data, labelVertical, labelOffset, long)
f_buildResultLabel Helper function to construct an Exit label for display on the chart
Parameters:
data (backtesterData)
labelVertical (bool)
labelOffset (int)
long (bool)
f_updateTrailingStop(_entryPrice, _curPrice, _sl, _tp, trailingStopActivationInput, trailingStopOffsetInput, useTrailingStopToBreakEven)
f_updateTrailingStop Helper function to advance the trailing stop as price action dictates
Parameters:
_entryPrice (float)
_curPrice (float)
_sl (float)
_tp (float)
trailingStopActivationInput (float)
trailingStopOffsetInput (float)
useTrailingStopToBreakEven (bool)
Returns: Updated stop loss for current price action
f_enterShort(data, entryPrice, fixedStopLoss)
f_enterShort Helper function to enter a short and collect data necessary for tracking the trade entry
Parameters:
data (backtesterData)
entryPrice (float)
fixedStopLoss (float)
Returns: Updated backtest data
f_enterLong(data, entryPrice, fixedStopLoss)
f_enterLong Helper function to enter a long and collect data necessary for tracking the trade entry
Parameters:
data (backtesterData)
entryPrice (float)
fixedStopLoss (float)
Returns: Updated backtest data
f_exitTrade(data)
f_enterLong Helper function to exit a trade and update/reset tracking data
Parameters:
data (backtesterData)
Returns: Updated backtest data
f_checkTradeConditionForExit(data, condition, curPrice, enableRealTime)
f_checkTradeConditionForExit Helper function to determine if provided condition indicates an exit
Parameters:
data (backtesterData)
condition (bool) : When true trade will exit
curPrice (float)
enableRealTime (bool) : When true trade will evaluate if barstate is relatime or barstate is confirmed; otherwise just checks on is confirmed
Returns: Updated backtest data
f_checkTrade(data, curPrice, curLow, curHigh, enableRealTime)
f_checkTrade Helper function to determine if current price action dictates stop loss or take profit exit
Parameters:
data (backtesterData)
curPrice (float)
curLow (float)
curHigh (float)
enableRealTime (bool) : When true trade will evaluate if barstate is relatime or barstate is confirmed; otherwise just checks on is confirmed
Returns: Updated backtest data
f_fillCell(_table, _column, _row, _title, _value, _bgcolor, _txtcolor, _text_size)
f_fillCell Helper function to construct result table cells
Parameters:
_table (table)
_column (int)
_row (int)
_title (string)
_value (string)
_bgcolor (color)
_txtcolor (color)
_text_size (string)
Returns: Table cell
f_prepareStatsTable(data, drawTesterSummary, drawTesterDetails, summaryTableTextSize, detailsTableTextSize, displayRowZero, summaryTableLocation, detailsTableLocation)
f_fillCell Helper function to populate result table
Parameters:
data (backtesterData)
drawTesterSummary (bool)
drawTesterDetails (bool)
summaryTableTextSize (string)
detailsTableTextSize (string)
displayRowZero (bool)
summaryTableLocation (string)
detailsTableLocation (string)
Returns: Updated backtest data
backtesterData
backtesterData - container for backtest performance metrics
Fields:
tradesArray (array) : Array of strings with entries for each individual trade and its results
pointsBalance (series float) : Running sum of backtest points won/loss results
drawDown (series float) : Running sum of backtest total draw down points
maxDrawDown (series float) : Running sum of backtest total draw down points
maxRunup (series float) : Running sum of max points won over the backtest
numWins (series int) : Number of wins of current backtes set
numLoss (series int) : Number of losses of current backtes set
pointsWon (series float) : Running sum of points won to date
pointsLost (series float) : Running sum of points lost to date
entrySide (series string) : Current entry long/short
tradeActive (series bool) : Indicates if a trade is currently active
tradeComplete (series bool) : Indicates if a trade just exited (due to stop loss or take profit)
entryPrice (series float) : Current trade entry price
entryTime (series int) : Current trade entry time
sl (series float) : Current trade stop loss
tp (series float) : Current trade take profit
defaultStopLoss (series float) : Default trade stop loss to apply
defaultTakeProfit (series float) : Default trade take profit to apply
useTrailingStop (series bool) : Trailing stop enabled
useTrailingStopToBreakEven (series bool) : When trailing stop active, trailing stop will increase no further than the entry price
trailingStopActivation (series int) : When trailing stop active, trailing will begin once price exceeds base stop loss by this number of points
trailingStopOffset (series int) : When trailing stop active, it will trail the max price achieved by this number of points
resultType (series string) : Current trade won/lost
exitPrice (series float) : Current trade exit price
resultPoints (series float) : Current trade points won/lost
summaryTable (series table) : Table to deisplay summary info
tradesTable (series table) : Table to display per trade info
position_toolLibrary "position_tool"
Trying to turn TradingView's position tool into a library from which you can draw position tools for your strategies on the chart. Not sure if this is going to work
calcBaseUnit()
Calculates the chart symbol's base unit of change in asset prices.
Returns: (float) A ticks or pips value of base units of change.
calcOrderPipsOrTicks(orderSize, unit)
Converts the `orderSize` to ticks.
Parameters:
orderSize (float) : (series float) The order size to convert to ticks.
unit (simple float) : (simple float) The basic units of change in asset prices.
Returns: (int) A tick value based on a given order size.
calcProfitLossSize(price, entryPrice, isLongPosition)
Calculates a difference between a `price` and the `entryPrice` in absolute terms.
Parameters:
price (float) : (series float) The price to calculate the difference from.
entryPrice (float) : (series float) The price of entry for the position.
isLongPosition (bool)
Returns: (float) The absolute price displacement of a price from an entry price.
calcRiskRewardRatio(profitSize, lossSize)
Calculates a risk to reward ratio given the size of profit and loss.
Parameters:
profitSize (float) : (series float) The size of the profit in absolute terms.
lossSize (float) : (series float) The size of the loss in absolute terms.
Returns: (float) The ratio between the `profitSize` to the `lossSize`
createPosition(entryPrice, entryTime, tpPrice, slPrice, entryColor, tpColor, slColor, textColor, showExtendRight)
Main function to create a position visualization with entry, TP, and SL
Parameters:
entryPrice (float) : (float) The entry price of the position
entryTime (int) : (int) The entry time of the position in bar_time format
tpPrice (float) : (float) The take profit price
slPrice (float) : (float) The stop loss price
entryColor (color) : (color) Color for entry line
tpColor (color) : (color) Color for take profit zone
slColor (color) : (color) Color for stop loss zone
textColor (color) : (color) Color for text labels
showExtendRight (bool) : (bool) Whether to extend lines to the right
Returns: (bool) Returns true when position is closed





















