Re: [MM] MURREY MATH lines - Results are the name of the game.

324
Hi all,

I thoroughly searched the forum without success for an MQ4 Murrey Math lines indicator that draws not only the Murrey Math lines based on the current bar but that can also automatically draw the historical MM lines as shown in the screenshot below of the murrey_math_fixperiod.mq5 mq5 indicator that does this. Can someone please let me know if there is an mq4 indicator that can do this and if not, then can someone please convert the murrey_math_fixperiod.mq5 indicator below to mq4? Thank you very much and God bless.

Re: [MM] MURREY MATH lines - Results are the name of the game.

325
global wrote: Fri Jul 28, 2023 1:42 pm Hi all,

I thoroughly searched the forum without success for an MQ4 Murrey Math lines indicator that draws not only the Murrey Math lines based on the current bar but that can also automatically draw the historical MM lines as shown in the screenshot below of the murrey_math_fixperiod.mq5 mq5 indicator that does this. Can someone please let me know if there is an mq4 indicator that can do this and if not, then can someone please convert the murrey_math_fixperiod.mq5 indicator below to mq4? Thank you very much and God bless.


Image
Not sure if i can translate it or not but would need the custom indicator ""Murrey_Math" to start.


Re: [MM] MURREY MATH lines - Results are the name of the game.

327
UCS_Murrey's Math Oscillator

Code: Select all

// Created by UCSgears
// Modified the conceptual Murray Math Lines System overlay to an Oscillator
// Easier to add Alerts using an oscillator rather than an overlay
// Does provide some aesthetics, Will be improved as Time Progresses

study(title="UCS_Murrey's Math Oscillator", shorttitle="UCS_MMLO", overlay=false, precision = 2)
// Inputs
length = input(100, title = "Look back Length")
mult = input(0.125, title = "Mutiplier; 1/8 = 0.125; 1/4 = 0.25.....")
lines = input(true, title= "Show Murrey Math Fractals")
bc = input(true, title = "Show Bar Colors for Oversold and Overbought")
// Donchanin Channel
hi = highest(high, length)
lo = lowest(low, length)
range = hi - lo
multiplier = (range) * mult
midline = lo + multiplier * 4

oscillator = (close - midline)/(range/2)

scolor = oscillator > 0 and oscillator < mult*6 ? green : oscillator < 0 and oscillator > -mult*6 ? red : oscillator < -mult*6 ? blue : oscillator > mult*6 ? orange : na

plot (oscillator, color = scolor, title = "Murrey Math Oscillator", style = columns, transp = 60)
plot(0, title = "Zero Line", color = gray, linewidth = 4)

plot(lines == 1 ? mult*2 : na, title = "First Positive Quadrant", color = gray, linewidth = 1)
plot(lines == 1 ? mult*4 : na, title = "Second Positive Quadrant", color = gray, linewidth = 1)
p3 = plot(lines == 1 ? mult*6 : na, title = "Third Positive Quadrant", color = gray, linewidth = 1)
p4 = plot(lines == 1 ? mult*8 : na, title = "Fourth Positive Quadrant", color = gray, linewidth = 1)
plot(lines == 1 ? -mult*2 : na, title = "First Negative Quadrant", color = gray, linewidth = 1)
plot(lines == 1 ? -mult*4 : na, title = "Second Negative Quadrant", color = gray, linewidth = 1)
p2 = plot(lines == 1 ? -mult*6 : na, title = "Third Negative Quadrant", color = gray, linewidth = 1)
p1 = plot(lines == 1 ? -mult*8 : na, title = "Fourth Negative Quadrant", color = gray, linewidth = 1)

fill (p1,p2, color = orange)
fill (p3,p4, color = lime)

// Bar Color Oversold and Overbought
bcos = bc == 1 and oscillator > mult*6 ? orange : na
bcob = bc == 1 and oscillator < -mult*6 ? blue : na

barcolor (bcos)
barcolor (bcob)
Mladen did the original translation, I added a bunch of other stuff, including alerts, the upper/lower and zero quadrant lines, the upper/lower quadrant fill, and a choice of averages to smooth the oscillator.
These users thanked the author mrtools for the post (total 6):
Jedidiah, kvak, global, alif, thomdel, RodrigoRT7

Re: [MM] MURREY MATH lines - Results are the name of the game.

328
mrtools wrote: Sat Jul 29, 2023 1:34 am Not sure if i can translate it or not but would need the custom indicator ""Murrey_Math" to start.
Omg Mr Tools, I missed that. I did look through the code to see if there were any iCustom calls but I missed it. Looking at it again I see that there is in fact an iCustom call to the murrey_math.mq5 indicator, so I found it and attached it below together with the fixed period one again. I wish you all the best with the translation. Thanks. I tried my hands on mq5 to mq4 translations without success, except for very simple mq5 indicators, so for now more complicated ones are beyond me.

I have a question about iCustom calls, Which method is more efficient, using an iCustom call to call an indicator repeatedly as in this case with murrey_math_fixperiod.mq5, or rather, to include the code from the called indicator within the calling indicator maybe as a void function for better code readability? Thanks again Mr. Tools.

Re: [MM] MURREY MATH lines - Results are the name of the game.

329
global wrote: Fri Jul 28, 2023 1:42 pm Hi all,

