Raana Price Band 1.1Detects Upper/Lower Circuit
✅ Shows UC/LC % and price in the top-right corner
✅ Uses clean syntax with all arguments on one line (no line continuation issues)
Note. NSE doesnt provide the data, we need to calculate manually.
Statistics
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.*
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
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.
LMAsLibrary "LMAs"
Credits
Thank you to @QuantraSystems for dynamic calculations.
Introduction
This lightweight library offers dynamic implementations of popular moving averages that adapt their length automatically as new bars are added to the chart.
Each function is built on a dynamic length formula:
len = math.min(maxLength, bar_index + 1)
This approach ensures that calculations begin as early as the first bar, allowing for smoother initialization and more consistent behavior across all timeframes. It’s especially useful in custom scripts that run from bar 0 or when historical data is limited.
Usage
You can use this library as a drop-in replacement for standard moving averages. It provides more flexibility and stability in live or backtesting environments where fixed-length indicators may delay or fail to initialize properly.
Why Use This?
• Works from the very first bar
• Avoids na values during early bars
• Great for real-time indicators, strategies, and bar-replay
• Clean and efficient code with dynamic behavior
How to Use
Import the library into your script and call any of the included functions just like you would with their native counterparts.
Summary
A lightweight Pine Script™ library offering dynamic moving averages that work seamlessly from the very first bar. Ideal for strategies and indicators requiring robust initialization and adaptive behavior.
SMA(sourceData, maxLength)
Dynamic SMA
Parameters:
sourceData (float)
maxLength (int)
EMA(src, length)
Dynamic EMA
Parameters:
src (float)
length (int)
DEMA(src, length)
Dynamic DEMA
Parameters:
src (float)
length (int)
TEMA(src, length)
Dynamic TEMA
Parameters:
src (float)
length (int)
WMA(src, length)
Dynamic WMA
Parameters:
src (float)
length (int)
HMA(src, length)
Dynamic HMA
Parameters:
src (float)
length (int)
VWMA(src, volsrc, length)
Dynamic VWMA
Parameters:
src (float)
volsrc (float)
length (int)
SMMA(src, length)
Dynamic SMMA
Parameters:
src (float)
length (int)
LSMA(src, length, offset)
Dynamic LSMA
Parameters:
src (float)
length (int)
offset (int)
RMA(src, length)
Dynamic RMA
Parameters:
src (float)
length (int)
ALMA(src, length, offset_sigma, sigma)
Dynamic ALMA
Parameters:
src (float)
length (int)
offset_sigma (float)
sigma (float)
ZLSMA(src, length)
Dynamic ZLSMA
Parameters:
src (float)
length (int)
FRAMA(src, length)
Parameters:
src (float)
length (int)
KAMA(src, length)
Dynamic KAMA
Parameters:
src (float)
length (int)
JMA(src, length, phase)
Dynamic JMA
Parameters:
src (float)
length (int)
phase (float)
T3(src, length, volumeFactor)
Dynamic T3
Parameters:
src (float)
length (int)
volumeFactor (float)
Raana Price BandDetects Upper/Lower Circuit
✅ Shows UC/LC % and price in the top-right corner
✅ Uses clean syntax with all arguments on one line (no line continuation issues)
custom notes [flasi]Perfect for adding personalized reminders or annotations directly on your trading charts.
Allows you to display up to two customizable notes stacked vertically in any corner of the chart.
Supports multiline text input
Custom background and text colors
Adjustable font sizes
Notes can be toggled on or off individually
Trend Gauge [BullByte]Winning through teamwork, courtesy of the gracious Bullbyte. Multi timeframe analysis, Trend following and statistical computations.
StarsAlignStarsAlign Indicator
The StarsAlign indicator identifies potential buy opportunities by combining three key technical conditions for precise market entry signals. A "BUY" flag is plotted on the chart when:
RSI is below 30, indicating oversold conditions.
Price is at or below the 190-day Simple Moving Average, suggesting a potential support level.
Average True Range (ATR) changes direction, signaling a shift in market volatility.
Features:
Customizable inputs for RSI length, oversold level, moving average period, and ATR length.
Visual "BUY" labels for clear entry signals.
Overlays the 190-day SMA for reference.
Usage:
Ideal for traders seeking confluence in oversold conditions, trend support, and volatility shifts. Apply to any timeframe or market, and adjust parameters to suit your strategy. Always combine with other analysis for best results.
Raana - Price BandAutomatic detection of daily UC/LC limits based on %.
Alerts when price touches or breaks UC/LC.
Bands for opening 15-minute range instead.
Intraweek Highs & Lows🔎 Track and analyze intraweek price extremes with full flexibility.
The indicator detects weekly highs or lows for any selected weekday and monitors when other days break those levels.
⚙️ Inputs
Select day
Pick which weekday’s extreme you want to monitor.
Find Low/High
Select whether you want to track Lows or Highs.
Use candle Wick/Body
Choose if extremes are calculated by full wick or candle body.
Cutoff date
Toggle the date-based filter and choose the starting date for event display.
Breakout Time Zones (CT)High and low of 3am-7am central time plus high and low of 8:30-8:44 high and low
MC Geopolitical Tension Events📌 Script Title: Geopolitical Tension Events
📖 Description:
This script highlights key geopolitical and military tension events from 1914 to 2024 that have historically impacted global markets.
It automatically plots vertical dashed lines and labels on the chart at the time of each major event. This allows traders and analysts to visually assess how markets have responded to global crises, wars, and significant political instability over time.
🧠 Use Cases:
Historical backtesting: Understand how market responded to past geopolitical shocks.
Contextual analysis: Add macro context to technical setups.
🗓️ List of Geopolitical Tension Events in the Script
Date Event Title Description
1914-07-28 WWI Begins Outbreak of World War I following the assassination of Archduke Franz Ferdinand.
1929-10-24 Wall Street Crash Black Thursday, the start of the 1929 stock market crash.
1939-09-01 WWII Begins Germany invades Poland, starting World War II.
1941-12-07 Pearl Harbor Japanese attack on Pearl Harbor; U.S. enters WWII.
1945-08-06 Hiroshima Bombing First atomic bomb dropped on Hiroshima by the U.S.
1950-06-25 Korean War Begins North Korea invades South Korea.
1962-10-16 Cuban Missile Crisis 13-day standoff between the U.S. and USSR over missiles in Cuba.
1973-10-06 Yom Kippur War Egypt and Syria launch surprise attack on Israel.
1979-11-04 Iran Hostage Crisis U.S. Embassy in Tehran seized; 52 hostages taken.
1990-08-02 Gulf War Begins Iraq invades Kuwait, triggering U.S. intervention.
2001-09-11 9/11 Attacks Coordinated terrorist attacks on the U.S.
2003-03-20 Iraq War Begins U.S.-led invasion of Iraq to remove Saddam Hussein.
2008-09-15 Lehman Collapse Bankruptcy of Lehman Brothers; peak of global financial crisis.
2014-03-01 Crimea Crisis Russia annexes Crimea from Ukraine.
2020-01-03 Soleimani Strike U.S. drone strike kills Iranian General Qasem Soleimani.
2022-02-24 Ukraine Invasion Russia launches full-scale invasion of Ukraine.
2023-10-07 Hamas-Israel War Hamas launches attack on Israel, sparking war in Gaza.
2024-01-12 Red Sea Crisis Houthis attack ships in Red Sea, prompting Western naval response.
TAIndicatorsThis library offers a comprehensive suite of enhanced technical indicator functions, building upon TradingView's built-in indicators. The primary advantage of this library is its expanded flexibility, allowing you to select from a wider range of moving average types for calculations and smoothing across various indicators.
The core difference between these functions and TradingView's standard ones is the ability to specify different moving average types beyond the default. While a standard ta.rsi() is fixed, the rsi() in this library, for example, can be smoothed by an 'SMMA (RMA)', 'WMA', 'VWMA', or others, giving you greater control over your analysis.
█ FEATURES
This library provides enhanced versions of the following popular indicators:
Moving Average (ma): A versatile MA function that includes optional secondary smoothing and Bollinger Bands.
RSI (rsi): Calculate RSI with an optional smoothed signal line using various MA types, plus built-in divergence detection.
MACD (macd): A MACD function where you can define the MA type for both the main calculation and the signal line.
ATR (atr): An ATR function that allows for different smoothing types.
VWAP (vwap): A comprehensive anchored VWAP with multiple configurable bands.
ADX (adx): A standard ADX calculation.
Cumulative Volume Delta (cvd): Provides CVD data based on a lower timeframe.
Bollinger Bands (bb): Create Bollinger Bands with a customizable MA type for the basis line.
Keltner Channels (kc): Keltner Channels with selectable MA types and band styles.
On-Balance Volume (obv): An OBV indicator with an optional smoothed signal line using various MA types.
... and more to come! This library will be actively maintained, with new useful indicator functions added over time.
█ HOW TO USE
To use this library in your scripts, import it using its publishing link. You can then call the functions directly.
For example, to calculate a Weighted Moving Average (WMA) and then smooth it with a Simple Moving Average (SMA) :
import ActiveQuants/TAIndicators/1 as tai
// Calculate a 20-period WMA of the close
// Then, smooth the result with a 10-period SMA
= tai.ma("WMA", close, 20, "SMA", 10)
plot(myWma, color = color.blue)
plot(smoothedWma, color = color.orange)
█ Why Choose This Library?
If you're looking for more control and customization than what's offered by the standard built-in functions, this library is for you. By allowing for a variety of smoothing methods across multiple indicators, it enables a more nuanced and personalized approach to technical analysis. Fine-tune your indicators to better fit your trading style and strategies.
Deviation Trend Profile [BigBeluga]🔵 OVERVIEW
A statistical trend analysis tool that combines moving average dynamics with standard deviation zones and trend-specific price distribution.
This is an experimental indicator designed for educational and learning purposes only.
🔵 CONCEPTS
Trend Detection via SMA Slope: Detects trend shifts when the slope of the SMA exceeds a ±0.1 threshold.
Standard Deviation Zones: Calculates ±1, ±2, and ±3 levels from the SMA using ATR, forming dynamic envelopes around the mean.
Trend Distribution Profile: Builds a histogram that shows how often price closed within each deviation zone during the active trend phase.
🔵 FEATURES
Trend Signals: Immediate shift markers using colored circles at trend reversals.
SMA Gradient Coloring: The SMA line dynamically changes color based on its directional slope.
Trend Duration Label: A label above the histogram shows how many bars the current trend has lasted.
Trend Distribution Histogram: Visual bin-based profile showing frequency of price closes within deviation bands during trend lookback period.
Adjustable Bin Count: Set the granularity of the distribution using the “Bins Amount” input.
Deviation Labels and Zones: Clearly marked ±1, ±2, ±3 lines with consistent color scheme.
Trend Strength Insight:
• Wide profile skewed to ±2/3 = strong directional trend.
• Profile clustered near SMA = potential trend exhaustion or range.
🔵 HOW TO USE
Use trend shift dots as entry signals:
• 🔵 = Bullish start
• 🔴 = Bearish start
Trade with the trend when price clusters in outer zones (±2 or ±3).
Be cautious or fade the trend when price distribution contracts toward the SMA.
View across multiple timeframes for trend confluence or divergence.
🔵 CONCLUSION
Deviation Trend Profile visualizes how price distributes during trends relative to statistical deviation zones.
It’s a powerful confluence tool for identifying strength, exhaustion, and the rhythm of price behavior—ideal for swing traders and volatility analysts alike.
Luma DCA Simulator (BTC only)Luma DCA Simulator – Guide
What is the Luma DCA Simulator?
The Luma DCA Tracker shows how regular Bitcoin investments (Dollar Cost Averaging) would have developed over a freely selectable period – directly in the chart, transparent and easy to follow.
Settings Overview
1. Investment amount per interval
Specifies how much capital is invested at each purchase (e.g. 100).
2. Start date
Defines the point in time from which the simulation begins – e.g. 01.01.2020.
3. Investment interval
Determines how frequently investments are made:
– Daily
– Weekly
– Every 14 days
– Monthly
4. Language
Switches the info box display between English and German.
5. Show investment data (optional)
If activated, the chart will display additional values such as total invested capital, BTC amount, current value, and profit/loss.
What the Chart Displays
Entry points: Each DCA purchase is marked as a point in the price chart.
Average entry price: An orange line visualizes the evolving DCA average.
Info box (bottom left) with a live summary of:
– Total invested capital
– Total BTC acquired
– Average entry price
– Current portfolio value
– Profit/loss in absolute terms and percentage
Note on Accuracy
This simulation is for illustrative purposes only.
Spreads, slippage, fees, and tax effects are not included.
Actual results may vary.
Technical Note
For daily or weekly intervals, the chart timeframe should be set to 1 day or lower to ensure all purchases are accurately included.
Larger timeframes (e.g. weekly or monthly charts) may result in missed investments.
Currency Handling
All calculations are based on the selected chart symbol (e.g. BTCUSD, BTCEUR, BTCUSDT).
The displayed currency is automatically determined by the chart used.
Adaptive Multi-MA OptimizerAdaptive Multi-MA Optimizer
This indicator provides a powerful, customizable solution for traders seeking dynamically optimized moving averages with precision and control. It integrates multiple custom-built moving average types, applies real-time volatility-based optimization, and includes an optional composite smoothing engine.
🧠 Key Features
Dynamic Optimization:
Automatically selects the optimal lookback length based on market volatility stability using a custom standard deviation differential model.
Multiple Custom MA Types:
Includes fully custom implementations of:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume Weighted MA)
DEMA (Double EMA)
TEMA (Triple EMA)
Hull MA
ALMA (Arnaud Legoux MA)
Composite MA Option:
A unique "Composite" mode blends all supported MAs into a single average, then applies optional smoothing for enhanced signal clarity.
Dynamic Smoothing:
The composite mode supports volatility-adjusted smoothing (based on optimized lookback), making it adaptable to different market regimes.
Fully Custom Logic:
No built-in MA functions are used — every moving average is hand-coded for transparency and educational value.
⚙️ How It Works
Optimization:
The script evaluates a range of lengths (minLen to maxLen) using the standard deviation of price returns. It selects the length with the most stable recent volatility profile.
Calculation:
The selected MA type is calculated using that optimized length. If "Composite" is chosen, all MA types are averaged and smoothed dynamically.
Visualization:
The adaptive MA is plotted on the chart, changing color based on its position relative to price.
📌 Use Cases
Trend-following strategies that adapt to different market conditions.
Traders wanting a high-fidelity composite of multiple MAs.
Analysts interested in visualizing market smoothness without lag-heavy signals.
Coders looking to learn how to build custom indicators from scratch.
🧪 Inputs
MA Type: Choose from 8 MA types or a blended Composite.
Lookback Range: Control min/max and step size for optimization.
Source: Choose any price series (e.g., close, hl2).
⚠️ Disclaimer
This indicator is for educational and informational purposes only and does not constitute financial advice, trading advice, or investment recommendations. Use of this script is at your own risk. Past performance does not guarantee future results. Always perform your own analysis and consult with a qualified financial advisor before making trading decisions.
GK Accounting - Gold Trading Signalhi this is new indicator for trading anytime frame any market its work really good
Standard Deviation + Z-scoreThis indicator calculates the standard deviation of close prices over the last N periods, where N is a user-defined input. Three rays above and below the current price indicate three standard deviations. The summary in the top right corner shows the number of bars N, the mean value over the period, standard deviation as percentage and Z-score of the current price.
Adaptive Normalized Global Liquidity OscillatorAdaptive Normalized Global Liquidity Oscillator
A dynamic, non-repainting oscillator built on real central bank balance sheet data. This tool visualizes global liquidity shifts by aggregating monetary asset flows from the world’s most influential central banks.
🔍 What This Script Does:
Aggregates Global Liquidity:
Includes Federal Reserve (FED) assets and subtracts liabilities like the Treasury General Account (TGA) and Reverse Repo Facility (RRP), combined with asset positions from the ECB, BOJ, PBC, BOE, and over 10 other central banks. All data is normalized into USD using FX rates.
Adaptive Normalization:
Optimizes the lookback period dynamically based on rate-of-change stability—no fixed lengths, enabling adaptation across macro conditions.
Self-Optimizing Weighting:
Applies inverse standard deviation to balance raw liquidity, smoothed momentum (HMA), and standardized deviation from the mean.
Percentile-Ranked Highlights:
Liquidity readings are ranked relative to history—extremes are visually emphasized using gradient color and adaptive transparency.
Non-Repainting Design:
Data is anchored with bar index awareness and offset techniques, ensuring no forward-looking bias. What you see is what was known at that time.
⚠️ Important Interpretation Note:
This is not a zero-centered oscillator like RSI or MACD. The signal line does not represent neutrality at zero.
Instead, a dynamic baseline is calculated using a rolling mean of scaled liquidity.
0 is irrelevant on its own—true directional signals come from crosses above or below this adaptive baseline.
Even negative values may signal strength if they are rising above the moving average of past liquidity conditions.
✅ What to Watch For:
Crossover Above Dynamic Baseline:
Indicates liquidity is expanding relative to recent conditions—supports a risk-on interpretation.
Crossover Below Dynamic Baseline:
Suggests deteriorating liquidity conditions—may align with risk-off shifts.
Percentile Extremes:
Readings near the top or bottom historical percentiles can act as contrarian or confirmation signals, depending on momentum.
⚙️ How It Works:
Bounded Normalization:
The final oscillator is passed through a tanh function, keeping values within and reducing distortion.
Adaptive Transparency:
The strength of deviations dynamically adjusts plot intensity—visually highlighting stronger liquidity shifts.
Fully Customizable:
Toggle which banks are included, adjust dynamic optimization ranges, and control visual display options for plot and background layers.
🧠 How to Use:
Trend Confirmation:
Sustained rises in the oscillator above baseline suggest underlying monetary support for asset prices.
Macro Turning Points:
Reversals or divergences, especially near OB/OS zones, can foreshadow broader risk regime changes.
Visual Context:
Use the dynamic baseline to see if liquidity is supportive or suppressive relative to its own adaptive history.
📌 Disclaimer:
This indicator is for educational and informational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always consult a qualified financial advisor before making trading or investment decisions.
Luma DCA Tracker (BTC)Luma DCA Tracker (BTC) – User Guide
Function
This indicator simulates a regular Bitcoin investment strategy (Dollar Cost Averaging). It calculates and visualizes:
Accumulated BTC amount
Average entry price
Total amount invested
Current portfolio value
Profit/loss in absolute and percentage terms
Settings
Investment per interval
Fixed amount to be invested at each interval (e.g., 100 USD)
Start date
The date when DCA simulation begins
Investment interval
Choose between:
daily, weekly, every 14 days, or monthly
Show investment data
Displays additional chart lines (total invested, value, profit, etc.)
Chart Elements
Orange line: Average DCA entry price
Grey dots: Entry points based on selected interval
Info box (bottom left): Live summary of all key values
Notes
Purchases are simulated at the closing price of each interval
No fees, slippage, or taxes are included
The indicator is a simulation only and not linked to an actual portfolio
Turtle Trading System (Full Version)The turtle trader strategy by Richard Dennis, buys from breakouts and uses volatility for sizing. Accurate on most asset classes, best on Gold.
GCM Price Based ColorIndicator Name:
GCM Price Based Color Indicator
Detailed Description:
The GCM Price Based Color Indicator is a unique tool designed to help traders spot potential "pump" events in the market. Unlike traditional Volume Rate of Change (VROC) indicators, this script is conditional: it calculates a VROC value only when both the average volume and the price are increasing. This focus helps filter out volume surges that don't accompany immediate price appreciation, highlighting more relevant "pump" signals.
Key Features & Calculation Logic:
Conditional Volume Rate of Change (VROC):
It first calculates a Simple Moving Average (SMA) of the volume over a user-defined length (lookback period).
It then checks two conditions:
Is the current SMA volume greater than the previous bar's SMA volume (i.e., volumeIncreasing)?
Is the current close price greater than the previous bar's close price (i.e., valueIncreasing)?
Only if both volume Increasing AND value Increasing are true, a VROC value is calculated as (current _ MA _ volume - previous _ MA _ volume) * (100 / previous _ MA _ volume). Otherwise, the VROC for that bar is 0.
Historical Normalization:
The raw VROC value is then normalized against its own historical maximum value observed since the indicator was applied. This scaling brings all VROC values into a common 0-100 range.
Why is this important? Normalization makes the indicator's readings comparable across different assets (e.g., high-volume vs. low-volume stocks/cryptos) and different timeframes, making it easier to interpret the strength of a "pump" relative to its own past.
Dynamic Plot Color (Price-Based):
The plot line's color itself provides an immediate visual cue about the current bar's price action:
Green: close is greater than close (price is up for the current bar).
Red: close is less than close (price is down for the current bar).
Grey: close is equal to close (price is flat for the current bar).
Important Note: The plot color reflects the price movement of the current bar, not the magnitude of the VROC Normalized value itself. This means you can have a high vrocNormalized value (indicating a strong conditional volume surge) but a red plot color if the very next bar's price closes lower, providing a multi-faceted view.
Thresholds & Alerts:
Two horizontal lines (small Pump Threshold and big Pump Threshold) are plotted to visually mark significant levels of normalized pump strength.
Customizable alerts can be set up to notify you when VROC Normalized reaches or exceeds these thresholds, helping you catch potential pump events in real-time.
How to Use It:
Identify Potential Pumps: Look for upward spikes in the VROC Normalized line. Higher spikes indicate stronger pump signals (i.e., a larger increase in average volume coinciding with an increasing price).
Monitor Thresholds: Pay attention when the VROC Normalized line crosses above your small Pump Threshold or big Pump Threshold. These are configurable levels to suit different assets and trading styles.
Observe Plot Color: The line color provides crucial context. A high VROC Normalized (strong pump signal) with a green line indicates current price momentum is still positive. If VROC Normalized is high but the line turns red, it might suggest the initial pump is losing steam or experiencing a pullback.
Combine with Other Tools: This indicator is best used in conjunction with other technical analysis tools (e.g., support/resistance, trend lines, other momentum indicators) for confirmation and a more holistic trading strategy.
Indicator Inputs:
Lookback period (1 - 4999) (default: 420): This length determines the period for the Simple Moving Average (SMA) of volume. A higher value will smooth the volume average more, reacting slower, while a lower value will make it more reactive. Adjust based on the timeframe and asset volatility.
Big Pump Threshold (0.01 - 99.99) (default: 10.0): The normalized VROC Normalized level that signifies a "Big Pump." When VROC Normalized reaches or exceeds this level, an alert can be triggered.
Small Pump Threshold (0.01 - 99.99) (default: 0.5): The normalized VROC Normalized level that signifies a "Small Pump." This is a lower threshold for earlier or less significant pump activity.
Alerts:
Small Pump: Triggers when VROC Normalized crosses above or equals the small Pump Threshold.
Big Pump: Triggers when VROC Normalized crosses above or equals the big Pump Threshold.
Best Practices & Considerations:
Timeframes: The indicator can be used on various timeframes, but its effectiveness may vary. Experiment to find what works best for your chosen asset and trading style.
Volatility: Highly volatile assets might require different threshold settings compared to less volatile ones.
Lag: Due to the use of a Simple Moving Average (SMA) for volume, there will be some inherent lag in the calculation.
Normalization Start: The historic Max for normalization starts with a default value of 10.0. For the very first bars, or if there hasn't been a significant VROC yet, the VROC Normalized might behave differently until a true historical maximum VROC establishes itself.
Not Financial Advice: This indicator is a tool for analysis and does not constitute financial advice. Always perform your own research and manage your risk.