Thread: How to code?
View Single Post
  #62 (permalink)  
Old 04-15-2006, 04:09 PM
keris2112's Avatar
keris2112 keris2112 is offline
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 130
keris2112 is on a distinguished road
As I understand it, the best/easiest way to do it is going to be to look at the previous bar, as you have said. You may be late and you may not. Here's what I mean:

The Start() function processes every tick. MT4, by way of design, only processes time after a tick. That mean a new bar doesn't appear on your chart until the first tick of that new bar. So, as you near the end of a bar, if your alert goes off after every tick (the annoying way) you'll get an alert on the last tick of the bar. If you look to the previous bar for your alert (the non-annoying way), you'll get an alert on the first tick of the new bar.

So, during hours with a lot a market activity, the first tick of the new bar may take place immediately after the previous bar should be closing (based on time). During slow market hours, it could be 20-30 seconds before a new tick comes in, and MT 4 won't show you the new bar until you get that first tick.

I hope that's clear.

Keris
Reply With Quote