OPEN-SOURCE SCRIPT

Ema plus DS


снимок

Greetings everyone! I've been thoroughly enjoying refining this strategy over the past few weeks. After much hard work and dedication, I am finally ready to release it to the public and share what I have been diligently working on.

This strategy enables you to see an entry and exit in a trade. The logic behind this is to identify potential support and resistance levels based on fractal swing highs and swing lows and validate these levels using ATR analysis.


The Ema+ :
This calculates the Exponential Moving Average (EMA) using the “Close” value and length of “50”. It plots the calculated EMA on the chart, The Ema color is determined by a ternary operator that checks if the previous close price is greater than the EMA and the current close price is also greater than the EMA, in which case the color is set to green, otherwise it is set to red.

The Dynamic Structure DS:
Identifies support and resistance zones based on fractal swing highs and swing lows, as well as Average True Range (ATR) analysis. The script takes several user inputs, including the ATR movement required, the lookback period for detecting swing highs and lows, the maximum zone size compared to ATR, the zone update count before reset, and a boolean flag to determine whether to draw the previous structure (i.e., support-turned-resistance and resistance-turned-support).

This script uses the ta.atr() function to calculate the ATR value for a given period (default is 14). It then detects fractal swing highs and swing lows based on the highest and lowest bodies of candles, respectively, within the specified lookback period. If a swing high or swing low is detected, the script calculates the potential resistance and support levels based on the difference between the swing high/low and the previous swing high/low.

It also checks for significant declines and rallies since detecting the swing highs and swing lows, respectively, based on the ATR movement required. If a significant decline or rally is detected, the script stores the previous resistance and support levels in variables and updates the current resistance and support levels in variables.

And It logic for counting the number of times a resistance or support level has been violated without being reset. If a resistance or support level has been violated, the script resets the search for new resistance or support levels.

This script also includes logic for checking if the previous resistance or support level has been violated, and resetting the potential resistance or support levels if they have been. It also includes logic for drawing the previous structure (i.e., support-turned-resistance and resistance-turned-support) based on user input.

Overall, this script aims to identify potential support and resistance levels based on fractal swing highs and swing lows and validate these levels using ATR analysis, while also providing functionality for resetting the search for new levels if the previous levels have been violated.

I sincerely appreciate your efforts in giving my strategy a try. Wishing you the utmost success in your endeavors. Don't forget to follow me for future updates!
Candlestick analysisChart patterns

Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Хотите использовать этот скрипт на графике?

Отказ от ответственности