Long/Short/Exit/Risk management Strategy # LongShortExit Strategy Documentation
## Overview
The LongShortExit strategy is a versatile trading system for TradingView that provides complete control over entry, exit, and risk management parameters. It features a sophisticated framework for managing long and short positions with customizable profit targets, stop-loss mechanisms, partial profit-taking, and trailing stops. The strategy can be enhanced with continuous position signals for visual feedback on the current trading state.
## Key Features
### General Settings
- **Trading Direction**: Choose to trade long positions only, short positions only, or both.
- **Max Trades Per Day**: Limit the number of trades per day to prevent overtrading.
- **Bars Between Trades**: Enforce a minimum number of bars between consecutive trades.
### Session Management
- **Session Control**: Restrict trading to specific times of the day.
- **Time Zone**: Specify the time zone for session calculations.
- **Expiration**: Optionally set a date when the strategy should stop executing.
### Contract Settings
- **Contract Type**: Select from common futures contracts (MNQ, MES, NQ, ES) or custom values.
- **Point Value**: Define the dollar value per point movement.
- **Tick Size**: Set the minimum price movement for accurate calculations.
### Visual Signals
- **Continuous Position Signals**: Implement 0 to 1 visual signals to track position states.
- **Signal Plotting**: Customize color and appearance of position signals.
- **Clear Visual Feedback**: Instantly see when entry conditions are triggered.
### Risk Management
#### Stop Loss and Take Profit
- **Risk Type**: Choose between percentage-based, ATR-based, or points-based risk management.
- **Percentage Mode**: Set SL/TP as a percentage of entry price.
- **ATR Mode**: Set SL/TP as a multiple of the Average True Range.
- **Points Mode**: Set SL/TP as a fixed number of points from entry.
#### Advanced Exit Features
- **Break-Even**: Automatically move stop-loss to break-even after reaching specified profit threshold.
- **Trailing Stop**: Implement a trailing stop-loss that follows price movement at a defined distance.
- **Partial Profit Taking**: Take partial profits at predetermined price levels:
- Set first partial exit point and percentage of position to close
- Set second partial exit point and percentage of position to close
- **Time-Based Exit**: Automatically exit a position after a specified number of bars.
#### Win/Loss Streak Management
- **Streak Cutoff**: Automatically pause trading after a series of consecutive wins or losses.
- **Daily Reset**: Option to reset streak counters at the start of each day.
### Entry Conditions
- **Source and Value**: Define the exact price source and value that triggers entries.
- **Equals Condition**: Entry signals occur when the source exactly matches the specified value.
### Performance Analytics
- **Real-Time Stats**: Track important performance metrics like win rate, P&L, and largest wins/losses.
- **Visual Feedback**: On-chart markers for entries, exits, and important events.
### External Integration
- **Webhook Support**: Compatible with TradingView's webhook alerts for automated trading.
- **Cross-Platform**: Connect to external trading systems and notification platforms.
- **Custom Order Execution**: Implement advanced order flows through external services.
## How to Use
### Setup Instructions
1. Add the script to your TradingView chart.
2. Configure the general settings based on your trading preferences.
3. Set session trading hours if you only want to trade specific times.
4. Select your contract specifications or customize for your instrument.
5. Configure risk parameters:
- Choose your preferred risk management approach
- Set appropriate stop-loss and take-profit levels
- Enable advanced features like break-even, trailing stops, or partial profit taking as needed
6. Define entry conditions:
- Select the price source (such as close, open, high, or an indicator)
- Set the specific value that should trigger entries
### Entry Condition Examples
- **Example 1**: To enter when price closes exactly at a whole number:
- Long Source: close
- Long Value: 4200 (for instance, to enter when price closes exactly at 4200)
- **Example 2**: To enter when an indicator reaches a specific value:
- Long Source: ta.rsi(close, 14)
- Long Value: 30 (triggers when RSI equals exactly 30)
### Best Practices
1. **Always backtest thoroughly** before using in live trading.
2. **Start with conservative risk settings**:
- Small position sizes
- Reasonable stop-loss distances
- Limited trades per day
3. **Monitor and adjust**:
- Use the performance table to track results
- Adjust parameters based on how the strategy performs
4. **Consider market volatility**:
- Use ATR-based stops during volatile periods
- Use fixed points during stable markets
## Continuous Position Signals Implementation
The LongShortExit strategy can be enhanced with continuous position signals to provide visual feedback about the current position state. These signals can help you track when the strategy is in a long or short position.
### Adding Continuous Position Signals
Add the following code to implement continuous position signals (0 to 1):
```pine
// Continuous position signals (0 to 1)
var float longSignal = 0.0
var float shortSignal = 0.0
// Update position signals based on your indicator's conditions
longSignal := longCondition ? 1.0 : 0.0
shortSignal := shortCondition ? 1.0 : 0.0
// Plot continuous signals
plot(longSignal, title="Long Signal", color=#00FF00, linewidth=2, transp=0, style=plot.style_line)
plot(shortSignal, title="Short Signal", color=#FF0000, linewidth=2, transp=0, style=plot.style_line)
```
### Benefits of Continuous Position Signals
- Provides clear visual feedback of current position state (long/short)
- Signal values stay consistent (0 or 1) until condition changes
- Can be used for additional calculations or alert conditions
- Makes it easier to track when entry conditions are triggered
### Using with Custom Indicators
You can adapt the continuous position signals to work with any custom indicator by replacing the condition with your indicator's logic:
```pine
// Example with moving average crossover
longSignal := fastMA > slowMA ? 1.0 : 0.0
shortSignal := fastMA < slowMA ? 1.0 : 0.0
```
## Webhook Integration
The LongShortExit strategy is fully compatible with TradingView's webhook alerts, allowing you to connect your strategy to external trading platforms, brokers, or custom applications for automated trading execution.
### Setting Up Webhooks
1. Create an alert on your chart with the LongShortExit strategy
2. Enable the "Webhook URL" option in the alert dialog
3. Enter your webhook endpoint URL (from your broker or custom trading system)
4. Customize the alert message with relevant information using TradingView variables
### Webhook Message Format Example
```json
{
"strategy": "LongShortExit",
"action": "{{strategy.order.action}}",
"price": "{{strategy.order.price}}",
"quantity": "{{strategy.position_size}}",
"time": "{{time}}",
"ticker": "{{ticker}}",
"position_size": "{{strategy.position_size}}",
"position_value": "{{strategy.position_value}}",
"order_id": "{{strategy.order.id}}",
"order_comment": "{{strategy.order.comment}}"
}
```
### TradingView Alert Condition Examples
For effective webhook automation, set up these alert conditions:
#### Entry Alert
```
{{strategy.position_size}} != {{strategy.position_size}}
```
#### Exit Alert
```
{{strategy.position_size}} < {{strategy.position_size}} or {{strategy.position_size}} > {{strategy.position_size}}
```
#### Partial Take Profit Alert
```
strategy.order.comment contains "Partial TP"
```
### Benefits of Webhook Integration
- **Automated Trading**: Execute trades automatically through supported brokers
- **Cross-Platform**: Connect to custom trading bots and applications
- **Real-Time Notifications**: Receive trade signals on external platforms
- **Data Collection**: Log trade data for further analysis
- **Custom Order Management**: Implement advanced order types not available in TradingView
### Compatible External Applications
- Trading bots and algorithmic trading software
- Custom order execution systems
- Discord, Telegram, or Slack notification systems
- Trade journaling applications
- Risk management platforms
### Implementation Recommendations
- Test webhook delivery using a free service like webhook.site before connecting to your actual trading system
- Include authentication tokens or API keys in your webhook URL or payload when required by your external service
- Consider implementing confirmation mechanisms to verify trade execution
- Log all webhook activities for troubleshooting and performance tracking
## Strategy Customization Tips
### For Scalping
- Set smaller profit targets (1-3 points)
- Use tighter stop-losses
- Enable break-even feature after small profit
- Set higher max trades per day
### For Day Trading
- Use moderate profit targets
- Implement partial profit taking
- Enable trailing stops
- Set reasonable session trading hours
### For Swing Trading
- Use longer-term charts
- Set wider stops (ATR-based often works well)
- Use higher profit targets
- Disable daily streak reset
## Common Troubleshooting
### Low Win Rate
- Consider widening stop-losses
- Verify that entry conditions aren't triggering too frequently
- Check if the equals condition is too restrictive; consider small tolerances
### Missing Obvious Trades
- The equals condition is extremely precise. Price must exactly match the specified value.
- Consider using floating-point precision for more reliable triggers
### Frequent Stop-Outs
- Try ATR-based stops instead of fixed points
- Increase the stop-loss distance
- Enable break-even feature to protect profits
## Important Notes
- The exact equals condition is strict and may result in fewer trade signals compared to other conditions.
- For instruments with decimal prices, exact equality might be rare. Consider the precision of your value.
- Break-even and trailing stop calculations are based on points, not percentage.
- Partial take-profit levels are defined in points distance from entry.
- The continuous position signals (0 to 1) provide valuable visual feedback but don't affect the strategy's trading logic directly.
- When implementing continuous signals, ensure they're aligned with the actual entry conditions used by the strategy.
---
*This strategy is for educational and informational purposes only. Always test thoroughly before using with real funds.*
Indicatori e strategie
RMSE Bollinger Bands + Loop | Lyro RSRMSE Bollinger Bands + Loops
Overview
The RMSE Bollinger Bands + Loops is a sophisticated technical analysis tool designed to identify and quantify market trends by combining dynamic moving averages with statistical measures. This indicator employs a multi-model approach, integrating Bollinger-style RMSE bands, momentum scoring, and a hybrid signal system to provide traders with adaptive insights across varying market conditions.
Indicator Modes
Bollinger-style RMSE Bands: this mode calculates dynamic volatility bands around the price using the following formula:
Upper Band = Dynamic Moving Average + (RMSE × Multiplier)
Lower Band = Dynamic Moving Average - (RMSE × Multiplier)
These bands adjust to market volatility, helping identify potential breakout or breakdown points.
For-Loop Momentum Scoring, momentum is assessed by analyzing recent price behavior through a looping mechanism. A rising momentum score indicates increasing bullish strength, while a declining score suggests growing bearish momentum.
Hybrid Combined Signal: this mode assigns a directional score to the other two modes:
+1 for bullish (green)
–1 for bearish (red)
An average of these scores is computed to generate a combined signal, offering a consolidated market trend indication.
Practical Application
Signal Interpretation: A buy signal is generated when both the RMSE Bands and For-Loop Momentum Scoring align bullishly. Conversely, a sell signal is indicated when both are bearish.
Trend Confirmation: The Hybrid Combined Signal provides a consolidated view, assisting traders in confirming the prevailing market trend.
Note: Always consider additional technical analysis tools and risk management strategies when making trading decisions.
⚠️Disclaimer
This indicator is a tool for technical analysis and does not provide guaranteed results. It should be used in conjunction with other analysis methods and proper risk management practices. The creators of this indicator are not responsible for any financial decisions made based on its signals.
Solapamiento AB MarathonOverlap for Marathon server
TradingView has a limit character that I HAVE to write so here is a story
"The old lighthouse keeper, Silas, had a routine. Every evening, he'd climb the winding stairs, his boots echoing in the stone tower. He'd polish the lamp, ensuring its beam cut through the darkest night, and then he'd sit, watching the restless sea. One stormy evening, a small fishing boat was tossed by the waves. Silas, using his powerful lamp, guided the vessel through the treacherous currents, his steady beam a lifeline in the tempest. When the storm subsided, the grateful fishermen brought him a gift of fresh fish. Silas, who usually ate only what he could buy in town, savored the taste of the sea, a reminder of the importance of his solitary vigil. "
VSA Simplified (Volume Spread Analysis)This indicator implements a simplified version of Volume Spread Analysis (VSA) to help traders identify key volume-based signals used by professional market participants.
It detects classic VSA patterns such as:
Climactic Volume: unusually high volume with wide price spread indicating potential buying/selling climax
No Demand / No Supply: low volume and small spreads signaling lack of interest or exhaustion
Stopping Volume: high volume with long wicks and neutral closes showing absorption or rejection
The indicator plots distinct shapes on the chart to highlight these conditions, assisting traders to read market intent and potential turning points.
Best used alongside market structure and support/resistance zones for confluence.
Abnormal Volume DetectorAbnormal Volume Detector highlights volume spikes that exceed a moving average by a user-defined factor. It helps traders quickly identify moments of unusual activity that often precede significant price movement.
🔍 How it works:
Calculates a simple moving average (SMA) of volume.
Flags any candle where the current volume exceeds SMA × multiplier.
Visually plots spikes with a triangle under the candle.
Optional background highlight for strong alerts.
✅ Great for:
Spotting breakout attempts
Identifying news-driven volume surges
Filtering signals in momentum strategies
Customizable and lightweight — perfect for intraday or swing traders looking to add volume context to their analysis.
Multi-Timeframe Trend Heatmap (EMA/RSI Based)Multi-Timeframe Trend Heatmap is a compact visual indicator that shows trend direction across multiple timeframes at a glance.
You can choose between two trend detection methods:
✅ EMA: Price compared to an exponential moving average
✅ RSI: Overbought/oversold zone filtering (above 55 = bullish, below 45 = bearish)
🔍 How it works:
For each timeframe (up to 3), the script checks whether the trend is bullish, bearish, or neutral.
The result is shown as a heatmap using colored bars:
🟩 Green = Bullish
🟥 Red = Bearish
⬜ Gray = Neutral
✅ Features:
Select up to 3 custom timeframes (ex: 5min / 15min / 1h)
Choose between EMA or RSI trend logic
Works in a separate pane (non-overlay)
This indicator is especially useful for scalpers and intraday traders who want a quick and reliable overview of multi-timeframe alignment.
Dynamic RSI with Volatility-Based Levels)Dynamic RSI with Volatility-Based Levels is a smarter version of the classic RSI. Instead of using fixed overbought (70) and oversold (30) levels, this indicator adjusts the thresholds based on market volatility, using ATR as the reference.
📊 How it works:
The more volatile the market, the wider the RSI bands become.
In calm markets, the thresholds tighten to capture more sensitive reversals.
This helps reduce false signals during strong trends or erratic price moves.
✅ Features:
RSI with adjustable period
Volatility measured using ATR (% of price)
Dynamic overbought and oversold zones
Optional background highlights for extreme zones
🔍 Use cases:
Identify more reliable reversal zones in volatile markets
Avoid overreacting to RSI overbought/oversold in high-volatility phases
Use dynamic thresholds to refine entries and exits in momentum strategies
Three EMA Indicatortree moving avCertainly! Here's a simple script for a trading indicator that incorporates three Exponential Moving Averages (EMA): EMA 114, EMA 20, and EMA 50. This script is written in Pine Script, the language used for developing indicators in TradingView.arage
MA Crossover with EmojisMA CROSS SIMPLE
Set up for 10 and 40 but you can update to any two moving averages you want
10/40 works good for bitcoin
5/20 a good fast signal
20/100 a good slow signal
Thats why we go with teh 10/40 its in the middle!!!
M2 Liquidity Divergence ModelM2 Liquidity Divergence Model
The M2 Liquidity Divergence Model is a macro-aware visualization tool designed to compare shifts in global liquidity (M2) against the performance of a benchmark asset (default: Bitcoin). This script captures liquidity flows across major global economies and highlights whether price action is aligned ("Agreement") or diverging ("Divergence") from macro trends.
🔍 Core Features
M2 Global Liquidity Index (GLI):
Aggregates M2 money supply from major global economies, FX-adjusted, including extended contributors like India, Brazil, and South Africa. The slope of this composite is used to infer macro liquidity trends.
Lag Offset Control:
Allows the M2 signal to lead benchmark asset price by a configurable number of days (Lag Offset), useful for modeling the forward-looking nature of macro flows.
Gradient Macro Context (Background):
Displays a color-gradient background—aqua for expansionary liquidity, fuchsia for contraction—based on the slope and volatility of M2. This contextual backdrop helps users visually anchor price action within macro shifts.
Divergence Histogram (Optional):
Plots a histogram showing dynamic correlation or divergence between the liquidity index and the selected benchmark.
Agreement Mode: M2 and asset are moving together.
Divergence Mode: Highlights break in expected macro-asset alignment.
Adaptive Transparency Scaling:
Histogram and background gradients scale their visual intensity based on statistical deviation to emphasize stronger signals.
Toggle Options:
Show/hide the M2 Liquidity Index line.
Show/hide divergence histogram.
Enable/disable visual offset of M2 to benchmark.
🧠 Suggested Usage
Macro Positioning: Use the background context to align directional trades with macro liquidity flows.
Disagreement as Signal: Use divergence plots to identify when price moves against macro expectations—potential reversal or exhaustion zones.
Time-Based Alignment: Adjust Lag Offset to synchronize M2 signals with asset price behavior across different market conditions.
⚠️ Disclaimer
This indicator is designed for educational and analytical purposes only. It does not constitute financial advice or an investment recommendation. Always conduct your own research and consult a licensed financial advisor before making trading decisions.
ORBIT🚀 Sndey ORBIT Strategy
(ORB Intraday Tactic for Indian Markets — 5-min Compatible)
by @sndey
🔹 Overview
Sndey ORBIT is a 5-minute Opening Range Breakout (ORB) intraday strategy tailored for the Indian stock market (NSE/BSE). It captures early market momentum with synced Stoploss, Profit Target, and optional Trailing Stoploss, making it ideal for disciplined intraday traders.
🔹 Why “ORBIT”?
ORBIT stands for:
Opening
Range
Breakout
Intraday
Tactic
Like a rocket breaking past gravity, this strategy aims to catch strong price moves that escape the morning consolidation range.
🔹 How It Works
Timeframe: Optimized for 5-minute charts
ORB Range: 9:15–9:30 AM IST (first 15 mins of Indian market)
Entry:
🔼 Buy: Breakout above ORB High
🔽 Sell: Breakdown below ORB Low
Exit:
On hitting Stoploss, Target, or Trailing SL
Fully automated trade reset logic
🔹 Features
✅ Auto-calculated SL & TP based on user-defined Risk %
✅ Optional Trailing Stoploss
✅ Smart daily reset
✅ Visual plots for ORB High/Low, SL, TP
✅ Clear Buy/Sell/Exit signals
✅ Alert-ready for automation or manual execution
🔹 Notes
Designed for Indian traders (works best on NSE/BSE equities and indices like NIFTY, BANKNIFTY)
Use with liquid instruments for reliable breakout behavior
Meant for intraday use only
📌 Important
Test thoroughly using TradingView’s strategy tester and paper trading before deploying with real capital. Adjust Risk % according to your personal risk profile.
Built with precision. Traded with discipline.
Happy Trading!
– @sndey
Tableau Niveaux High/Low avec Lignes de Prix (Paris)Description for publication: High/Low Levels Chart with Price Lines (Paris)
Discover a complete TradingView indicator designed to display in real time the High and Low levels of key market periods and sessions, directly on your charts. This Pine Script, designed for the Paris market, offers clear, customizable visualization of key levels, essential for technical analysis and decision-making.
**Main features:**
- Automatic display of High/Low for the previous day, week and month
- Monday-specific levels for a better understanding of the start of the week
- Detection and display of session extremes: Asia, London, New York
- Real-time indication of currently active sessions, with distinctive color coding
- Summary table can be positioned on screen (top right corner by default), with choice of text size for optimal readability
- Option to hide the table on mobile, guaranteeing a smooth user experience on all media
**Technical highlights:**
- Dynamic calculation of levels with each new candle, without unnecessary visual overload
- Clean interface: only essential values are displayed, without superfluous lines or background areas
- Automatic adaptation of the number of lines in the table according to the options selected and the periods available
- Intelligent management of sessions passing through minu
Auto-Fibonacci Levels [ChartWhizzperer]Auto-Fibonacci Levels
Discover one of the most elegant and flexible Fibonacci indicators for TradingView – fully automatic, tastefully understated, and built entirely in Pine Script V6.
Key Features:
- Automatically detects the most recent swing high and swing low.
- Plots Fibonacci retracement levels and extensions (including 161.8%, 261.8%) perfectly aligned
to the prevailing trend.
- Distinctive, dashed lines with crystal-clear price labels right at the price scale
for maximum clarity.
- Line length and label offset are fully customisable for your charting preference.
- Absolutely no repainting: Only confirmed swings are used for reliable signals.
- Parameter: "Swing Detection Length"
The “Swing Detection Length” parameter determines how many bars must appear to the left and right of a potential high or low for it to be recognised as a significant swing point.
- Higher values make the script less sensitive (only major turning points are detected).
- Lower values make it more responsive to minor fluctuations (more fibs, more signals).
For best results, adjust this setting according to your preferred timeframe and trading style.
Pro Tip:
Fibonacci levels refresh automatically whenever a new swing is confirmed.
Ideal for price action enthusiasts and Fibonacci purists alike.
Licence:
// Licence: CC BY-NC-SA 4.0 – Non-commercial use only, attribution required.
// © ChartWhizzperer
RSI + EMA/WMA + MACD + Volume/OBV (Tùy chỉnh đầy đủ)🧭 Indicator Name: RSI + EMA/WMA + MACD + Volume/OBV (Fully Customizable)
🔍 Purpose:
This indicator combines several key technical analysis tools in one custom panel (separate tab):
RSI with EMA & WMA smoothing
MACD + divergence detection
Volume or OBV Oscillator (toggle option)
Complete input customization for all components
📐 Included Components:
✅ RSI + EMA/WMA
RSI calculated with user-defined period (default: 7)
Two moving averages applied to RSI:
EMA (default: 9)
WMA (default: 45)
Both plotted on the RSI chart
RSI background zone colors:
Overbought/oversold: 80/70 and 30/20
Neutral zone: 40–60 gray background
✅ EMA vs WMA Cross Alerts on RSI
Alert when WMA crosses above EMA (bullish)
Alert when WMA crosses below EMA (bearish)
✅ MACD
MACD line = EMA(fast) − EMA(slow)
Signal line = EMA(MACD)
Histogram = MACD − Signal
Optional bullish and bearish divergence detection using lookback candles
✅ Volume or OBV Oscillator
Choose between:
Standard volume histogram, or
OBV Oscillator (EMA(12) − EMA(26) of OBV)
⚙️ Customizable Inputs:
You can modify:
RSI length
EMA/WMA length for RSI
MACD fast/slow/signal lengths
Divergence lookback candles
Choose to show/hide: RSI, EMA, WMA, MACD, Volume, or OBV Oscillator
📌 Display Info:
This indicator plots in a separate pane, not overlayed on price
Clear visual styling for analysis zones, lines, and histograms
Works well with other overlayed indicators like multi-timeframe dashboards
Would you like a merged version of this with your RSI Multi-Timeframe Table on chart?
Let me know and I’ll combine them cleanly into one script.
RSI & EMA/WMA trạng thái đa khung (nâng cấp)🧠 Main Function
This indicator helps you track the relationship between RSI, EMA, and WMA across multiple timeframes, all displayed in a visual table overlayed on the price chart.
📋 Displayed Components
Row Content
🟦 Row 1 Timeframe labels: 1m, 5m, 15m, 1h, 4h, 1D, 4D
🟩 Row 2 Colored dot for RSI status:
– 🟢 RSI is above both EMA and WMA
– 🔴 RSI is below both EMA and WMA
– 🟡 RSI is between EMA and WMA
📈 Row 3 Actual RSI value on that timeframe
🟠 Row 4 Colored dot for EMA vs WMA position:
– 🟢 EMA is above WMA
– 🔴 EMA is below WMA
– ⚪ EMA is nearly equal to WMA
🔤 Row 5 Which moving average is on top: shows "EMA" or "WMA"
⚙️ Custom Inputs
In the input panel, you can adjust:
RSI length (default: 14)
EMA length (default: 9) → Treated as fast MA
WMA length (default: 45) → Treated as slow MA
Custom colors for all status dots (RSI position & EMA/WMA position)
⏱️ Supported Timeframes
1m, 5m, 15m, 1h, 4h, 1D, 4D
→ You can modify these as needed.
✅ Practical Uses
Quickly monitor RSI trends across multiple timeframes
Identify when RSI is trending strong or weakening
Visually track crossovers between fast and slow MAs
Supports faster, clearer trading decisions
Ticker Pulse Meter BasicPairs nicely with the Contrarian 100 MA located here:
and the Enhanced Stock Ticker with 50MA vs 200MA located here:
Description
The Ticker Pulse Meter Basic is a dynamic Pine Script v6 indicator designed to provide traders with a visual representation of a stock’s price position relative to its short-term and long-term ranges, enabling clear entry and exit signals for long-only trading strategies. By calculating three normalized metrics—Percent Above Long & Above Short, Percent Above Long & Below Short, and Percent Below Long & Below Short—this indicator offers a unique "pulse" of market sentiment, plotted as stacked area charts in a separate pane. With customizable lookback periods, thresholds, and signal plotting options, it empowers traders to identify optimal entry points and profit-taking levels. The indicator leverages Pine Script’s force_overlay feature to plot signals on either the main price chart or the indicator pane, making it versatile for various trading styles.
Key Features
Pulse Meter Metrics:
Computes three percentages based on short-term (default: 50 bars) and long-term (default: 200 bars) lookback periods:
Percent Above Long & Above Short: Measures price strength when above both short and long ranges (green area).
Percent Above Long & Below Short: Indicates mixed momentum (orange area).
Percent Below Long & Below Short: Signals weakness when below both ranges (red area).
Flexible Signal Plotting:
Toggle between plotting entry (blue dots) and exit (white dots) signals on the main price chart (location.abovebar/belowbar) or in the indicator pane (location.top/bottom) using the Plot Signals on Main Chart option.
Entry/Exit Logic:
Long Entry: Triggered when Percent Above Long & Above Short crosses above the high threshold (default: 20%) and Percent Below Long & Below Short is below the low threshold (default: 40%).
Long Exit: Triggered when Percent Above Long & Above Short crosses above the profit-taking level (default: 95%).
Visual Enhancements:
Plots stacked area charts with semi-transparent colors (green, orange, red) for intuitive trend analysis.
Displays threshold lines for entry (high/low) and profit-taking levels.
Includes a ticker and timeframe table in the top-right corner for quick reference.
Alert Conditions: Supports alerts for long entry and exit signals, integrable with TradingView’s alert system for automated trading.
Technical Innovation: Combines normalized price metrics with Pine Script v6’s force_overlay for seamless signal integration on the price chart or indicator pane.
Technical Details
Calculation Logic:
Uses confirmed bars (barstate.isconfirmed) to calculate metrics, ensuring reliability.
Short-term percentage: (close - lowest(low, lookback_short)) / (highest(high, lookback_short) - lowest(low, lookback_short)).
Long-term percentage: (close - lowest(low, lookback_long)) / (highest(high, lookback_long) - lowest(low, lookback_long)).
Derived metrics:
pct_above_long_above_short = (pct_above_long * pct_above_short) * 100.
pct_above_long_below_short = (pct_above_long * (1 - pct_above_short)) * 100.
pct_below_long_below_short = ((1 - pct_above_long) * (1 - pct_above_short)) * 100.
Signal Plotting:
Entry signals (long_entry) use ta.crossover to detect when pct_above_long_above_short crosses above entryThresholdhigh and pct_below_long_below_short is below entryThresholdlow.
Exit signals (long_exit) use ta.crossover for pct_above_long_above_short crossing above profitTake.
Signals are plotted as tiny circles with force_overlay=true for main chart or standard plotting for the indicator pane.
Performance Considerations: Optimized for efficiency by calculating metrics only on confirmed bars and using lightweight plotting functions.
How to Use
Add to Chart:
Copy the script into TradingView’s Pine Editor and apply it to your chart.
Configure Settings:
Short Lookback Period: Adjust the short-term lookback (default: 50 bars) for sensitivity.
Long Lookback Period: Set the long-term lookback (default: 200 bars) for broader context.
Entry Thresholds: Modify high (default: 20%) and low (default: 40%) thresholds for entry conditions.
Profit Take Level: Set the exit threshold (default: 95%) for profit-taking.
Plot Signals on Main Chart: Check to display signals on the price chart; uncheck for the indicator pane.
Interpret Signals:
Long Entry: Blue dots indicate a strong bullish setup when price is high relative to both lookback ranges and weakness is low.
Long Exit: White dots signal profit-taking when strength reaches overbought levels.
Use the stacked area charts to assess trend strength and momentum.
Set Alerts:
Create alerts for Long Entry and Long Exit conditions using TradingView’s alert system.
Customize Visuals:
Adjust colors and thresholds via TradingView’s settings for better visibility.
The ticker table displays the symbol and timeframe in the top-right corner.
Example Use Cases
Swing Trading: Use entry signals to capture short-term bullish moves within a broader uptrend, exiting at profit-taking levels.
Trend Confirmation: Monitor the green area (Percent Above Long & Above Short) for sustained bullish momentum.
Market Sentiment Analysis: Use the stacked areas to gauge bullish vs. bearish sentiment across timeframes.
Notes
Testing: Backtest the indicator on your chosen market and timeframe to validate its effectiveness.
Compatibility: Built for Pine Script v6 and tested on TradingView as of June 20, 2025.
Limitations: Signals are long-only; adapt the script for short strategies if needed.
Enhancements: Consider adding a histogram for the difference between metrics or additional thresholds for nuanced trading.
Acknowledgments
Inspired by public Pine Script examples and designed to simplify complex market dynamics into a clear, actionable tool. For licensing or support, contact Chuck Schultz (@chuckaschultz) on TradingView. Share feedback in the comments, and happy trading!
MA Cross with 5‑MA Exit (15m Chart)entry on 9 ma over 21 15m chart exit when price closes below 5 ma
Advanced Crypto Trend Line Strategysimple trend line strategy with rsi, macd, demand and supply and volume confluence.
XRP Alert Strategy - 3X CycleBottom Watch → $1.60 and $1.50 triggers
Reversal Signals → RSI breakout & EMA crossover
Profit Zone Targets → $3.00 and $4.50 levels
(Optional): Volume spike logic for top signal
Cycle Composite 3.6 WeightedThe Cycle Composite is a multi-factor market cycle model designed to classify long-term market behavior into distinct phases using normalized and weighted data inputs.
It combines ten key on-chain, dominance, volatility, sentiment, and trend-following metrics into a single composite output. The goal is to provide a clearer understanding of where the market may stand in the broader cycle (e.g., accumulation, early bull, late bull, or euphoria).
This version (3.4) introduces flexible weighting, trend strength markers, and additional context-aware signals such as risk-on confirmations and altseason flags.
Phases Identified:
The model categorizes the market into one of five zones:
Euphoria (> 85)
Late Bull (70 – 85)
Mid Bull (50 – 70)
Early Bull (30 – 50)
Fear (< 30)
Each phase is determined by a smoothed EMA of the weighted composite score.
Data Sources and Metrics Used (10 total):
BTC Dominance (CRYPTOCAP:BTC.D)
Stablecoin Dominance (USDT + USDC average) (inverted for risk-on)
ETH Dominance (CRYPTOCAP:ETH.D)
BBWP (normalized Bollinger Band Width % over 1-year window)
WVF (Williams VIX Fix for volatility spike detection)
NUPL (Net Unrealized Profit/Loss, external source)
CMF (Chaikin Money Flow, smoothed volume accumulation)
CEX Open Interest (custom input from DAO / external source)
Whale Inflows (custom input from whale exchange transfer data)
Google Trends Average (BTC, Crypto, Altcoin terms)
All inputs are normalized over a 200-bar window and combined via weighted averaging, where each weight is user-configurable.
Additional Features:
Phase Labels: Labels are printed only when a new phase is entered.
Bull Continuation Marker: Triangle up when composite makes higher highs and NUPL increases.
Weakening Marker: Triangle down when composite rolls over in Late Bull and NUPL falls.
Risk-On Signal: Green circle appears when CMF and Google Trends are both rising.
Altseason Flag: Orange diamond appears when dominance of "others.d" exceeds BTC.D and ETH.D and composite is above 50.
Background Shading: Each phase is shaded with a semi-transparent background color.
Timeframe-Aware Display: All markers and signals are shown only on weekly timeframe for clarity.
Intended Use:
This script is intended for educational and macro-trend analysis purposes.
It can be used to:
Identify macro cycle position (accumulation, bull phases, euphoria, etc.)
Spot long-term trend continuation or weakening signals
Add context to price action with external on-chain and sentiment data
Time rotation events such as altseason risk
Disclaimer:
This script does not constitute financial advice.
It is intended for informational and research purposes only.
Users should conduct their own due diligence and analysis before making investment decisions.
MNQ/NQ Risk Management ToolThis tool helps MNQ and NQ futures traders automatically calculate position size based on either a fixed dollar risk or a percentage of account balance.
Simply enter your stop loss level and choose whether to risk a set dollar amount or a percentage of your account. The script will display how many contracts to trade based on your setup.
Features:
Calculates contracts based on stop loss and risk size
Toggle between dollar-based or percent-of-account risk
Works with both MNQ ($2/point) and NQ ($20/point)
Automatically updates based on current price and direction (long or short)
Displays a clean info box on your chart with risk, contracts, and settings
This tool is ideal for intraday or swing traders who want to stay consistent with risk management across trades.
Impulsive Candle Detector TRW [3-in-1]Impulsive Candle Detector
Description: professor Michael impulsive candle but 3 -1 code by me
The Impulsive Candle Detector is a powerful tool designed to identify and highlight three different types of impulsive candles on your TradingView chart—all in a single, customizable indicator. Each impulsive candle type uses its own configurable settings, allowing traders to easily visualize various market dynamics without crowding their charts with multiple indicators.
How it works:
The indicator detects “impulsive” candles based on custom thresholds for candle range, volume, and body-to-wick ratio.
Each of the three types is independently configurable with its own parameters (length for averages, size multiplier, volume multiplier, body ratio, and color).
When an impulsive candle is detected, the corresponding bar is colored and can optionally display a label above the candle indicating its type.
Separate alerts can be set for each impulsive candle type, enabling you to react to different market conditions instantly.
Features:
Three independent impulsive candle detection types, all in one indicator
Adjustable settings for each type (range, volume, body ratio, and color)
Clean, uncluttered chart view
Custom bar coloring and optional labels for instant visual recognition
Supports individual alert notifications for each impulsive candle type
Perfect for:
Traders looking to spot strong market moves or volatility spikes
Those who want to monitor multiple impulsive candle patterns without overlapping indicators
Anyone who values clean and customizable charting solutions