One of the fun thing with price movement analysis is how easy one gets confused
about "time".
Especially, one might easily believe that a decoration placed over a time index,
say "2007.10.04 15:33", was indeed placed there at that time, whereas
it may have been placed there at anytime: before that time or after that time,
and it may have been placed and removed and placed there again many times.
And one might believe that PRICE_CLOSE refers to the last tick value of that bar,
whereas it actually refers to the "so far last" tick value; bar 0 starts off with a single tick (which is its last tick
for a moment), then there is a second tick, then a third, a fourth, etc., up to
however many transactions there happens to be during the bar 0 time span. The start()
function (of EA or indicator) is invoked for each tick, and at each invocation,
PRICE_CLOSE of bar 0 refers to the value of the triggering tick. (You can ignore
the caveats in this for very slow start functions). So basically, a "false"
signal is merely a Macd computation on a partial bar, and the only way to be certain
to avoid them is to avoid referring to PRICE_CLOSE of bar 0.
By phy's suggestion, your code would refer to the Macd computation as soon as it
can after bar 0 completion, which is when bar 0 all of a sudden has got shifted
to be bar 1. At this time, the new bar 0 has a single tick, and the previous bar
0 is called bar 1. In short: the very first time your code discovers the crossover
is the very first time (in real time) you/it can be 100% sure that it is not a
false signal. And vice versa.
Though, personally I would actually draw the arrow on bar 0 so that the time of
the arrow indicates when the arrow was drawn rather than the bar during which the
crossover occurred. In that way the arrow placements represent the analytical result
timing rather than pointing at which data was used.
And, I think that all this gets conceptually easier by always referring to PRICE_OPEN
instead, and simply never, ever look at PRICE_CLOSE.
Ok Rich, I think I've got it. A follow-up question, do you think a crossover signal
is more reliable in one period then another? The only periods I'm considering is
M1 and M15.
Given that a signal is a computed representation of an actual past, there is no
question about reliability, is there?
Or do you refer to the "false signals" (which you still get because you
haven't followed phy's advice) and the likelihood that a premature signal stays?
Or do you refer to interpreting the signals as trade suggestions, and the potential
of success in this?
No, I've made the changes. What I was referring to was "signals as trade suggestions,
and the potential of success" from the different time periods. No worries,
I'll just start collecting my own data for analysis.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Especially, one might easily believe that a decoration placed over a time index, say "2007.10.04 15:33", was indeed placed there at that time, whereas it may have been placed there at anytime: before that time or after that time, and it may have been placed and removed and placed there again many times.
And one might believe that PRICE_CLOSE refers to the last tick value of that bar, whereas it actually refers to the "so far last" tick value; bar 0 starts off with a single tick (which is its last tick for a moment), then there is a second tick, then a third, a fourth, etc., up to however many transactions there happens to be during the bar 0 time span. The start() function (of EA or indicator) is invoked for each tick, and at each invocation, PRICE_CLOSE of bar 0 refers to the value of the triggering tick. (You can ignore the caveats in this for very slow start functions). So basically, a "false" signal is merely a Macd computation on a partial bar, and the only way to be certain to avoid them is to avoid referring to PRICE_CLOSE of bar 0.
By phy's suggestion, your code would refer to the Macd computation as soon as it can after bar 0 completion, which is when bar 0 all of a sudden has got shifted to be bar 1. At this time, the new bar 0 has a single tick, and the previous bar 0 is called bar 1. In short: the very first time your code discovers the crossover is the very first time (in real time) you/it can be 100% sure that it is not a false signal. And vice versa.
Though, personally I would actually draw the arrow on bar 0 so that the time of the arrow indicates when the arrow was drawn rather than the bar during which the crossover occurred. In that way the arrow placements represent the analytical result timing rather than pointing at which data was used.
And, I think that all this gets conceptually easier by always referring to PRICE_OPEN instead, and simply never, ever look at PRICE_CLOSE.
* waits for "Yes, but..."
E
Again, thanks a ton,
Ed
Thanks again,
Ed
Given that a signal is a computed representation of an actual past, there is no question about reliability, is there?
Or do you refer to the "false signals" (which you still get because you haven't followed phy's advice) and the likelihood that a premature signal stays?
Or do you refer to interpreting the signals as trade suggestions, and the potential of success in this?
Thanks,
Ed