Yeah, i've been thinking about the same problem.
"Am I getting crazy? Was that supposed to behave like the original code? How can we differentiate the "don't vote" from the real "0" (I mean, 0 stating for no condition for buying)"
As you can see here:
https://www.mql5.com/en/articles/275
It seems that's the way different signals are weighted. The code multiplies the weight by the signal in the upper part of division, but doesn't consider it at the lower part of the division. So is not a normal average, nor a weighted one.
This looks so wrong to me.. If I'm backtesting I would like to give 0 weight to a sinal, and then see the signal disappearing of the signal chain.
I'm new to this (started trade a year ago, and a programming in mql5 yesterday) so I can be sounding nonsense here.
See ya
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello again!
Analyzing my EA I think that Direction function from ExpertSignal.mqh has a bug.
At the begining it states that if the result from checked signals for long and short position for a specified Signal is 0.0 (Ex.: SignalAC.mqh) this should not be conted for votes number at var number.
- 'int number=(result==0.0)? 0 : 1; // number of "voted" '
But, at the end of the function it simples put "number++" independent on Signal result. So, if you have any signal that has 'no objection' on Long/Short positions, and return 0.0, this still counts for the weighted algorithim making the final result goes wrong ( for arithmetic mean calculation!).
Let's peek an example:
- I have 2 Signals check: AC and BearsPower.
- AC.mqh return 90.0
- BearsPower return 0.0 (as stated in documentation this indicates no objection)
- The final calculation will be 45.0. But it should have been 90.0.
This will also happend for ITF, which was supposed to be just a filter.
I have modified the code, making the Direction function check if the direction variable is different from 0.0 BEFORE summing it as a vote, but I don't think that this solves the problem.
Am I getting crazy? Was that supposed to behave like the original code? How can we differentiate the "don't vote" from the real "0" (I mean, 0 stating for no condition for buying)
Another bug:
- I think that SignalAC calculation is also wrong...
Take a look at this code:
If the first bar is green and the second is red it stills return 90.0?
Thanks!