No. In the version of centered TMA you are using (the one you removed) the first parameter is TimeFrame. If you did not specify the "" after the "TMA" in a parameters of iCustom() call, it was not working as it should. You can leave out all the values for alerts in the iCustom() and then use it like this (after all you do not expect it to alert from the EA):
So, I shall use smth like this:
tma1 = iCustom(Symbol(), PERIOD_M15, "TMA", "", HalfLength, Price, ATRMultiplier, ATRPeriod, Interpolate, 0, 0, 0, 0, 0, 0, 0, 1);
(0=false for Alerts)
Yeah, I'm sorry! I thought that this is Your indie and You know it very well. It was TimeFrame as first parameter and before posting here I tried combining iCustom(Symbol(), 0, "TMA", 15 ... ) and iCustom(Symbol(), PERIOD_M15, "TMA", "", ... ) and so on. Although, I am not sure I had tried Your version iCustom(NULL, PERIOD_M15, "TMA", "", ...). Could it be just in using "NULL" instead of "Symbol()"?
That version of the indicator you first posted is also mine, so I do know how it works
Read my previous post for explanation
Yes, Mladen, it's a kind of pre-moderation, that's why I have missed Your previous post. Thanks for Your time, wish I knew it before ))
BTW, have I said "Thanks, Mladen, for such a great stuff?"
Why these things happen? Could You pass me a link to a thread with discussions on MTF indicators? It would be great!
Thanks again && have a good luck!
It is all about passing parameters.
An example : you indicator has parameters p1,p2, and p3. Yopu can call it in the following forms
// p1,p2 and p3 will have default values
double value1 = iCustom(NULL,0,"Your indicator",0,0);
// p2 and p3 will have default values
double value2 = iCustom(NULL,0,"Your indicator",p1,0,0);
// p3 will have default values
double value3 = iCustom(NULL,0,"Your indicator",p1,p2,0,0);
// no default values
double value4 = iCustom(NULL,0,"Your indicator",p1,p2,p3,0,0);
But you can not do, for example, this :
Since then p1 will receive value of p2 and that will cause unpredictable behavior
So, all you have to do is to take care that you do not omit any of the parameters from the beginning of the parameters list and everything will be OK.
Why these things happen?Could You pass me a link to a thread with discussions on MTF indicators? It would be great!
Hi again! I bet You missed me! :lol:
Thanks for explanation. It does have some reason, unfortunately I know that but something is still missed. I made some changes in EA. Now it is running in real-time on a graph and the same EA is being back-tested. In back test values are different from the graph painted, while real-time values returned into the EA are the same as the indicator on the graph. It's confusing!
"Ooops, I did it again."
Judging from the code you were posting, just a wild guess : you can not back-test multi time frame indicators and EAs the same way as the regular ones. In multi time frame mode metatrader is taking real data of the target time frame, not the simulated data. Take a look at this thread : https://www.mql5.com/en/forum/general and I am sure you will find a lot of answer as of how to back-test and what to expect during back-test
OK, thanks! So, let me guess, mtf indicators use "future" values, don't they? Then let us use IsTesting() and not letting the indicator use "future" data at all! Of course, we cannot artificially cut off the quotes stream of the testing engine, but probably we could prohibit the indie itself from using them. Earlier in this thread You mentioned that TMA is the same as LWMA, then we could use LWMA when IsTesting() == true. It could be a reason to add some functionality to the EA for testing. Any suggestions?
You mean we should "tweak" a little bit how metatrader works Good luck with it
PS: I told that "non repainting (end pointed) centered TMA is equal to LWMA" I never told that TMA (triangular moving average) is the same as LWMA (linear weighted moving average). TMA and LWMA are two different indicators
Good luck with it
Well, I will go further "looking for the sun".
I apologize, English is not my best performance.
Anyway, I'm gonna build my EA using TMA. The only bad thing is that the testing will be performed on a demo (or some cent) account.
Again thanks and have a good luck!