Disliked{quote} @TopCover -- interesting you should bring up gaps... A gap indicator is feasible -- however I'm not the guy to provide the necessary details as to what to look for. I mean I could add code to detect gaps, but I'm not sure what it means. @TopCover -- you've been very good about sharing charts with excellent descriptions. Would you mind sharing another example. I know what a gap is and I've seen them, but I don't get the significance. Why are they a powerful target? At the expense of going off topic, I thought I'd share an anomaly in how MT4...Ignored
It's interesting that @TopCover just recently brought up the issue of gaps.
Back in post #1040 I wrote about ticks -- in particular comparing the most recent Open price versus the previous Close price. Most of the time they are exactly the same -- but sometimes they are different. I had always assumed this was simply an artifact of the data -- and it may be -- but there still could be something worth exploring here.
I wrote that Open ticks are guaranteed - meaning, your MT4 chart will receive a tick at exactly the beginning of a new interval. Originally I wasn't sure if that tick came from MT4 (i.e. it simply used the last Close tick) or whether a tick was sent by the broker. Since Close and Open ticks may occasionally differ, now I'm guessing the Open tick comes from the broker. The other point I made was that Close ticks are not guaranteed. Since the Close price is the last tick before the new time frame, then you don't know the true Close until the next time frame begins. This means there could be seconds, minutes, hours or even days between adjacent Close and Open ticks. This delta time difference between Close and Open prices leads to gaps.
To state it another way -- Open ticks have a precise time stamp -- the beginning of a new time frame. Whereas the time stamp of a Close tick is undefined. It can be any time. The time stamp of the last tick prior to a new time frame becomes the Close tick. Hence, there is a potential delta time between Close and Open ticks.
I used to think this delta time was pretty lame and should be considered a bug -- but after reading the reference posted by BlackStack I think not. If Open and Close ticks were both guaranteed -- i.e. the delta time was zero -- then we could never detect gaps. So, if it turns out that having the ability to detect gaps is a good thing, then I'm now glad there exists this delta time.
Let me take this a step further. As I mentioned, Open ticks are guaranteed to arrive at exactly the beginning of a new time frame. If ticks normally arrive randomly, what are the odds that a true tick would arrive exactly at 12:00.00? Probably pretty slim. So, now I'm thinking that the guaranteed Open ticks are just virtual ticks the broker sends at the beginning of a time frame to keep MT4 happy. After all, in order to represent OHLC data you have to define a starting point -- it can't be random.
If I were to write a gap detection algorithm I would be tempted to ignore the virtual Open ticks. In other words, the Close tick would be the last tick before the beginning of the new time frame, and the Open tick would be the first tick after the beginning of a new time frame (rather than the tick that arrives exactly at the new time frame). This would result in a larger delta time between adjacent Close and Open ticks. It would also likely increase the gap between adjacent Close and Open ticks. It might be this would create a total mess with gaps all over the place, or it might serve to highlight gaps that would otherwise go unnoticed.
Just a thought...
1