OPEN-SOURCE SCRIPT
EMA Grid + Martingale Indicator (Long-Only)

Title:
EMA Grid + Martingale Indicator (Long-Only)
Short Summary:
A 4-EMA trend filter combined with a grid-based entry system and optional martingale sizing to visualize staged long entries and exits in bullish markets.
Full Description:
This indicator combines a 4-EMA trend filter with a grid-based entry system and optional martingale-style position sizing to help traders visualize staged long entries and exits in trending markets.
How It Works
1. Trend Detection: Uses two sets of EMAs (fast/slow pairs) to confirm bullish momentum. A long signal is generated when both EMA groups align in an uptrend.
2. Grid Entries: After the initial long entry, additional grid levels are triggered every time price drops by the specified grid step (in pips).
3. Martingale Sizing (Optional): Each subsequent entry can increase in size based on the defined martingale factor.
4. Weighted-Average Exit: Calculates the weighted average of all grid entries and signals an exit when the price reaches or surpasses this level plus an optional buffer.
Key Features
• 4 EMA Trend Filter with fully customizable lengths.
• Dynamic grid entries with visual labels (L1, L2, etc.).
• Optional martingale position sizing.
• Weighted-average exit with adjustable buffer.
• Customizable parameters for EMAs, grid steps, max entries, and buffer pips.
• Clear chart visualization of EMAs and entry/exit levels.
Use Cases
• For traders using cost-averaging or grid strategies in bullish markets.
• Visualizes multiple entry levels and profit targets.
• Useful for backtesting and strategy planning.
Note: This indicator is for visualization and planning purposes only. It does not execute trades automatically. It does not guarantee profits and is not financial advice.
EMA Grid + Martingale Indicator (Long-Only)
Short Summary:
A 4-EMA trend filter combined with a grid-based entry system and optional martingale sizing to visualize staged long entries and exits in bullish markets.
Full Description:
This indicator combines a 4-EMA trend filter with a grid-based entry system and optional martingale-style position sizing to help traders visualize staged long entries and exits in trending markets.
How It Works
1. Trend Detection: Uses two sets of EMAs (fast/slow pairs) to confirm bullish momentum. A long signal is generated when both EMA groups align in an uptrend.
2. Grid Entries: After the initial long entry, additional grid levels are triggered every time price drops by the specified grid step (in pips).
3. Martingale Sizing (Optional): Each subsequent entry can increase in size based on the defined martingale factor.
4. Weighted-Average Exit: Calculates the weighted average of all grid entries and signals an exit when the price reaches or surpasses this level plus an optional buffer.
Key Features
• 4 EMA Trend Filter with fully customizable lengths.
• Dynamic grid entries with visual labels (L1, L2, etc.).
• Optional martingale position sizing.
• Weighted-average exit with adjustable buffer.
• Customizable parameters for EMAs, grid steps, max entries, and buffer pips.
• Clear chart visualization of EMAs and entry/exit levels.
Use Cases
• For traders using cost-averaging or grid strategies in bullish markets.
• Visualizes multiple entry levels and profit targets.
• Useful for backtesting and strategy planning.
Note: This indicator is for visualization and planning purposes only. It does not execute trades automatically. It does not guarantee profits and is not financial advice.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.