I thoroughly searched the forum without success for an MQ4 Murrey Math lines indicator that draws not only the Murrey Math lines based on the current bar but that can also automatically draw the historical MM lines as shown in the screenshot below of the murrey_math_fixperiod.mq5 mq5 indicator that does this. Can someone please let me know if there is an mq4 indicator that can do this and if not, then can someone please convert the murrey_math_fixperiod.mq5 indicator below to mq4? Thank you very much and God bless.


Image
Thanks to Mr. Tools for pointing out to me that murrey_math_fixperiod.mq5 uses the murrey_math.mq5 to do it's calculations. I attached both files here. I was able to easily translate the murrey_math.mq5 into murrey_math.mq4 simply by changing the file extension to mq4 and initializing the i variable at the beginning of the start() function.

Unfortunately, I was unable to translate the murrey_math_fixperiod.mq5 to a working murrey_math_fixperiod.mq4 because it uses the CopyBuffer() and BarsCalculated() functions that are unique to mql5 only and not needed for mql4 indicators. It seems like all murrey_math_fixperiod.mq5 is doing different from murrey_math.mq5, is that it has an option to calculate the Murrey Math lines for any timeframe of your choice. If that timeframe option can be added directly into murrey_math.mq4 that would be much better, so if anyone can figure out how to do that, that would be great. Anyway, attached below are the original mq5 and my mq4 translated versions of the indicators.

One other point. I noticed that even if the same input values for CalculationPeriod=64 and StepBack=0 are used, the MM line prices displayed by murrey_math.mq4 don't match the lines displayed by other standard Murrey Math indicators and I don't know why. Test it yourself and you will see what I mean. I'm particularly interested in getting the murrey_math.mq4 line prices to match other standard MM indicator lines so I can see the historical line levels instead of only the most current levels so I can review how my closed trades interacted with those historical MM levels.
These users thanked the author global for the post (total 2):
RodrigoRT7, sizabici

Re: [MM] MURREY MATH lines - Results are the name of the game.

330
mrtools wrote: Sat Jul 29, 2023 4:21 am UCS_Murrey's Math Oscillator

Code: Select all

// Created by UCSgears
// Modified the conceptual Murray Math Lines System overlay to an Oscillator
// Easier to add Alerts using an oscillator rather than an overlay
// Does provide some aesthetics, Will be improved as Time Progresses

study(title="UCS_Murrey's Math Oscillator", shorttitle="UCS_MMLO", overlay=false, precision = 2)
// Inputs
length = input(100, title = "Look back Length")
mult = input(0.125, title = "Mutiplier; 1/8 = 0.125; 1/4 = 0.25.....")
lines = input(true, title= "Show Murrey Math Fractals")
bc = input(true, title = "Show Bar Colors for Oversold and Overbought")
// Donchanin Channel
hi = highest(high, length)
lo = lowest(low, length)
range = hi - lo
multiplier = (range) * mult
midline = lo + multiplier * 4

oscillator = (close - midline)/(range/2)

scolor = oscillator > 0 and oscillator < mult*6 ? green : oscillator < 0 and oscillator > -mult*6 ? red : oscillator < -mult*6 ? blue : oscillator > mult*6 ? orange : na

plot (oscillator, color = scolor, title = "Murrey Math Oscillator", style = columns, transp = 60)
plot(0, title = "Zero Line", color = gray, linewidth = 4)

plot(lines == 1 ? mult*2 : na, title = "First Positive Quadrant", color = gray, linewidth = 1)
plot(lines == 1 ? mult*4 : na, title = "Second Positive Quadrant", color = gray, linewidth = 1)
p3 = plot(lines == 1 ? mult*6 : na, title = "Third Positive Quadrant", color = gray, linewidth = 1)
p4 = plot(lines == 1 ? mult*8 : na, title = "Fourth Positive Quadrant", color = gray, linewidth = 1)
plot(lines == 1 ? -mult*2 : na, title = "First Negative Quadrant", color = gray, linewidth = 1)
plot(lines == 1 ? -mult*4 : na, title = "Second Negative Quadrant", color = gray, linewidth = 1)
p2 = plot(lines == 1 ? -mult*6 : na, title = "Third Negative Quadrant", color = gray, linewidth = 1)
p1 = plot(lines == 1 ? -mult*8 : na, title = "Fourth Negative Quadrant", color = gray, linewidth = 1)

fill (p1,p2, color = orange)
fill (p3,p4, color = lime)

// Bar Color Oversold and Overbought
bcos = bc == 1 and oscillator > mult*6 ? orange : na
bcob = bc == 1 and oscillator < -mult*6 ? blue : na

barcolor (bcos)
barcolor (bcob)
Mladen did the original translation, I added a bunch of other stuff, including alerts, the upper/lower and zero quadrant lines, the upper/lower quadrant fill, and a choice of averages to smooth the oscillator.
hello mr tools!!

Once again, I'm here exploring my ideas throughout the night!!

This indicator presents a unique proposal uniting the MM into an oscillator.

Is there the possibility of updating your averages + the traditional Reg MAs?

I combined it with the pivot smoothed Reg ma and it already gave great signs of OBOS.

Once again, thank you very much from s2, my list of incredible indicators is only growing.
These users thanked the author RodrigoRT7 for the post:
maroka


Who is online

Users browsing this forum: No registered users and 8 guests