Profit booking Indicatorbasic indicator to check swing highs and lows. it uses macd cross over along with moving average of 20 and 50. when candle crosses 50ema it will give buy signal and when crosses below 20ema it gives sell signal.
Cari skrip untuk "profit"
McGinley Dynamic debugged🔍 McGinley Dynamic Debugged (Adaptive Moving Average)
This indicator plots the McGinley Dynamic, a mathematically adaptive moving average designed to reduce lag and better track price action during both trends and consolidations.
✅ Key Features:
Adaptive smoothing: The McGinley Dynamic adjusts itself based on the speed of price changes.
Lag reduction: Compared to traditional moving averages like EMA or SMA, McGinley provides smoother yet responsive tracking.
Stability fix: This version includes a robust fix for rare recursive calculation issues, particularly on low-priced historical assets (e.g., Wipro pre-2000).
⚙️ What’s Different in This Debugged Version?
Implements manual clamping on the source / previous value ratio to prevent mathematical spikes that could cause flattening or distortion in the plotted line.
Ensures more stable behavior across all instruments and timeframes, especially those with historically low price points or volatile early data.
💡 Use Case:
Ideal for:
Trend confirmation
Entry filtering
Adaptive support/resistance visualization
Improving signal precision in low-volatility or high-noise environments
⚠️ Notes:
Works best when combined with volume filters or other trend indicators for validation.
This version is optimized for visual use—for signal generation, consider pairing it with additional logic or thresholds.
Profit TraderWhat is this?
This module will helps you to implement 2 strategies: Trend Following and Swing Trading. You will have a complete strategies in any market condition. This module will reach it's maximum potential if you combine with our other module: Trend Optimizer module and momentum line module
The Indicators & strategies?
This module consist of short term and medium term resist and support (R/S). R/S is based on price fractals, modified to a simpler visualization, and Standard Deviation that shows in grey area.
1. The short R/S (the blue & red lines, we called: R/S) represent 1 week timeframe fractal. R/S is used for breakout strategy. This indicator will be perfectly works with our other module: Trend Optimizer. While the trend is positive and price breaks R, it indicate an uptrend phase. Watch the S level, as long price stays above S, trend following method will works. On the other side, while the trend is flattening and price breaks S, it indicate early bearish phase.
2. The medium R/S (the blue & red dots, we called: R/S+) represent 1 month timeframe fractal. RS+ is used for swing strategy. This indicator will also perfectly works with our other module: trend optimizer. While the trend is consolidating, trader have to change from R/S into R/S+ (dotted line) as a swing high (sell on strength) & swing low range (buy on weakness).
3. The grey area around charts. it is a statistical standard deviation +/-2 from 20 days price average which is commonly used in Bollinger Band as well. This grey area works well with RS+ (the blue & red dots). Grey area, as what we knows in standard deviation, when data (price) moves outside the deviation, it tends to have a reversal movement back into deviation area. If the price piking above its grey area, it tends to have a pullback movement. If price drop below its grey area, it tends to have a rebound.
Benefit For You
You'll have a guidance how to follow the trend while the major trend is as you expected, and how to trade in swing low - high condition while the trend is sideways.
If you combine this script with our other two module: Trend optimizer module & Momentum Line Module, You'll have a complete template to analyze both trend and swing strategies.
PROFIT INDICATORFirst let me tell you which indicators have been used in this script so that you have the confidence while taking the trade:
(a) Bollinger Band with 20 SMA Inside it - Currently it is off, you can turn it on from settings.
(b) HMA 33, I have added the option of using two HMA's simultaneously. You can use HMA, EMA, SMA as per your settings and it would be color trending.
(c) VWAP- you can turn it on from settings
(d) CPR- you can turn it on from settings
(e) EMA's 20, 50, 200. Currently off, you can turn it on from settings.
(d) SMA's 50 and 200. Currently off, yu can turn it on from settings, if you want to use 20 SMA you can use bollinger band basis that is 20 period SMA.
(f) Trend bar at bottom on the basis of 50 EMA.
(g) Half Trend
(h) Trend strength Detector
(d) EMA 50 high and low to show the pac channel. I am not using this however as per request I have added this. Currently, it is trun on and you can turn it off from settings.
(f) Auto Fib levels
Please use a stick note for few days and mention imp notes before taking trade to check if all the conditions are matching to take the trade.
Buy Condition:-
1. Bolling band should be widely open.
2. Check the support and resistance from CPR. Candle should close above support in green.
3. Check the trend bar at bottom, it should be green, if it is grey in colour dont enter in trade.
4. Candle should be closing above EMA 50 and its upto you if you need additional confirmation, you can use EMA 20, 50, 200 and SMA 50 and 200, this is optional.
5. You can use VWAP as support or resistance and you can turn it on from settings.
6. Trending HMA of 33 should be in green for buy.
7. Half trend Indicator should give buy signal.
8. Trend Strength Indicator for checking the strength of the trend, if the arrow is big upside, you can go for buy.
9. Exit from buy trade when it start showing very small arrow which means trend is about to change.
10.Exit buy trade at 61.8 Fib level
Sell Condition:-
1. Bolling band should be widely open.
2. Check the support and resistance from CPR. Candle should close below resistance in red.
3. Check the trend bar at bottom, it should be red, if it is grey in colour dont enter in trade.
4. Candle should be closing below EMA 50 and its upto you if you need additional confirmation, you can use EMA 20, 50, 200 and SMA 50 and 200, this is optional.
5. You can use VWAP as support or resistance and you can turn it on from settings.
6. Trending HMA of 33 should be in red for sell.
7. Half trend Indicator should give sell signal.
8. Trend Strength Indicator for checking the strength of the trend, if the arrow is big downside, you can go for sell.
9. Exit from sell trade when down arrows start showing very small in size which means trend is about to change.
10.Exit sell trade at 61.8 Fib level
Profit/Loss Live trackerI small script to track the current active trade live.
**HOW IT WORKS**
change inputs in parameter
- Entry price
- Invested capital
- Comission fees
Profit Accumulator Relative Strength IndexHi Everyone
Thought I'd share this nice and simple RSI indicator with you which uses short and long length crossover to determine potential long and short trades. This indicator also has multiple timeframe functionality.
Please use this with other indicators or price action etc to confirm long and short trades.
Personally I like to see the crossover on the longer timeframe and close out on a lower timeframe (i.e. spot the entry on the 1hr charts and close my position based on the 15min)
If anyone would like alerts putting on here for crossover then just let me know.
Cheers
Mike
Profit Accumulator Support and ResistanceHi Everyone
Thought I'd share this support and resistance script.
This has two settings on it which are resolution (timeframe) and the number of bars back to look. The default setting is 1 Week and 2 bars which is the one I like using the most.
The highest high and lowest low are indicated by the thicker red lines on the chart.
Enjoy using this.
Cheers
Mike
Profit Accumulator Heat MapHi Everyone
Happy to share this heat map packed full of indicators to make those trading decisions. There are a whole host of indicators including:
Inverse Fischer Transform
Moving Average Slope
EMA50 Crossover
Schaff Trend Cycle
MACD
RSI
Stochastic RSI
Moving Average Cross Over
Quantitative Qualitative Estimation
On Balance Volume
All of the indicators are customisable in the settings so you can adjust them to how you want.
I often find that the combination of MACD and QQE provide good early entry and exit signals.
Any comments or improvements then please feel free to get in touch.
Cheers
Mike
Big thanks go to @everget, @JustUncleL and @LazyBear for the use of their codes.
Profit Accumulator VolatilityHi Everyone
I thought I'd share my new volatility trend indicator for anyone to use.
The indicator tracks the volatility in the market and plots this accordingly. Any plot above the zero line is a bullish signal and anything below the zero line is a bearish signal.
Long and Short Entry points are indicated at the 10 and -10 values respectively. A value of over 40 , or under -40 indicates a strong trend.
Possible entry and exit points are also highlighted on the chart.
I've added alerts onto this indicator highlighting possible entry and exit points as well as when strong trends are developing and when they are over.
This is intended to be used with your own indicators and/or analysis of the market and should be used carefully.
I personally like to use this indicator for entry on the one hour chart and then drop down to the 15 minute chart to confirm my entry and to use that timeframe for my exit.
Please feel free to forward any improvements that you'd like to make.
Cheers
Mike
Profit Accumulator On Balance VolumeOn Balance Volume Indicator
This is a support indicator to the Main Indicator which has also been published.
This indicator is from the basis of user Everget and a friend of mine on another site. This indicator has used a smoothing function in an attempt to provide more robust signals.
In this indicator the user is looking for:
Long trade: Upward sloping signal line and OBV greater than the signal line (shaded green).
Short trade: Downward sloping signal line and OBV less than the signal line (shaded red).
A horizontal signal line is a sign that the market is moving horizontally and trades should be placed very carefully. This indicator should definitely be used with the others in the suite to provide confluence when making a trade.
I've been using this successfully on the one hour FX charts, but seems to work equally as well on higher or lower time frames (not less than 15min).
The other indicators which are part of the suite are shown on the website which is highlighted in my signature at the bottom of the page. Purchase of the main indicator gives access to the full suite of eight indicators. I use the other indicators to confirm the direction of the trade and to determine if I want to trade or not. I use it along with the 2min, 15min and 4hr timeframes to identify the best entry window and how long I'm likely to be in the trade.
Support can be provided via private message or in the comments below.
The links are provided below for access to the indicator.
Profit Accumulator Heat MapHeat Map Indicator
This is a support indicator to the Main Indicator which has also been published.
This is a list of a number of indicators which cover trend, momentum and volatility. The key is very simple for this indicator, green is a long trade, red is a short trade and grey is an indicator which may be transitioning. The indicators uses are: MACD, PSAR, Bollinger Bands, RSI, Momentum and Chandelier Exit. All of the settings are customisable within the indicator and the user can best fit these around their charts. The simplicity of the heat map is that the more of one colour there is, the more likely it is that a trade can be placed.
I've been using this successfully on the one hour FX charts, but seems to work equally as well on higher or lower time frames (not less than 15min).
The other indicators which are part of the suite are shown on the website which is highlighted in my signature at the bottom of the page. Purchase of the main indicator gives access to the full suite of eight indicators. I use the other indicators to confirm the direction of the trade and to determine if I want to trade or not. I use it along with the 2min, 15min and 4hr timeframes to identify the best entry window and how long I'm likely to be in the trade.
Support can be provided via private message or in the comments below.
The links are provided below for access to the indicator.
Profit Accumulator Moving Average SlopeMoving Average Slope Indicator
This is a support indicator to the Main Indicator which has also been published.
This indicator makes use of custom and adjustable moving averages. There are two options for this centred oscillator:
Average of Three Moving Averages on Current Time Frame
Average of Three Moving Average Time Frames for One Length (i.e. if I'm using a 1hr time frame I would take the average of 30min, 1hr and 4hr moving averages with a 12 length).
When the trend line crosses above zero it is an indication for a long trade and when the trend line crosses below zero it is an indication for a short trade.
Whilst an actual alert function is not set for the indicator, the TradingView alert function can be used to trigger a message when the trendline crosses above or below zero.
I've been using this successfully on the one hour FX charts, but seems to work equally as well on higher or lower time frames (not less than 15min).
The other indicators which are part of the suite are shown on the website which is highlighted in my signature at the bottom of the page. Purchase of the main indicator gives access to the full suite of eight indicators. I use the other indicators to confirm the direction of the trade and to determine if I want to trade or not. I use it along with the 2min, 15min and 4hr timeframes to identify the best entry window and how long I'm likely to be in the trade.
Support can be provided via private message or in the comments below.
The links are provided below for access to the indicator.
Profit Accumulator Momentum Trend IndicatorMomentum Trend Indicator
This is a support indicator to the Main Indicator which has also been published.
This indicator uses a modified stochastic trendline and a smoothed momentum line (which combines stochastic, RSI and moving average). This is a centred oscillator from -100 to 100 which makes it easier to track. The stochastic line is the quicker moving line which potentially acts as the first trigger. If the momentum line then begins to follow, then it is an indication that a trade should be made.
Long Trades: The Stochastic line is above 25 and the momentum line is greater than -25.
Short Trade: The Stochastic line is below -25 and the momentum line is less than 25.
Whilst an actual alert function is not set for the indicator, the TradingView alert function can be used to trigger a message when either the stochastic line or momentum line crosses -25/25 (the key levels).
I've been using this successfully on the one hour FX charts, but seems to work equally as well on higher or lower time frames (not less than 15min).
The other indicators which are part of the suite are shown on the website which is highlighted in my signature at the bottom of the page. Purchase of the main indicator gives access to the full suite of eight indicators. I use the other indicators to confirm the direction of the trade and to determine if I want to trade or not. I use it along with the 2min, 15min and 4hr timeframes to identify the best entry window and how long I'm likely to be in the trade.
Support can be provided via private message or in the comments below.
The links are provided below for access to the indicator.
Profit Accumulator %BB%Bollinger Band Width
This is a support indicator to the Main Indicator which has also been published.
This indicator uses the close of a candle and compares where it is in relation to the upper and lower levels of a Bollinger Band. This is a centred oscillator where anything below the zero line is indicating a short signal and anything above zero is indicating a long signal. The crossing of the zero line is an important point for this indicator.
Whilst an actual alert function is not set for the indicator, the TradingView alert function can be used to trigger a message when the line crosses zero (up or down).
I've been using this successfully on the one hour FX charts, but seems to work equally as well on higher or lower time frames (not less than 15min).
The other indicators which are part of the suite are shown on the website which is highlighted in my signature at the bottom of the page. Purchase of the main indicator gives access to the full suite of eight indicators. I use the other indicators to confirm the direction of the trade and to determine if I want to trade or not. I use it along with the 2min, 15min and 4hr timeframes to identify the best entry window and how long I'm likely to be in the trade.
Support can be provided via private message or in the comments below.
The links are provided below for access to the indicator.
Profit target areaUpdate.
- you can specify count of bars used to detect reversal pattern
- you can specify count of bars used to determine lowest or highest price to place support or resistance
- area between lines is filled by green - ascending, red - descending trend
To trade:
- open position using stop command on S/R
- close position using limit command on retracement line
- close position when background colour indicates trend change
(erratum: last balloon on right should say "buy limit")
DTC - 1.3.6DTC - 1.3.6 Trading Indicator for TradingView
The DTC - 1.3.6 indicator is a powerful, customizable tool designed to enhance your trading experience with dynamic buy/sell signals, sophisticated risk management through stop-loss (SL) and take-profit (TP) levels, multi-timeframe analysis, and visual support and resistance (S/R) zones. Ideal for traders looking to gain more insight into market trends and improve trade entry and exit strategies, this indicator combines trend-following strategies with advanced charting features.
Key Features:
Buy/Sell Signals:
The indicator provides real-time BUY and SELL signals based on a combination of exponential moving averages (EMAs) and volatility filters.
Customizable Alerts: Receive notifications when a trade signal is triggered, ensuring you never miss a trade.
Take-Profit (TP) and Stop-Loss (SL) Management:
Automatically generates 7 levels of take-profit targets and a stop-loss level based on entry price and market volatility.
The indicator dynamically adjusts SL and TP levels based on the current market conditions, providing effective risk management.
Multi-Timeframe Trend Analysis:
Analyze market trends across 5 different timeframes (from hourly to monthly) to gain a broader perspective on market direction.
View trend strength and direction for each timeframe, allowing for a more informed decision-making process.
ATR Volatility Filter:
Use the Average True Range (ATR) to filter signals based on market volatility, ensuring that trades are only taken during favorable market conditions.
Adjustable ATR period and multiplier for finer control over the volatility filter.
Pivot Points and S/R Levels:
Visualize daily support/resistance (S/R) levels using pivot points calculated from the previous day’s price action.
Easily identify key levels where price might reverse or face resistance, helping to optimize entry/exit points.
Risk/Reward Zones:
Visual markers show the entry price, stop-loss, and take-profit targets directly on the chart, with color-coded zones to easily spot potential profit and loss areas.
Green zones for profits and Red zones for losses, helping traders manage positions more effectively.
Customizable Dashboard:
Displays key trading information directly on the chart in a user-friendly table that includes:
Trend Status for multiple timeframes
Unrealized PnL based on current position
ATR Volatility Filter status
EMA Trend Logic:
The trend is calculated based on the alignment of multiple EMAs. A bullish trend is indicated when the EMAs align upwards, and a bearish trend when they align downwards.
Customizable EMA lengths (from 30 to 60 periods) for various strategies.
Ideal for Traders Who:
Want an easy-to-use, all-in-one solution for tracking trends, signals, and price levels.
Need customizable alerts and signals for entry and exit points.
Are looking for automated risk management strategies that adjust to changing market conditions.
Prefer multi-timeframe analysis for a broader perspective on trends and price action.
BOCS Adaptive🚀 BOCS Adaptive - Advanced Dynamic Volatility Breakout Channel System
Enhanced version of AlgoAlpha's Smart Money Breakout Channels with adaptive ATR-based risk management for professional-grade trading signals.
📜 CREDITS & ATTRIBUTION:
This indicator is based on the original "Smart Money Breakout Channels" by AlgoAlpha (). Full credit goes to AlgoAlpha for the innovative breakout channel detection methodology. This enhanced version adds adaptive ATR-based TP/SL functionality and advanced volume analysis features.
🔬 THE BOCS METHODOLOGY EXPLAINED:
What is BOCS?
BOCS (Breakout Channel System) is AlgoAlpha's sophisticated algorithm that identifies high-probability breakout opportunities by analyzing normalized price volatility patterns. Unlike traditional support/resistance methods, BOCS uses mathematical normalization to detect when markets are consolidating before explosive moves.
📊 HOW THE CHANNEL DETECTION WORKS (Original AlgoAlpha Method):
Step 1: Price Normalization
Calculates the highest high and lowest low over a specified period (default 100 bars)
Normalizes current price position within this range: (close - lowest) / (highest - lowest)
This creates a 0-1 scale that works across all markets and timeframes
Step 2: Volatility Analysis
Applies standard deviation to the normalized price over 14 periods
Identifies volatility peaks and troughs using specialized algorithms
Tracks volatility cycles to predict consolidation phases
Step 3: Channel Formation
Detects when volatility crosses from high to low (consolidation begins)
Creates dynamic channels using the highest/lowest points during consolidation
Channels automatically expand/contract based on price action
Minimum 10-bar duration ensures meaningful consolidation patterns
Step 4: Breakout Detection
Strong Closes Mode: Requires >50% of candle body outside channel (reduces false signals from wicks)
Any Touch Mode: Triggers on any price movement outside channel boundaries
Volume confirmation analysis validates breakout strength
🆕 ENHANCED FEATURES (This Version):
⚡ Adaptive ATR Risk Management:
Revolutionary Volatility-Based TP/SL System:
Traditional fixed pip/tick stops don't account for changing market conditions. This enhanced version adds ATR (Average True Range) multipliers to create dynamic TP/SL levels that automatically adjust to current volatility.
ATR Calculation Process:
Select any timeframe for ATR source (1min, 5min, 15min, etc.)
Uses customizable period length (default 14) for smoothing
Calculates: TP Distance = ATR × Multiplier
Updates continuously as market volatility changes
Example Setup:
Chart: 5-minute NQ futures
ATR Source: 1-minute timeframe
Current 1min ATR: 4.36 points
TP1 Multiplier: 2.0 → TP1 = 8.72 points from entry
TP2 Multiplier: 3.5 → TP2 = 15.26 points from entry
SL Multiplier: 1.0 → SL = 4.36 points from entry
📈 ENHANCED VOLUME ANALYSIS SYSTEM:
Three Advanced Volume Modes (Enhanced from Original):
1. Volume Mode:
Displays total volume relative to 20-period moving average
Visual transparency indicates volume strength
Helps identify accumulation/distribution phases
2. Comparison Mode:
Separates up volume (green) vs down volume (red)
Shows buying vs selling pressure within channels
Critical for breakout direction bias
3. Delta Mode:
Calculates net volume delta (up volume - down volume)
Positive delta = buying pressure (above midline)
Negative delta = selling pressure (below midline)
Uses multi-timeframe data for granular analysis
🎯 VOLUME CONFIRMATION ALGORITHM (Enhanced):
Breakout Validation System:
Compares breakout volume to 20-period average
CONFIRMED: Volume >120% of average (strong breakout)
WEAK: Volume 80-120% of average (proceed with caution)
FAILED: Volume <80% of average (likely false breakout)
Volume Gauge Feature (New):
Real-time volume delta visualization
Color-coded pressure indicator (red to green spectrum)
Shows current positioning within high/low volume range
Updates continuously during active channels
📊 COMPREHENSIVE TRADE MONITORING (Enhanced):
Real-Time Analysis Table:
Trade status and direction
Channel formation status
Current ATR value and timeframe
Calculated TP/SL distances with multipliers
Last breakout analysis with volume confirmation
Current vs average volume comparison
Volume strength rating (Very High/High/Normal/Low)
🔔 INTELLIGENT ALERT SYSTEM (Enhanced):
Six Alert Types:
New Channel Formation - Consolidation pattern detected
Bullish Breakout - Upward channel break with entry price
Bearish Breakout - Downward channel break with entry price
Take Profit 1 Hit - First target reached (New)
Take Profit 2 Hit - Second target reached (New)
Stop Loss Hit - Risk management triggered (New)
🎨 VISUAL FEATURES (Enhanced):
Channel Visualization (Original AlgoAlpha Design):
Semi-transparent main channel box
Colored upper/lower zones (red=resistance, green=support)
Dashed center line for reference
Volume bars within channels
Real-time volume gauge (new)
TP/SL Display (New Enhancement):
White entry line with price label
Green TP lines with distance calculations
Red SL line with distance calculation
Customizable line lengths and colors
Shows both price levels AND point distances
⚙️ ADVANCED CUSTOMIZATION (Enhanced):
Original AlgoAlpha Settings:
Nested channels (multiple overlapping) or single channel mode
Strong closes only vs any touch breakouts
Normalization and detection lengths
Volume analysis timeframe selection
New ATR Risk Management Settings:
Independent ATR timeframe selection
Customizable ATR calculation period
Separate multipliers for TP1, TP2, and SL
Toggle TP2 on/off as needed
Enhanced Display Options:
Four table positions with offset controls
Three table sizes (Small/Normal/Large)
Volume text sizing and positioning
Complete color customization
Show/hide individual components
📈 OPTIMAL USE CASES:
Scalping (1-5 minute charts):
Use 1-minute ATR for responsive risk management
Enable strong closes mode for cleaner signals
Monitor volume confirmation closely
Day Trading (5-30 minute charts):
Use 5-minute ATR for balanced approach
Enable nested channels for multiple setups
Focus on volume delta for direction bias
Swing Trading (1-4 hour charts):
Use 15-30 minute ATR for stable levels
Longer detection periods for significant channels
Emphasize volume confirmation for major moves
📊 COMPATIBLE MARKETS:
✅ Forex pairs (EUR/USD, GBP/USD, USD/JPY, etc.)
✅ Stock indices (SPY, QQQ, IWM, DIA)
✅ Futures (ES, NQ, YM, RTY, CL, GC)
✅ Individual stocks (AAPL, TSLA, GOOGL, etc.)
✅ Cryptocurrencies (BTC, ETH, altcoins)
✅ Commodities (Gold, Silver, Oil, etc.)
🙏 ACKNOWLEDGMENTS:
Special thanks to AlgoAlpha for creating the original Smart Money Breakout Channels indicator and sharing it with the TradingView community. Their innovative approach to breakout detection formed the foundation for this enhanced version. Please support the original creator by checking out their other excellent indicators.
⚠️ RISK DISCLAIMER:
This indicator is designed for educational and analytical purposes only. Trading involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results. The BOCS Adaptive system, while sophisticated, should be used as part of a comprehensive trading strategy that includes proper risk management, position sizing, and market analysis. Always conduct your own due diligence and consider consulting with a qualified financial advisor before making trading decisions. No system can guarantee profitable trades, and users should never risk more than they can afford to lose.
ABSS CRYPTO OverlayAdvanced Multi-Layer Market Analysis System for CYPYO markets ONLY
Comprehensive Description:
This advanced trading overlay is designed as a complete market analysis engine tailored to CRPTO trading as the opening and the closing time is considered while designing this system,
It is emphasizing multi-dimensional confirmation and trend validation before trade execution.
The indicator integrates several proprietary layers of market evaluation to deliver a cohesive view of both the prevailing market environment and timely execution signals.
NOTE: THIS INDICATOR IS ESPECIALLY DESIGNED FOR CRYPTO TRADINGVIEW EXCHANGE AND WILL NOT SUPPORT AND WILL NOT BE DISPLAYED IN ANY OTHER EXCHANGES
NOTE: THE CRYPTO EXCHANGE CAN BE CHANGED ON HIS/ HER REQUEST,BUT ONLY ONE EXCHANGE WILL BE SUPPORTED, NO MULTIPLE EXCHAMGE SUPPORT
Functional Layers Explained
Functional Layer "Band":
Comprehensive Description:
The band gives a overall view of the market directions selecting the timeframe one chooses for trading.
Example:
In a 15 min/60 min/75 min/4 hr/etc. chart it gives a overall trend either the market is bullish or bearish.
Macro Trend Visualizer "Trend Background":
Comprehensive Description:
This foundational layer captures the current directional momentum of the market by analyzing price behavior across all crypto markets. It produces a visually distinct shaded region on the chart that dynamically shifts color to signify broad upward or downward market momentum, allowing traders to align with the dominant trend.
In blue background all the bar colors will be plotted blue to avoid making short position.
Trader should always look for buying signals.
In red background all the bar colors will be plotted red to avoid making long position.
Trader should always look for selling signals.
Example:
Buy/Sell Signals:
Comprehensive Description:
Embedded within the broader trend and strength context, this component highlights immediate directional shifts by marking precise points where price momentum changes. It presents clear, actionable signals intended to optimally time entries and exits within the overarching market consensus.
confirmation and how to annalysie the buy sell signal:
1. see the band colour and the overall market direction either bullish or bearish.
2. see the background cloud either bullish or bearish
3. execute and trade on in the direction of with the above two indicators are in same favour. both should be bullish or both should be bearish.
Example:
in this example avaiod buying and concentrate on selling as the band is bearish so wait for the sell signals and trade all sell signals buy signals can be used as exit short positions.
in this example avoid selling and concentrate on buying as the band is bullish so wait for the buy signals and trade all buy signals sell signals can be used as exit long positions.
REBUY AND RESELL AND EXIT SIGNALS
Comprehensive Description:
The small blue and red triangles are plotted to trade in the same trend.so if u have the above band and background color confirmation either bullish or bearish
re enter/ add more positions on the blue / red triangles in the trend confirmed
One can buy/sell in the confirmed trend direction and use the buy / sell triangles to exit the trades on the rebuy / resell triangles
NOTE:
This triangles are more used by traders who needs to trade and capture all small moves helping them with good risk to reward.
Example :
the band is blue and the background is blue
trade setup:
enter on blue triangle and exit on red triangle
the band is red and the background is red
trade setup:
enter on red triangle and exit on blue triangle
for better visualization we have made the bar color indication for the same
example:
Strength Indicator 1 "UPPER BAND DISPLAYED ON THE BOTTOM OF THE CHART"
Comprehensive Description:
Complementing the previous assessment, this layer gauges the continuity and balance of buys and sellers , confirming whether the market is maintaining strength or showing signs of weakening. The analysis of these band of triangles provides crucial insight to HOLD the position until the strength weakens
Example :
how to read this strength:
if the band is blue
if the background is blue
once u take poaition and if the blue triangle gets plots then it gives a indication to hold the markets as there is a huge position built up of buyers and the security is likely to move more in that direction
one can notice if the blue trianges are plotted in the bottom the strenght of the markets going up increases
NOTE:
ONE CANNOT TRADE THESE STRENGHT TRIANGLES WITHOUT HAVING "BAND + BACKGROUND + INERNAL REBUY OR RESELL" CONFIRMATION
ONE CAN ADD MORE POSITION IN THE SAME DIRECTION AND EXIT ONCE THE STRENGHT IS NOT DISPLAYED
BUT FOR BETTER RESULT STRENGHT 2 ( LOWER BAND) CONFIRMATION IS ALSO NEEDED TO HOLD OR TO ADD MORE POSITIONS
THAT IS DISPLAYED IN THE NEXT SLIDE
how to read this strength:
if the band is red
if the background is red
once u take poaition and if the red triangle gets plots then it gives a indication to hold the markets as there is a huge position built up of sellers and the security is likely to move more in that direction
one can notice if the red trianges are plotted in the bottom the strenght of the markets going down increases
NOTE:
ONE CANNOT TRADE THESE STRENGHT TRIANGLES WITHOUT HAVING "BAND + BACKGROUND + INERNAL REBUY OR RESELL" CONFIRMATION
ONE CAN ADD MORE POSITION IN THE SAME DIRECTION AND EXIT ONCE THE STRENGHT IS NOT DISPLAYED
BUT FOR BETTER RESULT STRENGHT 2 ( LOWER BAND) CONFIRMATION IS ALSO NEEDED TO HOLD OR TO ADD MORE POSITIONS
THAT IS DISPLAYED IN THE NEXT SLIDE
Strength Indicator 2 "LOWER BAND DISPLAYED ON THE BOTTOM OF THE STRENGTH 1 "
Comprehensive Description:
This layer assesses the force and conviction behind recent price movements by classifying intensity into bullish, bearish, or neutral categories. It helps the trader to identifty:
"BULLISH STRENGTH" : BY PLOTTING BLUE TRIANGLES BELOW THE STRENGTH 1 BAND
"BEARISH STRENGHT": BY PLOTTING RED TRIANGLES BELOW THE STRENGTH 1 BAND
and the most important
"NO TRADE ZONE" : BY PLOTTING GREY EMPLTY BOXES BELOW THE STRENGTH 1 BAND
Example :
how to read this :
BULLISH VIEW :
band blue
background blue
position bullish
hold the position if both the bands: STRENGHT 1 AND STRENGHT 2 is plotted by blue triangles and EXIT the position or exit a part of your position if one of the two blue triangles is not plotted
Example :
how to read this :
BEARISH VIEW :
band red
background red
position besrish
hold the position if both the bands: STRENGHT 1 AND STRENGHT 2 is plotted by red triangles and EXIT the position or exit a part of your position if one of the two red triangles is not plotted
more examples:
THE BEST IS " NO TRADE ZONE"
Comprehensive Description:
this is the most advanced indication to identify no trade zone and when to take light position or not to enter the trade keeping in mind the two basic confirmation like the band and the background
plus it indicates the fight between buyers and sellers so it helps the trader to avoid choppy markets
Example:
Benefits for Traders
Achieve robust multi-layer confirmation before entering or exiting trades, reducing false signals.
Visual clarity with dynamic background and bar color shading that instantly conveys market sentiment.
Precise entries and exits backed by momentum validation and breakout timing.
Universally applicable in fast-moving Forex and commodities markets, adaptable to various timeframes and trading styles.
This system is ideal for traders seeking a methodical, confirmation-driven trading approach that integrates market direction, momentum force, and breakout precision in a single, intuitive overlay.
NOTE :
FOR DEMO OF THIS CRYPTO INDICATOR MESSAGE US THROUGH TRADINGVIEW MESSAGE SYSTEM OR CAN WHATSAPP ON +919427791936 WHICH THROUGH INVITE ONLY WAY
DEMO FOR 7 DAYS
THIS TRADING SYSTEM WILL ONLY WORK IN TRADINGVIEW CRYPTO EXCHANGE AND IF THE BUY NEEDS ANOTHER EXCHANGE IT WILL BE MODIFIED ON REQUEST
IT WILL NOT RUN ON ANY OTHER EXCHANGE LIKE NSE,BSE,MCX,ETC.........
EACH ECXCHANGE INDIACTORS ARE SAPERATE AND WE DO HAVE INDIVIDUAL EXCHANGE OVERLAYS
DISCLAIMER:
THIS IS A PURE EDUCATIONAL INDICATOR
THE PROFIT AND THE LOSS ACCUMALTED BUY THE BUYER IS SOLE HIS/HER THROUGH INVITE ONLY WAY
THE BUYER OF THIS INDICATORE AGREESES TO THE DISCLAIMER AND THE CREATOR HAS NOTHING TO DO WITH HIS/HER PROFITS OR LOSS ACCUMULATED BUY HIM / HER IN PROFESSINAL TRADING
Institutional Levels (CNN) - [PhenLabs]📊Institutional Levels (Convolutional Neural Network-inspired)
Version : PineScript™v6
📌Description
The CNN-IL Institutional Levels indicator represents a breakthrough in automated zone detection technology, combining convolutional neural network principles with advanced statistical modeling. This sophisticated tool identifies high-probability institutional trading zones by analyzing pivot patterns, volume dynamics, and price behavior using machine learning algorithms.
The indicator employs a proprietary 9-factor logistic regression model that calculates real-time reaction probabilities for each detected zone. By incorporating CNN-inspired filtering techniques and dynamic zone management, it provides traders with unprecedented accuracy in identifying where institutional money is likely to react to price action.
🚀Points of Innovation
● CNN-Inspired Pivot Analysis - Advanced binning system using convolutional neural network principles for superior pattern recognition
● Real-Time Probability Engine - Live reaction probability calculations using 9-factor logistic regression model
● Dynamic Zone Intelligence - Automatic zone merging using Intersection over Union (IoU) algorithms
● Volume-Weighted Scoring - Time-of-day volume Z-score analysis for enhanced zone strength assessment
● Adaptive Decay System - Intelligent zone lifecycle management based on touch frequency and recency
● Multi-Filter Architecture - Optional gradient, smoothing, and Difference of Gaussians (DoG) convolution filters
🔧Core Components
● Pivot Detection Engine - Advanced pivot identification with configurable left/right bars and ATR-normalized strength calculations
● Neural Network Binning - Price level clustering using CNN-inspired algorithms with ATR-based bin sizing
● Logistic Regression Model - 9-factor probability calculation including distance, width, volume, VWAP deviation, and trend analysis
● Zone Management System - Intelligent creation, merging, and decay algorithms for optimal zone lifecycle control
● Visualization Layer - Dynamic line drawing with opacity-based scoring and optional zone fills
🔥Key Features
● High-Probability Zone Detection - Automatically identifies institutional levels with reaction probabilities above configurable thresholds
● Real-Time Probability Scoring - Live calculation of zone reaction likelihood using advanced statistical modeling
● Session-Aware Analysis - Optional filtering to specific trading sessions for enhanced accuracy during active market hours
● Customizable Parameters - Full control over lookback periods, zone sensitivity, merge thresholds, and probability models
● Performance Optimized - Efficient processing with controlled update frequencies and pivot processing limits
● Non-Repainting Mode - Strict mode available for backtesting accuracy and live trading reliability
🎨Visualization
● Dynamic Zone Lines - Color-coded support and resistance levels with opacity reflecting zone strength and confidence scores
● Probability Labels - Real-time display of reaction probabilities, touch counts, and historical hit rates for active zones
● Zone Fills - Optional semi-transparent zone highlighting for enhanced visual clarity and immediate pattern recognition
● Adaptive Styling - Automatic color and opacity adjustments based on zone scoring and statistical significance
📖Usage Guidelines
● Lookback Bars - Default 500, Range 100-1000, Controls the historical data window for pivot analysis and zone calculation
● Pivot Left/Right - Default 3, Range 1-10, Defines the pivot detection sensitivity and confirmation requirements
● Bin Size ATR units - Default 0.25, Range 0.1-2.0, Controls price level clustering granularity for zone creation
● Base Zone Half-Width ATR units - Default 0.25, Range 0.1-1.0, Sets the minimum zone width in ATR units for institutional level boundaries
● Zone Merge IoU Threshold - Default 0.5, Range 0.1-0.9, Intersection over Union threshold for automatic zone merging algorithms
● Max Active Zones - Default 5, Range 3-20, Maximum number of zones displayed simultaneously to prevent chart clutter
● Probability Threshold for Labels - Default 0.6, Range 0.3-0.9, Minimum reaction probability required for zone label display and alerts
● Distance Weight w1 - Controls influence of price distance from zone center on reaction probability
● Width Weight w2 - Adjusts impact of zone width on probability calculations
● Volume Weight w3 - Modifies volume Z-score influence on zone strength assessment
● VWAP Weight w4 - Controls VWAP deviation impact on institutional level significance
● Touch Count Weight w5 - Adjusts influence of historical zone interactions on probability scoring
● Hit Rate Weight w6 - Controls prior success rate impact on future reaction likelihood predictions
● Wick Penetration Weight w7 - Modifies wick penetration analysis influence on probability calculations
● Trend Weight w8 - Adjusts trend context impact using ADX analysis for directional bias assessment
✅Best Use Cases
● Swing Trading Entries - Enter positions at high-probability institutional zones with 60%+ reaction scores
● Scalping Opportunities - Quick entries and exits around frequently tested institutional levels
● Risk Management - Use zones as dynamic stop-loss and take-profit levels based on institutional behavior
● Market Structure Analysis - Identify key institutional levels that define current market structure and sentiment
● Confluence Trading - Combine with other technical indicators for high-probability trade setups
● Session-Based Strategies - Focus analysis during high-volume sessions for maximum effectiveness
⚠️Limitations
● Historical Pattern Dependency - Algorithm effectiveness relies on historical patterns that may not repeat in changing market conditions
● Computational Intensity - Complex calculations may impact chart performance on lower-end devices or with multiple indicators
● Probability Estimates - Reaction probabilities are statistical estimates and do not guarantee actual market outcomes
● Session Sensitivity - Performance may vary significantly between different market sessions and volatility regimes
● Parameter Sensitivity - Results can be highly dependent on input parameters requiring optimization for different instruments
💡What Makes This Unique
● CNN Architecture - First indicator to apply convolutional neural network principles to institutional-level detection
● Real-Time ML Scoring - Live machine learning probability calculations for each zone interaction
● Advanced Zone Management - Sophisticated algorithms for zone lifecycle management and automatic optimization
● Statistical Rigor - Comprehensive 9-factor logistic regression model with extensive backtesting validation
● Performance Optimization - Efficient processing algorithms designed for real-time trading applications
🔬How It Works
● Multi-timeframe pivot identification - Uses configurable sensitivity parameters for advanced pivot detection
● ATR-normalized strength calculations - Standardizes pivot significance across different volatility regimes
● Volume Z-score integration - Enhanced pivot weighting based on time-of-day volume patterns
● Price level clustering - Neural network binning algorithms with ATR-based sizing for zone creation
● Recency decay applications - Weights recent pivots more heavily than historical data for relevance
● Statistical filtering - Eliminates low-significance price levels and reduces market noise
● Dynamic zone generation - Creates zones from statistically significant pivot clusters with minimum support thresholds
● IoU-based merging algorithms - Combines overlapping zones while maintaining accuracy using Intersection over Union
● Adaptive decay systems - Automatic removal of outdated or low-performing zones for optimal performance
● 9-factor logistic regression - Incorporates distance, width, volume, VWAP, touch history, and trend analysis
● Real-time scoring updates - Zone interaction calculations with configurable threshold filtering
● Optional CNN filters - Gradient detection, smoothing, and Difference of Gaussians processing for enhanced accuracy
💡Note
This indicator represents advanced quantitative analysis and should be used by traders familiar with statistical modeling concepts. The probability scores are mathematical estimates based on historical patterns and should be combined with proper risk management and additional technical analysis for optimal trading decisions.
AlgoPilotX - Breakout & Breakdown MeterThe AlgoPilotX – Breakout & Breakdown Meter is a trader’s tool that detects Fair Value Gaps (FVGs) , highlights pullback confirmations , and plots breakouts above resistance or breakdowns below support.
It also includes a market condition info panel with RSI, MACD, Bollinger Bands, and EMA signals so you can quickly gauge momentum, trend, and overbought/oversold conditions.
This makes it ideal for traders who want to catch strong breakouts early while still keeping track of trend context .
📘 How to Use
1. Use on 15m timeframe by default (adjustable).
2. The first session candle sets support and resistance .
3. Watch for arrows :
Light green arrow (▲) below candle → Potential breakout long entry (Fair Value Gap detected).
Dark green arrow (▲) below candle → Strong breakout confirmation after pullback.
Light red arrow (▼) above candle → Potential breakdown short entry (Fair Value Gap detected).
Dark red arrow (▼) above candle → Strong breakdown confirmation after pullback.
Larger arrows = higher confidence signals.
4. Use the Info Panel for quick market context:
RSI → momentum direction.
MACD → trend confirmation.
Bollinger Bands → overbought/oversold conditions.
EMA 20 & EMA 50 → trend bias.
5. Combine with your own price action, volume, or risk management before executing trades.
⚠️ Disclaimer
This indicator is designed as a technical analysis tool . It does not provide financial advice and does not guarantee profitable trades. Always backtest, paper trade, and use proper risk management before live trading.
MAX TRADEAuto signal generation with high accuracy
Risk/Reward calculation built-in
Stop Loss and Take Profit levels displayed on the chart
Customizable sensitivity and settings
Works on Forex, Gold (XAU/USD), Crypto, and other assets
Backtesting & Trading Engine [PineCoders]The PineCoders Backtesting and Trading Engine is a sophisticated framework with hybrid code that can run as a study to generate alerts for automated or discretionary trading while simultaneously providing backtest results. It can also easily be converted to a TradingView strategy in order to run TV backtesting. The Engine comes with many built-in strats for entries, filters, stops and exits, but you can also add you own.
If, like any self-respecting strategy modeler should, you spend a reasonable amount of time constantly researching new strategies and tinkering, our hope is that the Engine will become your inseparable go-to tool to test the validity of your creations, as once your tests are conclusive, you will be able to run this code as a study to generate the alerts required to put it in real-world use, whether for discretionary trading or to interface with an execution bot/app. You may also find the backtesting results the Engine produces in study mode enough for your needs and spend most of your time there, only occasionally converting to strategy mode in order to backtest using TV backtesting.
As you will quickly grasp when you bring up this script’s Settings, this is a complex tool. While you will be able to see results very quickly by just putting it on a chart and using its built-in strategies, in order to reap the full benefits of the PineCoders Engine, you will need to invest the time required to understand the subtleties involved in putting all its potential into play.
Disclaimer: use the Engine at your own risk.
Before we delve in more detail, here’s a bird’s eye view of the Engine’s features:
More than 40 built-in strategies,
Customizable components,
Coupling with your own external indicator,
Simple conversion from Study to Strategy modes,
Post-Exit analysis to search for alternate trade outcomes,
Use of the Data Window to show detailed bar by bar trade information and global statistics, including some not provided by TV backtesting,
Plotting of reminders and generation of alerts on in-trade events.
By combining your own strats to the built-in strats supplied with the Engine, and then tuning the numerous options and parameters in the Inputs dialog box, you will be able to play what-if scenarios from an infinite number of permutations.
USE CASES
You have written an indicator that provides an entry strat but it’s missing other components like a filter and a stop strategy. You add a plot in your indicator that respects the Engine’s External Signal Protocol, connect it to the Engine by simply selecting your indicator’s plot name in the Engine’s Settings/Inputs and then run tests on different combinations of entry stops, in-trade stops and profit taking strats to find out which one produces the best results with your entry strat.
You are building a complex strategy that you will want to run as an indicator generating alerts to be sent to a third-party execution bot. You insert your code in the Engine’s modules and leverage its trade management code to quickly move your strategy into production.
You have many different filters and want to explore results using them separately or in combination. Integrate the filter code in the Engine and run through different permutations or hook up your filtering through the external input and control your filter combos from your indicator.
You are tweaking the parameters of your entry, filter or stop strat. You integrate it in the Engine and evaluate its performance using the Engine’s statistics.
You always wondered what results a random entry strat would yield on your markets. You use the Engine’s built-in random entry strat and test it using different combinations of filters, stop and exit strats.
You want to evaluate the impact of fees and slippage on your strategy. You use the Engine’s inputs to play with different values and get immediate feedback in the detailed numbers provided in the Data Window.
You just want to inspect the individual trades your strategy generates. You include it in the Engine and then inspect trades visually on your charts, looking at the numbers in the Data Window as you move your cursor around.
You have never written a production-grade strategy and you want to learn how. Inspect the code in the Engine; you will find essential components typical of what is being used in actual trading systems.
You have run your system for a while and have compiled actual slippage information and your broker/exchange has updated his fees schedule. You enter the information in the Engine and run it on your markets to see the impact this has on your results.
FEATURES
Before going into the detail of the Inputs and the Data Window numbers, here’s a more detailed overview of the Engine’s features.
Built-in strats
The engine comes with more than 40 pre-coded strategies for the following standard system components:
Entries,
Filters,
Entry stops,
2 stage in-trade stops with kick-in rules,
Pyramiding rules,
Hard exits.
While some of the filter and stop strats provided may be useful in production-quality systems, you will not devise crazy profit-generating systems using only the entry strats supplied; that part is still up to you, as will be finding the elusive combination of components that makes winning systems. The Engine will, however, provide you with a solid foundation where all the trade management nitty-gritty is handled for you. By binding your custom strats to the Engine, you will be able to build reliable systems of the best quality currently allowed on the TV platform.
On-chart trade information
As you move over the bars in a trade, you will see trade numbers in the Data Window change at each bar. The engine calculates the P&L at every bar, including slippage and fees that would be incurred were the trade exited at that bar’s close. If the trade includes pyramided entries, those will be taken into account as well, although for those, final fees and slippage are only calculated at the trade’s exit.
You can also see on-chart markers for the entry level, stop positions, in-trade special events and entries/exits (you will want to disable these when using the Engine in strategy mode to see TV backtesting results).
Customization
You can couple your own strats to the Engine in two ways:
1. By inserting your own code in the Engine’s different modules. The modular design should enable you to do so with minimal effort by following the instructions in the code.
2. By linking an external indicator to the engine. After making the proper selections in the engine’s Settings and providing values respecting the engine’s protocol, your external indicator can, when the Engine is used in Indicator mode only:
Tell the engine when to enter long or short trades, but let the engine’s in-trade stop and exit strats manage the exits,
Signal both entries and exits,
Provide an entry stop along with your entry signal,
Filter other entry signals generated by any of the engine’s entry strats.
Conversion from strategy to study
TradingView strategies are required to backtest using the TradingView backtesting feature, but if you want to generate alerts with your script, whether for automated trading or just to trigger alerts that you will use in discretionary trading, your code has to run as a study since, for the time being, strategies can’t generate alerts. From hereon we will use indicator as a synonym for study.
Unless you want to maintain two code bases, you will need hybrid code that easily flips between strategy and indicator modes, and your code will need to restrict its use of strategy() calls and their arguments if it’s going to be able to run both as an indicator and a strategy using the same trade logic. That’s one of the benefits of using this Engine. Once you will have entered your own strats in the Engine, it will be a matter of commenting/uncommenting only four lines of code to flip between indicator and strategy modes in a matter of seconds.
Additionally, even when running in Indicator mode, the Engine will still provide you with precious numbers on your individual trades and global results, some of which are not available with normal TradingView backtesting.
Post-Exit Analysis for alternate outcomes (PEA)
While typical backtesting shows results of trade outcomes, PEA focuses on what could have happened after the exit. The intention is to help traders get an idea of the opportunity/risk in the bars following the trade in order to evaluate if their exit strategies are too aggressive or conservative.
After a trade is exited, the Engine’s PEA module continues analyzing outcomes for a user-defined quantity of bars. It identifies the maximum opportunity and risk available in that space, and calculates the drawdown required to reach the highest opportunity level post-exit, while recording the number of bars to that point.
Typically, if you can’t find opportunity greater than 1X past your trade using a few different reasonable lengths of PEA, your strategy is doing pretty good at capturing opportunity. Remember that 100% of opportunity is never capturable. If, however, PEA was finding post-trade maximum opportunity of 3 or 4X with average drawdowns of 0.3 to those areas, this could be a clue revealing your system is exiting trades prematurely. To analyze PEA numbers, you can uncomment complete sets of plots in the Plot module to reveal detailed global and individual PEA numbers.
Statistics
The Engine provides stats on your trades that TV backtesting does not provide, such as:
Average Profitability Per Trade (APPT), aka statistical expectancy, a crucial value.
APPT per bar,
Average stop size,
Traded volume .
It also shows you on a trade-by-trade basis, on-going individual trade results and data.
In-trade events
In-trade events can plot reminders and trigger alerts when they occur. The built-in events are:
Price approaching stop,
Possible tops/bottoms,
Large stop movement (for discretionary trading where stop is moved manually),
Large price movements.
Slippage and Fees
Even when running in indicator mode, the Engine allows for slippage and fees to be included in the logic and test results.
Alerts
The alert creation mechanism allows you to configure alerts on any combination of the normal or pyramided entries, exits and in-trade events.
Backtesting results
A few words on the numbers calculated in the Engine. Priority is given to numbers not shown in TV backtesting, as you can readily convert the script to a strategy if you need them.
We have chosen to focus on numbers expressing results relative to X (the trade’s risk) rather than in absolute currency numbers or in other more conventional but less useful ways. For example, most of the individual trade results are not shown in percentages, as this unit of measure is often less meaningful than those expressed in units of risk (X). A trade that closes with a +25% result, for example, is a poor outcome if it was entered with a -50% stop. Expressed in X, this trade’s P&L becomes 0.5, which provides much better insight into the trade’s outcome. A trade that closes with a P&L of +2X has earned twice the risk incurred upon entry, which would represent a pre-trade risk:reward ratio of 2.
The way to go about it when you think in X’s and that you adopt the sound risk management policy to risk a fixed percentage of your account on each trade is to equate a currency value to a unit of X. E.g. your account is 10K USD and you decide you will risk a maximum of 1% of it on each trade. That means your unit of X for each trade is worth 100 USD. If your APPT is 2X, this means every time you risk 100 USD in a trade, you can expect to make, on average, 200 USD.
By presenting results this way, we hope that the Engine’s statistics will appeal to those cognisant of sound risk management strategies, while gently leading traders who aren’t, towards them.
We trade to turn in tangible profits of course, so at some point currency must come into play. Accordingly, some values such as equity, P&L, slippage and fees are expressed in currency.
Many of the usual numbers shown in TV backtests are nonetheless available, but they have been commented out in the Engine’s Plot module.
Position sizing and risk management
All good system designers understand that optimal risk management is at the very heart of all winning strategies. The risk in a trade is defined by the fraction of current equity represented by the amplitude of the stop, so in order to manage risk optimally on each trade, position size should adjust to the stop’s amplitude. Systems that enter trades with a fixed stop amplitude can get away with calculating position size as a fixed percentage of current equity. In the context of a test run where equity varies, what represents a fixed amount of risk translates into different currency values.
Dynamically adjusting position size throughout a system’s life is optimal in many ways. First, as position sizing will vary with current equity, it reproduces a behavioral pattern common to experienced traders, who will dial down risk when confronted to poor performance and increase it when performance improves. Second, limiting risk confers more predictability to statistical test results. Third, position sizing isn’t just about managing risk, it’s also about maximizing opportunity. By using the maximum leverage (no reference to trading on margin here) into the trade that your risk management strategy allows, a dynamic position size allows you to capture maximal opportunity.
To calculate position sizes using the fixed risk method, we use the following formula: Position = Account * MaxRisk% / Stop% [, which calculates a position size taking into account the trade’s entry stop so that if the trade is stopped out, 100 USD will be lost. For someone who manages risk this way, common instructions to invest a certain percentage of your account in a position are simply worthless, as they do not take into account the risk incurred in the trade.
The Engine lets you select either the fixed risk or fixed percentage of equity position sizing methods. The closest thing to dynamic position sizing that can currently be done with alerts is to use a bot that allows syntax to specify position size as a percentage of equity which, while being dynamic in the sense that it will adapt to current equity when the trade is entered, does not allow us to modulate position size using the stop’s amplitude. Changes to alerts are on the way which should solve this problem.
In order for you to simulate performance with the constraint of fixed position sizing, the Engine also offers a third, less preferable option, where position size is defined as a fixed percentage of initial capital so that it is constant throughout the test and will thus represent a varying proportion of current equity.
Let’s recap. The three position sizing methods the Engine offers are:
1. By specifying the maximum percentage of risk to incur on your remaining equity, so the Engine will dynamically adjust position size for each trade so that, combining the stop’s amplitude with position size will yield a fixed percentage of risk incurred on current equity,
2. By specifying a fixed percentage of remaining equity. Note that unless your system has a fixed stop at entry, this method will not provide maximal risk control, as risk will vary with the amplitude of the stop for every trade. This method, as the first, does however have the advantage of automatically adjusting position size to equity. It is the Engine’s default method because it has an equivalent in TV backtesting, so when flipping between indicator and strategy mode, test results will more or less correspond.
3. By specifying a fixed percentage of the Initial Capital. While this is the least preferable method, it nonetheless reflects the reality confronted by most system designers on TradingView today. In this case, risk varies both because the fixed position size in initial capital currency represents a varying percentage of remaining equity, and because the trade’s stop amplitude may vary, adding another variability vector to risk.
Note that the Engine cannot display equity results for strategies entering trades for a fixed amount of shares/contracts at a variable price.
SETTINGS/INPUTS
Because the initial text first published with a script cannot be edited later and because there are just too many options, the Engine’s Inputs will not be covered in minute detail, as they will most certainly evolve. We will go over them with broad strokes; you should be able to figure the rest out. If you have questions, just ask them here or in the PineCoders Telegram group.
Display
The display header’s checkbox does nothing.
For the moment, only one exit strategy uses a take profit level, so only that one will show information when checking “Show Take Profit Level”.
Entries
You can activate two simultaneous entry strats, each selected from the same set of strats contained in the Engine. If you select two and they fire simultaneously, the main strat’s signal will be used.
The random strat in each list uses a different seed, so you will get different results from each.
The “Filter transitions” and “Filter states” strats delegate signal generation to the selected filter(s). “Filter transitions” signals will only fire when the filter transitions into bull/bear state, so after a trade is stopped out, the next entry may take some time to trigger if the filter’s state does not change quickly. When you choose “Filter states”, then a new trade will be entered immediately after an exit in the direction the filter allows.
If you select “External Indicator”, your indicator will need to generate a +2/-2 (or a positive/negative stop value) to enter a long/short position, providing the selected filters allow for it. If you wish to use the Engine’s capacity to also derive the entry stop level from your indicator’s signal, then you must explicitly choose this option in the Entry Stops section.
Filters
You can activate as many filters as you wish; they are additive. The “Maximum stop allowed on entry” is an important component of proper risk management. If your system has an average 3% stop size and you need to trade using fixed position sizes because of alert/execution bot limitations, you must use this filter because if your system was to enter a trade with a 15% stop, that trade would incur 5 times the normal risk, and its result would account for an abnormally high proportion in your system’s performance.
Remember that any filter can also be used as an entry signal, either when it changes states, or whenever no trade is active and the filter is in a bull or bear mode.
Entry Stops
An entry stop must be selected in the Engine, as it requires a stop level before the in-trade stop is calculated. Until the selected in-trade stop strat generates a stop that comes closer to price than the entry stop (or respects another one of the in-trade stops kick in strats), the entry stop level is used.
It is here that you must select “External Indicator” if your indicator supplies a +price/-price value to be used as the entry stop. A +price is expected for a long entry and a -price value will enter a short with a stop at price. Note that the price is the absolute price, not an offset to the current price level.
In-Trade Stops
The Engine comes with many built-in in-trade stop strats. Note that some of them share the “Length” and “Multiple” field, so when you swap between them, be sure that the length and multiple in use correspond to what you want for that stop strat. Suggested defaults appear with the name of each strat in the dropdown.
In addition to the strat you wish to use, you must also determine when it kicks in to replace the initial entry’s stop, which is determined using different strats. For strats where you can define a positive or negative multiple of X, percentage or fixed value for a kick-in strat, a positive value is above the trade’s entry fill and a negative one below. A value of zero represents breakeven.
Pyramiding
What you specify in this section are the rules that allow pyramiding to happen. By themselves, these rules will not generate pyramiding entries. For those to happen, entry signals must be issued by one of the active entry strats, and conform to the pyramiding rules which act as a filter for them. The “Filter must allow entry” selection must be chosen if you want the usual system’s filters to act as additional filtering criteria for your pyramided entries.
Hard Exits
You can choose from a variety of hard exit strats. Hard exits are exit strategies which signal trade exits on specific events, as opposed to price breaching a stop level in In-Trade Stops strategies. They are self-explanatory. The last one labelled When Take Profit Level (multiple of X) is reached is the only one that uses a level, but contrary to stops, it is above price and while it is relative because it is expressed as a multiple of X, it does not move during the trade. This is the level called Take Profit that is show when the “Show Take Profit Level” checkbox is checked in the Display section.
While stops focus on managing risk, hard exit strategies try to put the emphasis on capturing opportunity.
Slippage
You can define it as a percentage or a fixed value, with different settings for entries and exits. The entry and exit markers on the chart show the impact of slippage on the entry price (the fill).
Fees
Fees, whether expressed as a percentage of position size in and out of the trade or as a fixed value per in and out, are in the same units of currency as the capital defined in the Position Sizing section. Fees being deducted from your Capital, they do not have an impact on the chart marker positions.
In-Trade Events
These events will only trigger during trades. They can be helpful to act as reminders for traders using the Engine as assistance to discretionary trading.
Post-Exit Analysis
It is normally on. Some of its results will show in the Global Numbers section of the Data Window. Only a few of the statistics generated are shown; many more are available, but commented out in the Plot module.
Date Range Filtering
Note that you don’t have to change the dates to enable/diable filtering. When you are done with a specific date range, just uncheck “Date Range Filtering” to disable date filtering.
Alert Triggers
Each selection corresponds to one condition. Conditions can be combined into a single alert as you please. Just be sure you have selected the ones you want to trigger the alert before you create the alert. For example, if you trade in both directions and you want a single alert to trigger on both types of exits, you must select both “Long Exit” and “Short Exit” before creating your alert.
Once the alert is triggered, these settings no longer have relevance as they have been saved with the alert.
When viewing charts where an alert has just triggered, if your alert triggers on more than one condition, you will need the appropriate markers active on your chart to figure out which condition triggered the alert, since plotting of markers is independent of alert management.
Position sizing
You have 3 options to determine position size:
1. Proportional to Stop -> Variable, with a cap on size.
2. Percentage of equity -> Variable.
3. Percentage of Initial Capital -> Fixed.
External Indicator
This is where you connect your indicator’s plot that will generate the signals the Engine will act upon. Remember this only works in Indicator mode.
DATA WINDOW INFORMATION
The top part of the window contains global numbers while the individual trade information appears in the bottom part. The different types of units used to express values are:
curr: denotes the currency used in the Position Sizing section of Inputs for the Initial Capital value.
quote: denotes quote currency, i.e. the value the instrument is expressed in, or the right side of the market pair (USD in EURUSD ).
X: the stop’s amplitude, itself expressed in quote currency, which we use to express a trade’s P&L, so that a trade with P&L=2X has made twice the stop’s amplitude in profit. This is sometimes referred to as R, since it represents one unit of risk. It is also the unit of measure used in the APPT, which denotes expected reward per unit of risk.
X%: is also the stop’s amplitude, but expressed as a percentage of the Entry Fill.
The numbers appearing in the Data Window are all prefixed:
“ALL:” the number is the average for all first entries and pyramided entries.
”1ST:” the number is for first entries only.
”PYR:” the number is for pyramided entries only.
”PEA:” the number is for Post-Exit Analyses
Global Numbers
Numbers in this section represent the results of all trades up to the cursor on the chart.
Average Profitability Per Trade (X): This value is the most important gauge of your strat’s worthiness. It represents the returns that can be expected from your strat for each unit of risk incurred. E.g.: your APPT is 2.0, thus for every unit of currency you invest in a trade, you can on average expect to obtain 2 after the trade. APPT is also referred to as “statistical expectancy”. If it is negative, your strategy is losing, even if your win rate is very good (it means your winning trades aren’t winning enough, or your losing trades lose too much, or both). Its counterpart in currency is also shown, as is the APPT/bar, which can be a useful gauge in deciding between rivalling systems.
Profit Factor: Gross of winning trades/Gross of losing trades. Strategy is profitable when >1. Not as useful as the APPT because it doesn’t take into account the win rate and the average win/loss per trade. It is calculated from the total winning/losing results of this particular backtest and has less predictive value than the APPT. A good profit factor together with a poor APPT means you just found a chart where your system outperformed. Relying too much on the profit factor is a bit like a poker player who would think going all in with two’s against aces is optimal because he just won a hand that way.
Win Rate: Percentage of winning trades out of all trades. Taken alone, it doesn’t have much to do with strategy profitability. You can have a win rate of 99% but if that one trade in 100 ruins you because of poor risk management, 99% doesn’t look so good anymore. This number speaks more of the system’s profile than its worthiness. Still, it can be useful to gauge if the system fits your personality. It can also be useful to traders intending to sell their systems, as low win rate systems are more difficult to sell and require more handholding of worried customers.
Equity (curr): This the sum of initial capital and the P&L of your system’s trades, including fees and slippage.
Return on Capital is the equivalent of TV’s Net Profit figure, i.e. the variation on your initial capital.
Maximum drawdown is the maximal drawdown from the highest equity point until the drop . There is also a close to close (meaning it doesn’t take into account in-trade variations) maximum drawdown value commented out in the code.
The next values are self-explanatory, until:
PYR: Avg Profitability Per Entry (X): this is the APPT for all pyramided entries.
PEA: Avg Max Opp . Available (X): the average maximal opportunity found in the Post-Exit Analyses.
PEA: Avg Drawdown to Max Opp . (X): this represents the maximum drawdown (incurred from the close at the beginning of the PEA analysis) required to reach the maximal opportunity point.
Trade Information
Numbers in this section concern only the current trade under the cursor. Most of them are self-explanatory. Use the description’s prefix to determine what the values applies to.
PYR: Avg Profitability Per Entry (X): While this value includes the impact of all current pyramided entries (and only those) and updates when you move your cursor around, P&L only reflects fees at the trade’s last bar.
PEA: Max Opp . Available (X): It’s the most profitable close reached post-trade, measured from the trade’s Exit Fill, expressed in the X value of the trade the PEA follows.
PEA: Drawdown to Max Opp . (X): This is the maximum drawdown from the trade’s Exit Fill that needs to be sustained in order to reach the maximum opportunity point, also expressed in X. Note that PEA numbers do not include slippage and fees.
EXTERNAL SIGNAL PROTOCOL
Only one external indicator can be connected to a script; in order to leverage its use to the fullest, the engine provides options to use it as either an entry signal, an entry/exit signal or a filter. When used as an entry signal, you can also use the signal to provide the entry’s stop. Here’s how this works:
For filter state: supply +1 for bull (long entries allowed), -1 for bear (short entries allowed).
For entry signals: supply +2 for long, -2 for short.
For exit signals: supply +3 for exit from long, -3 for exit from short.
To send an entry stop level with an entry signal: Send positive stop level for long entry (e.g. 103.33 to enter a long with a stop at 103.33), negative stop level for short entry (e.g. -103.33 to enter a short with a stop at 103.33). If you use this feature, your indicator will have to check for exact stop levels of 1.0, 2.0 or 3.0 and their negative counterparts, and fudge them with a tick in order to avoid confusion with other signals in the protocol.
Remember that mere generation of the values by your indicator will have no effect until you explicitly allow their use in the appropriate sections of the Engine’s Settings/Inputs.
An example of a script issuing a signal for the Engine is published by PineCoders.
RECOMMENDATIONS TO ASPIRING SYSTEM DESIGNERS
Stick to higher timeframes. On progressively lower timeframes, margins decrease and fees and slippage take a proportionally larger portion of profits, to the point where they can very easily turn a profitable strategy into a losing one. Additionally, your margin for error shrinks as the equilibrium of your system’s profitability becomes more fragile with the tight numbers involved in the shorter time frames. Avoid <1H time frames.
Know and calculate fees and slippage. To avoid market shock, backtest using conservative fees and slippage parameters. Systems rarely show unexpectedly good returns when they are confronted to the markets, so put all chances on your side by being outrageously conservative—or a the very least, realistic. Test results that do not include fees and slippage are worthless. Slippage is there for a reason, and that’s because our interventions in the market change the market. It is easier to find alpha in illiquid markets such as cryptos because not many large players participate in them. If your backtesting results are based on moving large positions and you don’t also add the inevitable slippage that will occur when you enter/exit thin markets, your backtesting will produce unrealistic results. Even if you do include large slippage in your settings, the Engine can only do so much as it will not let slippage push fills past the high or low of the entry bar, but the gap may be much larger in illiquid markets.
Never test and optimize your system on the same dataset , as that is the perfect recipe for overfitting or data dredging, which is trying to find one precise set of rules/parameters that works only on one dataset. These setups are the most fragile and often get destroyed when they meet the real world.
Try to find datasets yielding more than 100 trades. Less than that and results are not as reliable.
Consider all backtesting results with suspicion. If you never entertained sceptic tendencies, now is the time to begin. If your backtest results look really good, assume they are flawed, either because of your methodology, the data you’re using or the software doing the testing. Always assume the worse and learn proper backtesting techniques such as monte carlo simulations and walk forward analysis to avoid the traps and biases that unchecked greed will set for you. If you are not familiar with concepts such as survivor bias, lookahead bias and confirmation bias, learn about them.
Stick to simple bars or candles when designing systems. Other types of bars often do not yield reliable results, whether by design (Heikin Ashi) or because of the way they are implemented on TV (Renko bars).
Know that you don’t know and use that knowledge to learn more about systems and how to properly test them, about your biases, and about yourself.
Manage risk first , then capture opportunity.
Respect the inherent uncertainty of the future. Cleanse yourself of the sad arrogance and unchecked greed common to newcomers to trading. Strive for rationality. Respect the fact that while backtest results may look promising, there is no guarantee they will repeat in the future (there is actually a high probability they won’t!), because the future is fundamentally unknowable. If you develop a system that looks promising, don’t oversell it to others whose greed may lead them to entertain unreasonable expectations.
Have a plan. Understand what king of trading system you are trying to build. Have a clear picture or where entries, exits and other important levels will be in the sort of trade you are trying to create with your system. This stated direction will help you discard more efficiently many of the inevitably useless ideas that will pop up during system design.
Be wary of complexity. Experienced systems engineers understand how rapidly complexity builds when you assemble components together—however simple each one may be. The more complex your system, the more difficult it will be to manage.
Play! . Allow yourself time to play around when you design your systems. While much comes about from working with a purpose, great ideas sometimes come out of just trying things with no set goal, when you are stuck and don’t know how to move ahead. Have fun!
@LucF
NOTES
While the engine’s code can supply multiple consecutive entries of longs or shorts in order to scale positions (pyramid), all exits currently assume the execution bot will exit the totality of the position. No partial exits are currently possible with the Engine.
Because the Engine is literally crippled by the limitations on the number of plots a script can output on TV; it can only show a fraction of all the information it calculates in the Data Window. You will find in the Plot Module vast amounts of commented out lines that you can activate if you also disable an equivalent number of other plots. This may be useful to explore certain characteristics of your system in more detail.
When backtesting using the TV backtesting feature, you will need to provide the strategy parameters you wish to use through either Settings/Properties or by changing the default values in the code’s header. These values are defined in variables and used not only in the strategy() statement, but also as defaults in the Engine’s relevant Inputs.
If you want to test using pyramiding, then both the strategy’s Setting/Properties and the Engine’s Settings/Inputs need to allow pyramiding.
If you find any bugs in the Engine, please let us know.
THANKS
To @glaz for allowing the use of his unpublished MA Squize in the filters.
To @everget for his Chandelier stop code, which is also used as a filter in the Engine.
To @RicardoSantos for his pseudo-random generator, and because it’s from him that I first read in the Pine chat about the idea of using an external indicator as input into another. In the PineCoders group, @theheirophant then mentioned the idea of using it as a buy/sell signal and @simpelyfe showed a piece of code implementing the idea. That’s the tortuous story behind the use of the external indicator in the Engine.
To @admin for the Volatility stop’s original code and for the donchian function lifted from Ichimoku .
To @BobHoward21 for the v3 version of Volatility Stop .
To @scarf and @midtownsk8rguy for the color tuning.
To many other scripters who provided encouragement and suggestions for improvement during the long process of writing and testing this piece of code.
To J. Welles Wilder Jr. for ATR, used extensively throughout the Engine.
To TradingView for graciously making an account available to PineCoders.
And finally, to all fellow PineCoders for the constant intellectual stimulation; it is a privilege to share ideas with you all. The Engine is for all TradingView PineCoders, of course—but especially for you.
Look first. Then leap.