Please advise - How to rewrite an indicator from Rulang to MQL4(four) ? - page 3

 
Urman Ru:

... "olyakish_fractals_01"...

Not a very good example for beginners. Very unconventional and extremely extravagant approach to writing indicators

 
Dmitry Fedoseev:

Not a very good example for beginners. A very unconventional and extremely extravagant approach to writing indicators

when you really need to, you have to take your trousers off over your head).

 
Alexey Viktorov:

I just don't understand one thing. In the title of the topic and in your first post you mention MQL5, but you got tips on MQL4 and you are happy to edit an indicator in MQL4. So what terminal do you need indicator for?

They are in different languages? What a joke!

On MT4, I checked!

If we take an indicator written in MQL4 for MT4, it will not work on MT5? And vice versa, too?

What a mess.

 
Dmitry Fedoseev:
And about Rulang, what was that?

Well I used to try to mimic a trader and I started on Rumus and the language there

I've tried to use that language for different indices, but I decided to switch to MT4 and bring it here, but it didn't work. I suggested to check "i+2" as well. But maybe I'm doing something wrong. Anything is possible.
 
Urman Ru:

When you really have to, you have to take your trousers off over your head).

And you don't have to put your trousers over your head so you don't have to take them off over your head.

Yes, it's a bit more complicated than the primus, but the possibilities are unlimited.

 
Dmitry Fedoseev:

And you don't have to put your trousers over your head so you don't have to take them off over your head.

Yes, it's a bit more complicated than the primus, but the possibilities are unlimited.

Alas, it doesn't work like a stone flower.(

 
Urman Ru:

Alas, no stone flower comes out.

Is it worth it? What is the formula in that indicator? Maybe you don't need to do anything? Maybe the standard Fractals would work?

 
Alexey Viktorov:

Is it worth it? What is the formula in that indicator? Maybe you don't have to do anything? Maybe a standard Fractals would work?

If the standard Fractal indicator fits, I would not be sitting all day and night trying to figure out how to paste this stubborn indicator into the terminal.

Thank you for your participation.

See for yourself what it is, you're an experienced programmer.
Files:
evlpcaVOL.mq4  13 kb
 
Urman Ru:

If a standard Fractal indicator would work, I wouldn't be sitting up all day and night trying to figure out how to insert this stubborn indicator into the terminal.

Thank you for your participation.

See for yourself what it is, you are an experienced programmer.

That's exactly the experience that prevents you from picking at anything trying to figure out what you were trying to write there. I just had a bout of charity and wanted to remember how to write on mql4. I think you know the theory that it's better to build than to rebuild. And it's cheaper and more reliable.

Now a couple of comments on your code:

ArrayInitialize(a_Fractal, 0);

Initializes the entire array with zeros. Those values, even if they were entered in the indicator buffer array, are nulled.

a_MFI[-1] = (High[-1] - Low[-1])/ a_Volume[-1];

The index numbering cannot be less than zero.

And if you're trying to designate specific bars over the entire history somehow, you should index with a variable, not a constant.

 
Alexey Viktorov:

It is precisely experience that prevents you from poking around trying to figure out what you were trying to write there. I just had a bout of charity and wanted to remember how to write in mql4. I think you know the theory that it's better to build than to rebuild. And it's cheaper and more reliable.

Now a couple of comments on your code:

Initializes the entire array with zeros. Those values, even if they were entered in the indicator buffer array, are nulled.

The index numbering cannot be less than zero.

And if you are trying to denote somehow specific bars throughout the history, you should index by a variable, not by a constant.

Hello Alexey. I guess I should consider myself lucky if you suddenly had a benevolent attack, but unfortunately the star was flying so fast that I didn't have enough time to make a wish.

I fixed something in the indicator, in particular a_MFI[i-1] = (High[i-1] - Low[i-1])/a_Volume[i-1] , but the flower has not opened.

Yes, you are right, made from scratch is always better than redone, if you know how to do it.

The essence of my idea.

We construct fractals on the basis of only GREEN bars, but not on High and Low, and on Volume and MFI, i.e. Fractal F(0) = V(0)>V(1) and V (0) >V(2) and V (0) >V(-1) and V (0) >V(-2) and MFI(0)>MFI(1) and MFI (0) >MFI(2) and MFI (0) >MFI(-1) and MFI (0) >MFI(-2), if Fractal F(0) itself is Close ( 0) >Open (0), then Fractal F(0) upwards, if Close (0) <Open ( 0), then Fractal F(0) is downwards and then it is necessary to draw support and resistance lines by these Fractals; it is interesting that value (i) is actual up to (5) , after it the fractals repeat. I implemented that idea in Rulang in Rumus, but what I wrote in Rulang is not readable in MT4 for some reason, what a pity.

Here is how it looks like in Rulang, feel the difference:

Variable : Lev1($data),Lev2($data);
n=inparam("n",1,10000000,1);

Lev1=ref(Lev1,-1);
Lev2=ref(Lev2,-1);

if h>l then k=(h-l)/v;
if h>l and v>ref(v,-1) and v>ref(v,-2) and v>ref(v,+1) and v>ref(v,+2) and k>ref(k,-1) and k>ref(k,-2)and k>ref(k,+1) and k>ref(k,+2) then fv=v;
if h>l then f=fv;
x=HV(f,n);
if f=x and c>o then Lev1=h;
if f=x and c<o then Lev2=l;
Lev1;
Lev2;

Since I'm not an expert in MQL4 I had to look for an indicator similar to mine in numbers and letters and I found "olyakish_fractals_01" but it has another idea and I decided to rewrite it but alas I failed.

If you suddenly feel another attack of charity, you can look it and give me advice what I've rewritten, or just write an indicator, no matter how the hell while God is sleeping.

Regards!

Files:
Reason: