
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
Thanks for the post Yashar,
Your code looks much like mine for the most part, except you are running directly on a minute (M1) chart it seems...
Well after some additional testing I have determined part of my earlier confusion, it seems MQL5 calculates intersection points when there is no actual line intersection...as illustrated in the image attached below.
I have indicated the two lines in question labelled as "First Line" and "Second Line". The reported intersection time reads 2024.7.26 22:57:00, however this time occurs before the bar where the "Second Line" originates. In my image I have drawn a dotted blue line (labelled "Extended Line") which extends from the origin of the "Second Line" to the left ('back in time') to the indicated intersection point. I didn't realize before that MQL5 would create an intersection by 'extending' projections of lines on the chart, and that these 'extensions' could 'reach back' to a time period before the line was actually drawn on the chart. Obviously I will have to modify my code to ignore any reported intersections that are placed at a time before the creation of the "Second Line". I am only interested in intersections of lines that actually take place on the chart.
Another thing I have noticed after some additional testing...
In the attached image (with labels added as I did in my previous post) there is an intersection reported at 2024.4.20 17:37:51 (as before, extending 'back in time' to a point not only before the "Second Line", but before the "First Line" as well). I am a bit confused by this reported intersection time, because 2024.4.20 was a Saturday. This chart is a Daily ("D1") rather than a Minute ("M1") as in my previous post.
I thought non-trading days such as Saturday would not be reported on a MQL5 chart? I would have thought the previous trading day (Friday) should have been reported, which would have been 2024.4.19...???