Indicators and strategies
ATR Daily ProgressCalculates the average APR for 30 days in points, and also shows how many points the price has passed today.
🧮Calculadora de Entrada/ApalancamientoThis tool automatically calculates the required position size and leverage for a trade based on the user's defined risk amount, stop loss percentage, and capital allocated for the operation.
📊 It displays the following data in a clean table at the bottom-right corner of the chart:
🟨 Required position size
⚡ Leverage needed
💰 Capital used in the trade
🟥 Risk amount per trade
Perfect for traders who manage their capital and risk with precision.
Values update automatically every few candles.
💡 Recommended for traders using fixed risk management strategies (% of capital) and who want a quick visual reference for executing safe and efficient trades.
Open Close Cross Strategy R5.1 revised by JustUncleLThis revision is an open Public release, with just some minor changes. It is a revision of the Strategy "Open Close Cross Strategy R2" originally published by @JayRogers.
*** USE AT YOUR OWN RISK ***
JayRogers : "There are drawing/painting issues in pinescript when working across resolutions/timeframes that I simply cannot fix here.. I will not be putting any further effort into developing this until such a time when workarounds become available."
NOTE: Re-painting has not been observed with the default set up, nor with Alternate resolution multiplier up to 5.
Description:
Strategy based around Open-Close Moving Average Crossovers optionally from a higher time frame.
Setup:
I have generally found that setting the strategy resolution to 3-5x that of the chart you are viewing tends to yield the best results, regardless of which MA option you may choose (if any) BUT can cause a lot of false positives - be aware of this. JustUncleL: using one of the Smoothed MA helps reduce false positives.
Don't aim for perfection. Just aim to get a reasonably snug fit with the O-C band, with good runs of green and red. JustUncleL: using SMMA (8 to 10) gives a good fit.
Option to either use basic open and close series data, or pick your poison with a wide array of MA types.
Optional Stop Loss and Target Profit for damage mitigation if desired (can be toggled on/off)
Positions get taken automatically following a crossover - which is why it's better to set the resolution of the script greater than that of your chart, so that the trades get taken sooner rather than later.
If you make use of the stops/target profit, be sure to take your time tweaking the values. Cutting it too fine will cost you profits but keep you safer, while letting them loose could lead to more draw down than you can handle.
Revsion R5 Changes by JustUncleL
Corrected cross over calculations, sometimes gave false signals.
Corrected Alternate Time calculation to allow for Daily,Weekly and Monthly charts.
Open Public release.
Revision R4 By JustUncleL
Change the way the Alternate resolution in selected, use a Multiplier of the base Time Frame instead, this makes it easy to switch between base time frames.
Added TMA and SSMA moving average options. But DEMA is still giving the best results.
Using "calc_on_every_tick=false" ensures results between back testing and real time are similar.
Added Option to Disable the coloring of the bars.
Updated default settings.
R3 Changes by JustUncleL:
Returned a simplified version of the open/close channel, it shows strength of current trend.
Added Target Profit Option.
Added option to reduce the number of historical bars, overcomes the too many trades limit error.
Simplified the strategy code.
Removed Trailing Stop option, not required and in my option does not work well in Trading View, it also gives false and unrealistic performance results in back testing.
R2 Changes by JayRogers:
Simplified and cleaned up plotting, now just shows a Moving Average derived from the average of open/close.
Tried very hard to alleviate painting issues caused by referencing alternate resolution.
8 août 2017
Notes de version
R5.1 Changes by JustUncleL
Upgraded to Version 3 Pinescript compliance.
Added option to select Trade type (Long, Short, Both or None)
Added bar colouring work around patch.
Some code corrections and changes to improve efficiency.
NOTE: To enable non-Repainting mode set "Delay Open/Close MA" to 1 or more, but expect the reported performance to drop dramatically.
CFD Lot Calculator [MT5 Optimized]CFD Position Size Calculator for MT5 (ES/NQ)
A clean, professional Pine Script tool that calculates optimal position sizes in lots for ES/NQ CFDs based on:
Account balance
Risk percentage per trade
Stop loss in pips
Contract size (default = 1 for MT5)
Features:
✅ Bottom-right compact table
✅ Displays risk amount, stop loss, and lot size
✅ Works with any CFD broker (adjust pip/contract values if needed)
✅ Detailed tooltips explain all inputs
Perfect for traders who want precise position sizing without chart clutter.
First EMA Touch (Last N Bars)Okay, here's a description of the "First EMA Touch (Last N Bars)" TradingView indicator:
Indicator Name: First EMA Touch (Last N Bars)
Core Purpose:
This indicator is designed to visually highlight on the chart the exact moment when the price (specifically, the high/low range of a price bar) makes contact with a specified Exponential Moving Average (EMA) for the first time within a defined recent lookback period (e.g., the last 20 bars).
How it Works:
EMA Calculation: It first calculates a standard Exponential Moving Average (EMA) based on the user-defined EMA Length and EMA Source (e.g., close price). This EMA line is plotted on the chart, often serving as a dynamic level of potential support or resistance.
"Touch" Detection: For every price bar, the indicator checks if the bar's range (from its low to its high) overlaps with or crosses the calculated EMA value for that bar. If low <= EMA <= high, it's considered a "touch".
"First Touch" Logic: This is the key feature. The indicator looks back over a specified number of preceding bars (defined by the Lookback Period). If a "touch" occurs on the current bar, and no "touch" occurred on any of the bars within that preceding lookback window, then the current touch is marked as the "first touch".
Visual Signal: When a "first touch" condition is met, the indicator plots a distinct shape (by default, a small green triangle) below the corresponding price bar. This makes it easy to spot these specific events.
Key Components & Settings:
EMA Line: The calculated EMA itself is plotted (typically as an orange line) for visual reference.
First Touch Signal: A shape (e.g., green triangle) appears below bars meeting the "first touch" criteria.
EMA Length (Input): Determines the period used for the EMA calculation. Shorter lengths make the EMA more reactive to recent price changes; longer lengths make it smoother and slower.
Lookback Period (Input): Defines how many bars (including the current one) the indicator checks backwards to determine if the current touch is the first one. A lookback of 20 means it checks if there was a touch in the previous 19 bars before signalling the current one as the first.
EMA Source (Input): Specifies which price point (close, open, high, low, hl2, etc.) is used to calculate the EMA.
Interpretation & Potential Uses:
Identifying Re-tests: The signal highlights when price returns to test the EMA after having stayed away from it for the duration of the lookback period. This can be significant as the market re-evaluates the EMA level.
Potential Reversal/Continuation Points: A first touch might indicate:
A potential area where a trend might resume after a pullback (if price bounces off the EMA).
A potential area where a reversal might begin (if price strongly rejects the EMA).
A point of interest if price consolidates around the EMA after the first touch.
Filtering Noise: By focusing only on the first touch within a period, it can help filter out repeated touches that might occur during choppy or consolidating price action around the EMA.
Confluence: Traders might use this signal in conjunction with other forms of analysis (e.g., horizontal support/resistance, trendlines, candlestick patterns, other indicators) to strengthen trade setups.
Limitations:
Lagging: Like all moving averages, the EMA is a lagging indicator.
Not Predictive: The signal indicates a specific past event (the first touch) occurred; it doesn't guarantee a future price movement.
Parameter Dependent: The effectiveness and frequency of signals heavily depend on the chosen EMA Length and Lookback Period. These may need tuning for different assets and timeframes.
Requires Confirmation: It's generally recommended to use this indicator as part of a broader trading strategy and not rely solely on its signals for trade decisions.
In essence, the "First EMA Touch (Last N Bars)" indicator provides a specific, refined signal related to price interaction with a moving average, helping traders focus on potentially significant initial tests of the EMA after a period of separation.
Low Volume Engulfing CandleVolume Moving Average (volMA): This calculates the simple moving average of the volume over a specified period (default 20).
Bullish and Bearish Engulfing Patterns: The script checks for engulfing patterns by comparing the current candle with the previous one.
A bullish engulfing occurs when the current candle closes higher than it opens and the previous candle is a bearish candle.
A bearish engulfing occurs when the current candle closes lower than it opens and the previous candle is a bullish candle.
Low Volume Condition: The volume of the current candle is compared to the moving average volume. If it's below the defined threshold (e.g., 80% of the moving average), it’s considered "low volume."
Plotting: When a low-volume bullish or bearish engulfing pattern is detected, a marker is plotted on the chart.
Quadruple Moving Average with Alerts [FitzTello]This indicator plots 4 Simple Moving Averages to your chart and alerts when price touches each. It also has the ability to be customized by timframe and the inputs.
Cz ASR indicatorAverage session range indicator built by me and gpt ;). Great tool to gauge volatility and intraday reversal zones. Great for FX as there is an included table that shows range in pips, however this can be applied across all assets as a volatility measure. Enjoy :)
Four MAs with Bands Pack by Rising Falcon# **Four MAs with Bands Pack by Rising Falcon**
## **Overview**
The **Four MAs with Bands Pack** is a dynamic multi-moving average indicator designed to enhance trend identification, momentum analysis, and volatility assessment. It allows traders to configure and visualize up to four different moving averages (MAs) with an optional **higher timeframe Hull MA (HMA)** for advanced trend confirmation. The indicator also incorporates **band structures** around each MA, providing additional insights into price volatility, breakout zones, and trend strength.
---
## **Fundamental Aspects**
Moving Averages (MAs) are a foundational tool in technical analysis, widely used to **smooth out price fluctuations** and identify directional bias over time. This indicator leverages four MAs of varying lengths to **capture different time horizons** of market trends, making it useful for:
- **Short-Term Analysis (Scalping):** Fast MAs (e.g., 20, 50) respond quickly to price action, allowing traders to catch early trend shifts.
- **Mid-Term Analysis (Swing Trading):** Medium-length MAs (e.g., 100) help validate trend continuation.
- **Long-Term Analysis (Position Trading):** Slow MAs (e.g., 200) provide macro trend direction and filter noise from short-term fluctuations.
By **color-coding** the MAs based on trend direction and incorporating a **band system**, the indicator helps traders identify price momentum shifts, consolidation zones, and potential breakout opportunities.
---
## **Technical Aspects**
### **1. Configurable Moving Averages**
Each of the four MAs can be customized using three calculation methods:
- **SMA (Simple Moving Average):** A traditional average of past prices, best for stable trend confirmation.
- **EMA (Exponential Moving Average):** Gives more weight to recent price action, making it more reactive to new trends.
- **WMA (Weighted Moving Average):** Assigns greater importance to more recent data, reducing lag while maintaining smoothness.
#### **Formulae:**
1. **SMA:**
\
2. **EMA:**
\
where \( k = \frac{2}{N+1} \)
3. **WMA:**
\
where \( W_i \) is the weight assigned to each period.
Each moving average has an optional **higher timeframe setting**, allowing traders to plot an MA from a larger timeframe on their current chart for **multi-timeframe analysis (MTA)**. This is useful for confirming trends and filtering noise from lower timeframes.
---
### **2. Dynamic Bands & Volatility Visualization**
Each moving average has an associated band, defined by:
- **Upper Band:** The MA value at the current bar.
- **Lower Band:** The MA value from two bars ago (**lagging component** for trend assessment).
- **Color Coding:**
- **Green:** Uptrend (price above the moving average).
- **Red:** Downtrend (price below the moving average).
- **Orange:** Neutral (no strong trend bias).
The band thickness and transparency are customizable, helping traders **visually assess market conditions**:
- **Expanding Bands:** Increased price volatility (potential breakout).
- **Contracting Bands:** Reduced volatility (possible consolidation).
Mathematically, the **band region is defined by**:
\
This concept is similar to **Keltner Channels** or **Bollinger Bands**, but instead of standard deviations, it uses historical MA differences to capture trend momentum.
---
### **3. Trend Alerts & Crossover Signals**
To assist traders in making timely decisions, the indicator generates alerts when **fast MAs cross slow MAs**:
- **Bullish Crossover (Uptrend Confirmation):**
\
- **Bearish Crossover (Downtrend Confirmation):**
\
- These alerts can be used to set up **automated notifications** for trade entries/exits.
---
## **How to Use This Indicator**
### **Scalping Strategy**
1. Use **shorter length MAs (20, 50)** with **higher timeframe Hull MA** enabled.
2. Look for **bullish crossovers** of fast MAs over slow MAs.
3. Ensure the band is **expanding** before entering a trade.
4. Exit when the opposite crossover occurs or when bands **contract**.
### **Swing Trading Strategy**
1. Use a combination of **medium and long MAs (50, 100, 200)** for trend confirmation.
2. Look for **price pullbacks** into the bands before **trend continuation**.
3. Set alerts for **crossovers** to validate trend direction.
### **Trend Reversal Strategy**
1. Look for **bearish crossovers** near resistance levels for short trades.
2. Wait for **bullish crossovers** at support levels for long trades.
3. Confirm with **higher timeframe MA direction** to reduce false signals.
---
## **Key Benefits**
✅ **Versatile:** Works for scalping, swing trading, and trend following.
✅ **Multi-Timeframe Support:** View higher timeframe MAs for broader trend validation.
✅ **Customizable:** Adjust MA type, length, color coding, and band visibility.
✅ **Alerts:** Automatic notifications for trend shifts and crossovers.
✅ **Clear Visualization:** Helps traders identify breakout zones, volatility spikes, and reversals.
---
## **Final Thoughts**
The **Four MAs with Bands Pack by Rising Falcon** is an advanced yet intuitive tool for traders looking to enhance their trend-following strategies. By combining **multiple moving averages, band structures, and trend color coding**, it provides a comprehensive view of price action, helping traders make **informed trading decisions** with greater confidence.
Sap Kar 3 EMAs + PA; (P)This script plots 3 EMAs and also shows price action in the form of GREEN ARROWS at the bottom of the bars for LONG trades and RED ARROWS @ top of the bars for SHORT TRADE.
Will be useful for trend and momentum following. The input parameters for price action ae
1. No of Bars for price action calculation:- This should be ideally between 3 to 6.
2. Maximum Close % should preferably be above 75 and should always be above 50.
3. Minimum Close % should preferably be below 25 and should always be below 50.
Should buy when above EMAs and green arrows start forming below bars. Should sell when below EMAs and red arrows start forming above bars.
ATR Probability + MAs + Bollinger Bands PROATR Probability + MAs + Bollinger Bands
Made by DeepSeek))
The Crypto Wizard# The Crypto Wizard (Cwiz)
## Advanced Trading Framework for Cryptocurrency Markets
! (placeholder.com)
The Crypto Wizard (Cwiz) offers a customizable, robust trading framework designed specifically for cryptocurrency market volatility. This open-source foundation provides essential components for building profitable automated trading strategies.
### Key Performance Indicators
| Metric | Value |
|--------|-------|
| Profit Factor | 1.992 |
| Sortino Ratio | 5.589 |
| Win Rate | ~40% |
| Max Drawdown | 15.82% |
### Core Features
- **Position Scaling System**: Intelligent position sizing with customizable multipliers and risk controls
- **Multi-layered Exit Strategy**: Combined take-profit, fixed stop-loss, and trailing stop mechanisms
- **Customizable Entry Framework**: Easily integrate your own entry signals and conditions
- **Comprehensive Visualization Tools**: Real-time performance tracking with position labels and indicators
### Setup Instructions
```pine PHEMEX:FARTCOINUSDT.P
// 1. Add to your chart and configure basic parameters
// 2. Adjust risk parameters based on your risk tolerance
// 3. Customize entry conditions or use defaults
// 4. Back-test across various market conditions
// 5. Enable live trading with careful monitoring
```
### Risk Management
Cwiz implements a sophisticated risk management system with:
- Automatic position size scaling
- User-defined maximum consecutive trades
- ATR-based dynamic stop loss placement
- Built-in circuit breakers for extreme market conditions
### Customization Options
The framework is designed for flexibility without compromising core functionality. Key customization points:
- Entry signal generation
- Position sizing parameters
- Stop loss and take profit multipliers
- Visualization preferences
### Recommended Usage
Best suited for volatile cryptocurrency markets with sufficient liquidity. Performs optimally in trending conditions but includes mechanisms to manage ranging markets.
---
*Disclaimer: Trading involves significant risk. Past performance is not indicative of future results. Always test thoroughly before live deployment.*
DAMA OSC - Directional Adaptive MA OscillatorOverview:
The DAMA OSC (Directional Adaptive MA Oscillator) is a highly customizable and versatile oscillator that analyzes the delta between two moving averages of your choice. It detects trend progression, regressions, rebound signals, MA cross and critical zone crossovers to provide highly contextual trading information.
Designed for trend-following, reversal timing, and volatility filtering, DAMA OSC adapts to market conditions and highlights actionable signals in real-time.
Features:
Support for 11 custom moving average types (EMA, DEMA, TEMA, ALMA, KAMA, etc.)
Customizable fast & slow MA periods and types
Histogram based on percentage delta between fast and slow MA
Trend direction coloring with “Green”, “Blue”, and “Red” zones
Rebound detection using close or shadow logic
Configurable thresholds: Overbought, Oversold, Underbought, Undersold
Optional filters: rebound validation by candle color or flat-zone filter
Full visual overlay: MA lines, crossover markers, rebound icons
Complete alert system with 16 preconfigured conditions
How It Works:
Histogram Logic:
The histogram measures the percentage difference between the fast and slow MA:
hist_value = ((FastMA - SlowMA) / SlowMA) * 100
Trend State Logic (Green / Blue / Red):
Green_Up = Bullish acceleration
Blue_Up (or Red_Up, depending the display settings) = Bullish deceleration
Blue_Down (or Green_Down, depending the display settings) = Bearish deceleration
Red_Down = Bearish acceleration
Rebound Logic:
A rebound is detected when price:
Crosses back over a selected MA (fast or slow)
After being away for X candles (rebound_backstep)
Optional: filtered by histogram zones or candle color
Inputs:
Display Options:
Show/hide MA lines
Show/hide MA crosses
Show/hide price rebounds
Enable/disable blue deceleration zones
DAMA Settings:
Fast/Slow MA type and length
Source input (close by default)
Overbought/Oversold levels
Underbought/Undersold levels
Rebound Settings:
Use Close and/or Shadow
Rebound MA (Fast/Slow)
Candle color validation
Flat zone filter rebounds (between UnderSold and UnderBought)
Available MA type:
SMA (Simple MA)
EMA (Exponential MA)
DEMA (Double EMA)
TEMA (Triple EMA)
WMA (Weighted MA)
HMA (Hull MA)
VWMA (Volume Weighted MA)
Kijun (Ichimoku Baseline)
ALMA (Arnaud Legoux MA)
KAMA (Kaufman Adaptive MA)
HULLMOD (Modified Hull MA, Same as HMA, tweaked for Pine v6 constraints)
Notes:
**DEMA/TEMA** reduce lag compared to EMA, useful for faster reaction in trending markets.
**KAMA/ALMA** are better suited to noisy or volatile environments (e.g., BTC).
**VWMA** reacts strongly to volume spikes.
**HMA/HULLMOD** are great for visual clarity in fast moves.
Alerts Included (Fully Configurable):
Golden Cross:
Fast MA crosses above Slow MA
Death Cross:
Fast MA crosses below Slow MA
Bullish Rebound:
Rebound from below MA in uptrend
Bearish Rebound:
Rebound from above MA in downtrend
Bull Progression:
Transition into Green_Up with positive delta
Bear Progression:
Transition into Red_Down with negative delta
Bull Regression:
Exit from Red_Down into Blue/Green with negative delta
Bear Regression:
Exit from Green_Up into Blue/Red with positive delta
Crossover Overbought:
Histogram crosses above Overbought
Crossunder Overbought:
Histogram crosses below Overbought
Crossover Oversold:
Histogram crosses above Oversold
Crossunder Oversold:
Histogram crosses below Oversold
Crossover Underbought:
Histogram crosses above Underbought
Crossunder Underbought:
Histogram crosses below Underbought
Crossover Undersold:
Histogram crosses above Undersold
Crossunder Undersold:
Histogram crosses below Undersold
Credits:
Created by Eff_Hash. This code is shared with the TradingView community and full free. do not hesitate to share your best settings and usage.
Trend Strength MeterThe Trend Strength Meter (TSM) is a powerful and versatile indicator designed to help traders identify market trends, measure their strength, and detect potential reversals with ease. This indicator combines the power of moving averages, divergence detection, and a clean, customizable dashboard to provide actionable insights for traders of all levels.
How It Works
Trend Strength Calculation:
1. The TSM calculates the trend strength using the difference between two Exponential Moving Averages (EMAs): a fast EMA (default: 20) and a slow EMA (default: 50).
2. The difference is expressed as a percentage of the slow EMA, providing a clear measure of the trend's strength and direction.
Histogram Visualization:
1. A color-coded histogram visually represents the trend strength:
Green: Bullish trend
Red: Bearish trend
Gray: Neutral or no significant trend
2. A smoothed trend strength line (SMA of the trend strength) is also plotted for better clarity.
Divergence Detection:
1. The indicator detects bullish and bearish divergences using the RSI (Relative Strength Index) and price action.
2. Bullish Divergence: Price makes a lower low, but RSI makes a higher low, signaling potential upward momentum.
3. Bearish Divergence: Price makes a higher high, but RSI makes a lower high, signaling potential downward momentum.
=> Divergences are marked with arrows on the chart:
Green Arrow: Bullish divergence
Red Arrow: Bearish divergence
Dashboard:
1. A clean and informative dashboard displays key information:
Trend Strength Value: The current strength of the trend
Trend Direction: Bullish, Bearish, or Neutral
Last Signal: Buy, Sell, or None (based on divergence signals)
The dashboard is fully customizable and can be positioned anywhere on the chart (e.g., top-right, bottom-left, center, etc.).
Key Features
1. Trend Strength Measurement: Quickly identify the strength and direction of the trend.
2. Divergence Detection: Spot potential reversals before they occur with bullish and bearish divergence signals.
3. Customizable Dashboard: Move the dashboard to your preferred location on the chart for better visibility.
4. User-Friendly Design: Clean visuals and intuitive color coding make it easy to interpret market conditions.
5. Actionable Signals: Provides clear Buy/Sell signals based on divergence, helping traders make informed decisions.
How to Use
1. Trend Confirmation:
Use the histogram and trend strength value to confirm the current market trend.
Green bars indicate a bullish trend, while red bars indicate a bearish trend.
2. Divergence Signals:
Look for divergence arrows (green for bullish, red for bearish) to anticipate potential reversals.
Combine divergence signals with other technical analysis tools for higher accuracy.
3. Dashboard Insights:
Monitor the dashboard for real-time updates on trend strength, direction, and the latest signal.
Use the "Last Signal" (Buy/Sell) to validate your trading decisions.
4. Custom Settings:
Adjust the EMA lengths and divergence lookback period to suit your trading style and timeframe.
Position the dashboard anywhere on the chart for convenience.
Best Practices
1. Use the TSM in conjunction with other indicators or price action analysis for confirmation.
2. Test the indicator on different timeframes to find the one that works best for your strategy.
3. Always practice proper risk management when trading.
Disclaimer
This indicator is a tool to assist in technical analysis and should not be used as a standalone trading strategy. Past performance is not indicative of future results. Always conduct your own research and consult with a financial advisor before making trading decisions.
DMI, RSI, ATR Combo// Usage:
// 1. Add this script to your TradingView chart.
// 2. The ADX line helps determine trend strength.
// 3. The +DI and -DI lines indicate bullish or bearish movements.
// 4. The RSI shows momentum and potential overbought/oversold conditions.
// 5. The ATR measures volatility, helping traders assess risk.