Re: Already Converted TradingView Indicators to MT4 Indicators

591
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
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! :thumbup:


Re: Already Converted TradingView Indicators to MT4 Indicators

592
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
The new version i didn't yet check, but it seems very pretty and better. Thank you :thumbup:

Re: Already Converted TradingView Indicators to MT4 Indicators

593
ummadirajani 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 here
//@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)
HI mrtools
please consider converting this trading view Indicator to mt4

Re: Already Converted TradingView Indicators to MT4 Indicators

594
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!
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?

Re: Already Converted TradingView Indicators to MT4 Indicators

595
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?
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.
These users thanked the author nwesterhuijs for the post:
FredericoA


Re: Already Converted TradingView Indicators to MT4 Indicators

596
ummadirajani wrote: Tue May 06, 2025 10:46 am please consider converting this trading view Indicator to mt4
Please read the first post, it would really help us out.
Myfxbook live trading results 📊

List of our most powerful reversal indicators + Guide to the "All Averages" Filters (ADXvma, Laguerre etc.)
Fibonacci numbers for indicator settings + How to draw Fibonacci Extensions + How to draw Support & Resistance

Re: Already Converted TradingView Indicators to MT4 Indicators

598
Akul82 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 :thumbup:
With DeepSeek (my skills for coding are poor :sweat: ) 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.
These users thanked the author Akul82 for the post:
marant