Thanks, the improved version produces the same output of original version, but it works better and after the compilation the there is no "warning". Good work!nwesterhuijs wrote: Mon May 05, 2025 8:44 pm Check the third option in the inputs: "MaxBarsMulti" or "Max Bars ..."
Introduced it as an multiplier of Trend Length to make it easier wrt consistency checks. A "0"-value will ignore this feature and for me at a value of 4 one quickly sees the impact of limiting bars, hence defaulted to 10 for the time being. Also changed Indicator Prefix to "222" so one can drag and drop both version 1 and 2 onto a chart and compare them.
Relative_Trend_Index_v2.mq4
And some additional price options and Jurik smoothening of RTI (set Length to 1 to have original):
Relative_Trend_Index_v4.mq4
Top sub-window no smoothening (v2) and bottom sub-window has Jurik smoothening (v4):
2025-05-05 15_55_04-2796399_ Afterprime-Demo AP - Demo Account - Afterprime Ltd - [EURUSD,H1].png
Re: Already Converted TradingView Indicators to MT4 Indicators
592The new version i didn't yet check, but it seems very pretty and better. Thank younwesterhuijs wrote: Mon May 05, 2025 8:44 pm Check the third option in the inputs: "MaxBarsMulti" or "Max Bars ..."
Introduced it as an multiplier of Trend Length to make it easier wrt consistency checks. A "0"-value will ignore this feature and for me at a value of 4 one quickly sees the impact of limiting bars, hence defaulted to 10 for the time being. Also changed Indicator Prefix to "222" so one can drag and drop both version 1 and 2 onto a chart and compare them.
Relative_Trend_Index_v2.mq4
And some additional price options and Jurik smoothening of RTI (set Length to 1 to have original):
Relative_Trend_Index_v4.mq4
Top sub-window no smoothening (v2) and bottom sub-window has Jurik smoothening (v4):
2025-05-05 15_55_04-2796399_ Afterprime-Demo AP - Demo Account - Afterprime Ltd - [EURUSD,H1].png
Re: Already Converted TradingView Indicators to MT4 Indicators
593HI mrtoolsummadirajani wrote: Thu May 01, 2025 5:28 pm hi mrtools
is it possible to convert this trading view indicator to mt4 Indicator
I am attaching the code hereCode: Select all
//@version=6 indicator('ATR Based Zigzag w EMA', overlay = true) // === Inputs === ATRLength = input(14, title = 'ATR Length') ATRMult = input(5.0, title = 'ATR Multiplier') lineSmoothLength = input(50, title = 'Line Smoothness (EMA Length)') upTrendColor = input(color.rgb(0, 255, 132), title = 'Uptrend Line Color') downTrendColor = input(color.rgb(255, 0, 0), title = 'Downtrend Line Color') // === ATR Calculation === atr_val = ta.atr(ATRLength) // === State Variables === var float LL = na var float HH = na var int trend = 1 // === Initialization === LL := na(LL[1]) ? low : LL[1] HH := na(HH[1]) ? high : HH[1] trend := na(trend[1]) ? 1 : trend[1] // === Core Logic === if trend > 0 // Uptrend: looking for new swing low if high >= HH HH := high HH else if low < HH - atr_val * ATRMult trend := -1 LL := low LL else // Downtrend: looking for new swing high if low <= LL LL := low LL else if high > LL + atr_val * ATRMult trend := 1 HH := high HH // === Median Price (or pick a price base you prefer) === medianPrice = (high + low) / 2 // === Smoothed Line === smoothLine = ta.ema(medianPrice, lineSmoothLength) // === Plotting the Clean Trend Line === plot(smoothLine, color = trend == 1 ? upTrendColor : downTrendColor, linewidth = 3, title = 'Trend Line') // === (Optional) Bar Coloring Too === barcolor(trend == 1 ? upTrendColor : downTrendColor)
please consider converting this trading view Indicator to mt4
Re: Already Converted TradingView Indicators to MT4 Indicators
594Cool indicator, I tried using Claude AI to code some audio alerts but with no success... Could you please take a look at the code?nwesterhuijs wrote: Mon May 05, 2025 5:57 pm My attention was caught by this one. Shading works a bit nicer in TV, so replaced by either histogram or lines in MT4, depending on the setting.
2025-05-05 11_51_43-2796399_ Afterprime-Demo AP - Demo Account - Afterprime Ltd - [EURUSD,H1].png
High_Low_Cloud_Trend.mq4
Enjoy!
Re: Already Converted TradingView Indicators to MT4 Indicators
595Did not look at your code, but just added the alert function normally put at Forex Station. In theory it should work, but have not tested it myself yet, so be mindful of that.FredericoA wrote: Wed May 07, 2025 12:42 am Cool indicator, I tried using Claude AI to code some audio alerts but with no success... Could you please take a look at the code?
- These users thanked the author nwesterhuijs for the post (total 2):
- FredericoA, boytoy
Re: Already Converted TradingView Indicators to MT4 Indicators
596Please read the first post, it would really help us out.ummadirajani wrote: Tue May 06, 2025 10:46 am please consider converting this trading view Indicator to mt4
Re: Already Converted TradingView Indicators to MT4 Indicators
597ATR Based Zig Zag with EMAummadirajani wrote: Tue May 06, 2025 10:46 am HI mrtools
please consider converting this trading view Indicator to mt4
Hello, could you please verify if this is close to the TV version.
What is the ATR Based Zig Zag indicator?
This code was originally published on TradingView by HabibiBudo as a refined trend-following tool for traders seeking clear trend signals. It uses an "ATR breakout method" to determine the market trend and incorporates a smooth EMA line for visual trend direction.
The indicator monitors new swing highs and lows using ATR volatility thresholds. A significant price move against the trend, exceeding a distance multiplied by ATR, signals a trend reversal. This method ensures trend changes are based on key volatility movements rather than random price fluctuations.
How is this different from using the Zig Zag?
Rather than showing a bunch of zigzag pivots that can make things look messy, this indicator creates a clean, smooth EMA line based on the average price
((high + low) / 2). The line changes color right away depending on the trend: green (or any color you choose) for when prices are going up, and red for when they're going down.Re: Already Converted TradingView Indicators to MT4 Indicators
598With DeepSeek (my skills for coding are poorAkul82 wrote: Mon May 05, 2025 10:11 pm The new version i didn't yet check, but it seems very pretty and better. Thank you![]()
for the calculation of standard variation you can choose "simple calculation of SMA or recursive moving average, as you implemented;
today i decided to implement Parabolic Sar on indicator, with very conservative setting (0.006 and 0.015).
I share the indicator (can you check please the code? It works well, but is AI, human coders 100000000000000000000 times better
P.S. i allegate a screen: as you can see, RTI is a good indicator to confirm price-action, and Parabolic Sar can help a trader to follow the trend and according to trendline (in price and RTI) can give a signal to reverse.
Re: Already Converted TradingView Indicators to MT4 Indicators
599As indicated in my post, if smoothing period is set to 1, it will not do anything and act as the original and as such, the code is suitable for those who do not want to use smoothening. Forex Station has a generic SAR function that is easier for me to use.Akul82 wrote: Thu May 08, 2025 3:09 am With DeepSeek (my skills for coding are poor) i modified the indicator: as you can see, i deleted the part of Jurik-smoothing (it is unuseful for me, the aim of this indicator is confirmation of price-action);
for the calculation of standard variation you can choose "simple calculation of SMA or recursive moving average, as you implemented;
today i decided to implement Parabolic Sar on indicator, with very conservative setting (0.006 and 0.015).
I share the indicator (can you check please the code? It works well, but is AI, human coders 100000000000000000000 times better, maybe it will be useful for anyone to test.
P.S. i allegate a screen: as you can see, RTI is a good indicator to confirm price-action, and Parabolic Sar can help a trader to follow the trend and according to trendline (in price and RTI) can give a signal to reverse.
Note: Alert function has been left untouched. Google for "Parabolic marsi adaptive MACD (alerts +mtf).mq4" on Forex-Station to get an example of how to modify the alert function.
- These users thanked the author nwesterhuijs for the post:
- chris006
Re: Already Converted TradingView Indicators to MT4 Indicators
600Great indicator.. works real well and the mean reversion zones are on pointnwesterhuijs wrote: Wed May 07, 2025 3:11 pm Did not look at your code, but just added the alert function normally put at Forex Station. In theory it should work, but have not tested it myself yet, so be mindful of that.
High_Low_Cloud_Trend_wAlert.mq4
- These users thanked the author boytoy for the post (total 2):
- RodrigoRT7, Jimmy