hellomuthu23

EMA Envelope - Signal with Stoploss and Takeprofit Levels

hellomuthu23 Mis à jour   
ema
Description:
This Pine Script indicator implements the EMA Envelope strategy, which utilizes Exponential Moving Averages (EMA) to create an envelope around the price chart. The strategy generates buy and sell signals based on the crossing of the price above and below the upper and lower EMA envelopes, respectively. It also incorporates additional features such as stop-loss and take-profit levels for risk management.

Indicator Settings:

  • EMA Length: Specifies the period for the short-term Exponential Moving Average.
  • Long Term EMA Length: Defines the period for the long-term Exponential Moving Average used for signal filtering.
  • Take Profit Ratio: Determines the ratio for calculating the take-profit levels based on the stop-loss.
  • Filter Signal on Long Term EMA: Enables or disables the filtering of buy/sell signals using the long-term EMA.
  • Show only recent signal: When enabled, shows only the most recent buy/sell signals.


Buy and Sell Signals:
The indicator generates buy signals when the price crosses above the upper EMA envelope and the previous low was below the upper EMA envelope. Additionally, you can choose to filter buy signals based on whether the closing price is above the long-term EMA.

Conversely, sell signals are generated when the price crosses below the lower EMA envelope, and the previous high was above the lower EMA envelope. Similar to buy signals, sell signals can also be filtered using the long-term EMA.

Note: Signal works well on Higher Timeframes like Daily/8hrs/4hrs/1hr.

Stop-Loss and Take-Profit Levels:
For buy signals, the stop-loss is set at the lower EMA level, while the take-profit level is calculated by adding a specified ratio of the difference between the low and the stop-loss level to the low price.

For sell signals, the stop-loss is set at the upper EMA level, and the take-profit level is calculated by subtracting a specified ratio of the difference between the stop-loss level and the high price from the high price.

Disclaimer:
This indicator is provided for educational and informational purposes only. Trading involves significant risk, and past performance does not guarantee future results. Users are solely responsible for their trading decisions and should conduct their own research and risk management. The author shall not be held liable for any losses or damages arising from the use of this indicator.

Note: Always test the indicator thoroughly on historical data and consider paper trading before applying it to live trading environments.
Notes de version:
Added comments
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?