Appsoluxions: I am not sure if it is my code or there's just a bug in iMA function itself
|
|
|
1.1 Thanks for the pointers on decorating code.
2.1. Why does it has it be found in decade? Is that the MQL rule?
2.2. It can be a PICNIC- I clearly stated that "I am not sure if it's my code" - I posted my code so that experts like you can help with resolve this PICNIC - If you cannot leave it other coders.
Thank you!
- en.wikipedia.org
Appsoluxions: Why does it has it be found in decade? Is that the MQL rule?
| Why would you think a bug would be hidden, never seen, for more a decade (when MT4 was first written,) not by the thousands of coders, but only you would find it?? |
Why would you think a bug would be hidden, never seen, for more a decade (when MT4 was first written,) not by the thousands of coders, but only you would find it?? |
Because I might have tested something that other coders have never tested - Oh! wait that's not possible in your world - Stereotypical . Well it's possible in my world...http://www.csoonline.com/article/2927441/application-security/11-software-bugs-that-took-way-too-long-to-meet-their-maker.html#slide1.
You have diverted my question to your personal arrogance. Don't bother respond - I found a temporary solution until I found out what I did wrong on the iMA for it to behave not as I expect. I used
iBands(NULL,0,55,2,0,PRICE_LOW,MODE_MAIN,0) |
to get the output I was expecting when using iMA.
See, I was busy looking for alternatives while you were busy personalizing my thread.
Please don't reply - you have said enough!
- By Phil Johnson
- www.csoonline.com
Let's talk about "personal arrogance".
//Test MA void testMa() { double previousEmaLevel = NormalizeDouble( iMA(NULL, 0, 55, 0, MODE_EMA, PRICE_CLOSE, 1), Digits); double previousClose = iClose(SYMBOL, CURRENT_TIMEFRAME, 1); if ( (previousClose > previousEmaLevel) ) { Print("MA BUY"); } else if ( (previousEmaLevel > previousClose) ) { Print("MA SELL"); }
iBands(NULL,0,55,2,0,PRICE_LOW,MODE_MAIN,0)
- Your sample code is meaningless because of:
- it always returns the same value - index 1.
- you compare that to the iBands value with a different index (0.)
- you compare that to the iBands value with a different price (PRICE_LOW)
- you compare that to the iBands indicator which uses simple moving average, while your code uses an exponential moving average
- we don't know if symbol and timeframe are the same because you didn't specify what SYMBOL and CURRENT_TIMEFRAME are
- You didn't print out the local variables to determine if indicators return correct values
- You didn't bother to provide an example that can be compiled and tested.
- Yet, you conclude that problem is in a moving average function which many traders use for a number of years.
- Bonus: it didn't occur to you to grab any of the moving average indicators from the codebase and compare it with iMA.
Yeah, I think you should continue with this attitude, that's the best strategy to get an answer.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there,
I am busy creating an EA that uses 55 EMA and the price close. It must perform some action when price closes above/below EMA 55. I have tested this and it sometime behaves in an unexpected manner. I am not sure if it is my code or there's just a bug in iMA function itself. The specific date used is 2017-01-03, where it Print("MA BUY"); but the price didn't close above EMA 55.
This is my code snippet
Please assist.
Thanks