Inconsistent Results
-
Hi,
Do you know why this ea is responding to some crossovers but not others? There are candles where candle close[0] definitely crosses below ma3 but the ea does not pick it up. For example, 25-feb-14 on the D1 TF. Also, 17-jan-14, 01-aug-2000 on the D1 TF. Does the candle need to cross over the ma3 line a certain amount in order to trigger the orange output of block 1? What I noticed is that if the candle previously in the bar crossed over ma3 a little bit and then crosses over again, the orange output of block 1 will not pass.
http://fxdreema.com/shared/tYv47Gn1e
Thank you

-
... follow up thought from previous post: what is the difference between using the cross below symbol "X<" and the below "<" symbol? When I use "<" in the above example instead, it gives accurate results. In general, isn't the candle "going below" the ma3 technically a crossover?
-
Crossover is to have Close[0] below MA3[0] and Close[1] above MA3[1]. This is what I got: http://prntscr.com/2rrx6g
On 17 jan Close is deep below MA3, but Close of 16 jan is also below. At least this is the algo that is used now, which is maybe not "correct" in every situation. If for example we have to compare Close[0] with MA[0] and Open[0] with MA[0], maybe another wrong situations will appear. There is another possible way - to compare the current Bid with the current MA and the previous Bid with the current MA, and this will give us 1-time signals... I think this is for a block like "Price cross indicator".
Obviously there are number of ways to do something. What is the right way to detect crossover in your opinion? -
ok interesting. need to digest this info. and will get back about what I think is the right crossover algorithm
-
when I think of crossover, I think of simply "does indicator A cross over indicator B at a given point?" so comparing this to the previous candle's close would make this statement false if candle[1]'s close is also "crossed over" ma3. But translating the above statement to "is indicator A < indicator B" will be true every tick even after candle crosses over ma3. So:
__compare the current Bid with the current MA and the previous Bid with the current MA, and this will give us 1-time signals... I think this is for a block like "Price cross indicator".[/quote:3cozblbe]
yes, I think this is the right wayand, as before, instead of "crossover width" option, I think the best thing is to have an option to check for crossover in previous n ticks/bars/minutes, etc. (in addition to detecting crossover in current tick)
-
I tried to build it but it's not working correctly - it is drawing an arrow even if previous tick was not on opposite side of ma3:
-
I think in your project you don't need to set MA shift to 1
-
I set it back to 0 but it's still not working.
Out of curiousity, is there a way to specify previous tick for indicators?
-
No. Normally there is no way to set previous tick for price, but I added a function to collect this data, which also makes the EA to run a bit slower on backtest
It's not impossible in theory, but is it needed?I have some arrows out of this project with MA shift 0

-
it's drawing arrows before crossover happens (see screenshot). Previous tick for MA would be useful in order to make the crossover detection accurate. Otherwise, wouldn't it be comparing bid tick[1] with ma3 tick[0]?
......
ScreenClip.png -
Ah, this is because the compare sigh in block 1, it's wrong. But otherwise I found that the returned value of tick 1 is the same as tick 0. Try with tick 0 and 2, or even bigger difference.
-
oops - good eyes. I corrected the sign in block one and now it detects the crossovers even with tick 1 but something is still not correct because it's drawing many arrows on the same tick/second (see attached screenshots of journal and chart). In the meantime, I built the crossover system using candle close[0], "<", variables and counters and it works exactly right. The "price cross indicator" block as you suggested comparing bid and MA of current and last bar would still be preferable. If tick 0 and tick 1 are the same then orange output would not pass but wouldnt' there have to be cases where tick 0 is less than tick 1?
......
multiple arrows.png
journal.png -
I think this is because MA also goes up/down when the price goes up/down and the crossover extends itself. Maybe Once per bar can help? Or maybe some tolerance.