You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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