New metatrader 4 compatible indicators - page 43

 
Tzuman:
MLaden, MrTools.

I am using a variant of the attached Super Smoother MACD and am encountering a subscripting problem for negative numbers in the following code:

i = Bars-i-1;

int s = instanceNo*2;

workSsm[s+_price] = price;

//Note by Tzuman: invalid subscript of -1 & -2 when i=BARS for i, i-1,i-2

workSsm[s+_ssm] = workSsmCoeffs[_c1]*(workSsm[s+_price]+workSsm[s+_price])/2.0 +

workSsmCoeffs[_c2]*workSsm[s+_ssm] +

workSsmCoeffs[_c3]*workSsm[s+_ssm];

I'm wondering if the subscript reversal is necessary?

I made a couple of changes to declare integers prior to loops and if statements rather than inside to correct scope problems. The full code is attached.

Thanks,

Tzuman

ps this is the cause of my #property strict issue I found earlier today

Tzuman

Here is a version that works OK

As of arrays : no, it would not be better. I was trying to do so when I was solving the problem of necessary calculating buffers, but then, cases when the array should be resized, you have to do the

ArraySetAsSeries(array,false);

ArrayResize(arraySize);

ArraySetAsSeries(array,true);

since metatrader had problems resizing arrays set as series properly, and then you might encounter 2 issues :

  1. it is not sure that the job will be done as it should (that the correct values are going to be at correct indexes - there were some builds of metatrader that messed up the whole array after that)
  2. the builds that did that correctly took ages for that (my guess is that they copied values 1 by 1 in order to keep the original contents of the array elements)

So I decided to use classical C like arrays (and metatader 5, btw) and am using them this way ever since wth no issue at all. It is fast, simple to use once when you get used to it and in some cases I could be able to use equivalent of over 200 buffers that way (imagine just the upper block of code done on all those 200+ arrays)

Now, with strict applied we shall have some work to do, but admit it - it is due to us (coders) being lazy at the first place when the original code was written so we skipped the necessary checks. Man, when I think what would C/C++ do to me if I would do something like that using it - it was able to kill windows when array elements were addressed improperly

 
mladen:
Yash Can you post, as a link or as an attachment, the version that you are using?

Thanks for your reply, here is the attachment, regards

Files:
 
ybhattacharyya:
Thanks for your reply, here is the attachment, regards

Ybhattacharyya, would need the mq4 file before it can be modified.

 
mrtools:
Ybhattacharyya, would need the mq4 file before it can be modified.

here is the mql file, thank you

Files:
 

Hi all,

Good day, possible to convert the attached indicator to use on new MT4 version or similar function better indicator?

Thank you.

Files:
 
alvinkon:
Hi all,

Good day, possible to convert the attached indicator to use on new MT4 version or similar function better indicator?

Thank you.

It could be if it was an original source code. That is a decompiled code. Do you have the original source code?

 

Hi Mladen, sorry, I don't have. It's ok, thanks anyway.

By the way, do you have any similar simple indicator that show currency strength on chart? Thanks

 
ybhattacharyya:
here is the mql file, thank you

ybhattacharyya

You do not need to convert anything in that indicator. The only thing you have to make sure that the ZigZagDepth is greater than 3 (ZigZag will not work if back step is smaller or equal than ZIgZag depth - that is why it does not show any results). In the "old" metatrader 4 it worked OK even in that case but new metatrader 4 does not allow it

PS: you have to have ZigZag indicator in the indicators folder to make the indicator work

PPS: here is how that indicator looks like on chart when depth is set to 4. No changes in the code at all

Files:
123_pattern.gif  74 kb
 
mladen:
ybhattacharyya

You do not need to convert anything in that indicator. The only thing you have to make sure that the ZigZagDepth is greater than 3 (ZigZag will not work if back step is smaller or equal than ZIgZag depth - that is why it does not show any results). In the "old" metatrader 4 it worked OK even in that case but new metatrader 4 does not allow it

PS: you have to have ZigZag indicator in the indicators folder to make the indicator work

PPS: here is how that indicator looks like on chart when depth is set to 4. No changes in the code at all

Thanks a lot, its a great help, regards.

 
mladen:
hotchilox

"Jaguar" is a decompiled XO indicator. When correctly coded, XO does not repaint, and since "Jaguar" is my XO indicator renamed to that funny name (in order to be sold), it does not repaint (just remove the stupid fixed minimum and maximum that someone placed on that indicator which should not be there at all and you shall see that it does not repaint).

All the best

Thank you so much for explanation Sir Mladen, u are the best

One more thing please, where i can find XO indicator?