Regular visitors will have noticed ever increasing amounts of spam on the Trading Gurus Community Forum. On November 24th 2012 we implemented some changes:

1. New users will be moderated 2. Registered users who have a post count of zero will not be able to view attachments or download code. 3. Registered users who have a post count of zero will not be able to create a new thread

As an additional countermeasure we anticipate introducing a modest paywall in the near future.

If this is your first visit here our apologies for the inconvenience.

Existing users may wish to contribute their ideas to this thread.

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Logging MT4 Ticks, Spreads and Delays

  1. #1
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    492

    Logging MT4 Ticks, Spreads and Delays

    GuruLoggerCSV is an indicator that logs every tick the chart it's attached to receives from your MetaTrader 4 broker to a CSV format text file. If you like it will log the spread and the time with millisecond resolution as well. This will use up several Mb of your hard disk drive per pair per broker per day. If that seems a bit excessive you can configure it to save separate OHLC bars for bid and ask prices instead. You can also easily change it into an EA that will log bars or ticks during a backtest, which can make enlightening viewing.

    We've also recently cloned a bit of the BAA indicator and grafted it on so that this indicator can now also make farmyard noises. In this case it does so if the timestamp on quotes from your broker gets too far out of line with the clock on the computer on which you're running MetaTrader. This can make enlightening listening!

    This is the first version we've released in public, so it may well contain a bug or two. If you discover any please advise us of that fact by commenting on this thread.

    Here is the source code, together with a brief manual:
    Attached Files Attached Files
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  2. #2
    Junior Member Mintaka's Avatar
    Join Date
    Apr 2010
    Posts
    29

    Talking GuruLogger on Alpari UK

    Dear Jim,

    I set up the GuruLogger indicator running on Meta Trader 4 - Alpari. I am running it on two different pairs. GBP/USD and EUR/USD. I think, I have got some interesting results so far.
    The time differences are between 3 and 7 seconds.

    Code:
    15:05:53 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 3 seconds at 2011/08/22 15:05:53.763. Server time = 16:05:50
    15:05:53 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 3 seconds at 2011/08/22 15:05:53.855. Server time = 16:05:50
    15:51:48 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 3 seconds at 2011/08/22 15:51:48.355. Server time = 16:51:45
    15:51:48 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 3 seconds at 2011/08/22 15:51:48.377. Server time = 16:51:45
    15:54:20 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 6 seconds at 2011/08/22 15:54:20.578. Server time = 16:54:14
    15:54:20 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 6 seconds at 2011/08/22 15:54:20.600. Server time = 16:54:14
    15:58:36 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 7 seconds at 2011/08/22 15:58:36.569. Server time = 16:58:29
    15:58:36 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 3 seconds at 2011/08/22 15:58:36.601. Server time = 16:58:33
    15:59:44 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 7 seconds at 2011/08/22 15:59:44.377. Server time = 16:59:37
    15:59:44 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 7 seconds at 2011/08/22 15:59:44.399. Server time = 16:59:37
    16:00:31 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 4 seconds at 2011/08/22 16:00:31.343. Server time = 17:00:27
    16:00:31 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 4 seconds at 2011/08/22 16:00:31.364. Server time = 17:00:27
    23:27:40 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 6 seconds at 2011/08/22 23:27:40.461. Server time = 00:27:34
    If you can see sometimes the long time delay for the two pairs happens at the same time, but sometimes not.
    I have a question what are the consequences for my trading results.
    By the way, the baar and heehaw are very annoying - very funny!
    If you keep your mind humble, pride will vanish like morning mist - Dilgo Khyentse Rinpoche

  3. #3
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    492
    Hi Mintaka,

    I'm pleased to hear you enjoy Ray's robotic sense of humour! A couple of questions for you if I may:

    1. Were those results obtained from a demo account, a live classic account, a micro account?

    2. Were you running your MT4 instance on a VPS in the UK, a VPS in the US, or at home on your own PC connected to the global internet via broadband, cable or whatever?

    3. Imagine that you were attempting to short cable as the price dropped quickly at 16:54:20 Alpari time yesterday. You clicked the "Sell" button whilst your order ticket was displaying a price that was already 6 seconds out of date. What would have happened next, do you suppose?

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  4. #4
    Junior Member Mintaka's Avatar
    Join Date
    Apr 2010
    Posts
    29
    Hi Jim, something interesting happened today. I wanted to test pippa_D1_mover_GuruEx01 on Meta Trader - Alpari UK - Demo Account. It happens that I am running Guru Logger CSV on one pair USD/JPY. I went to the History Center to check the database for EUR/USD. When the program was searching for the data the Guru Logger CSV made a few incredible nice noises. The time delay was 17 second. I had closed the History Center and the heehaw sounded again. This time 21 second delay. I wonder is it just random coincidence or something wrong with the Meta Trader.
    21 second delay can cause lots of money troubles.
    If you keep your mind humble, pride will vanish like morning mist - Dilgo Khyentse Rinpoche

  5. #5
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    492
    Morning Mintaka,

    Long delays can indeed cause money troubles! Your results do seem to suggest that MetaTrader 4 isn't terribly good at doing more than one thing at once. I highly recommend doing development and testing on one instance of MT4, and live EA trading on a different copy, preferably on a VPS. Which reminds me - have you been able to give any consideration to my previous questions yet?

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  6. #6
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    492
    Hi Mintaka,

    Since you were getting some "interesting" results from Alpari UK, I tried turning on GuruLogger myself on an Alpari UK Classic account shortly before 13:30 today British Summer Time. This is what I discovered:

    Code:
    13:30:00 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 9 seconds at 2011/08/25 13:30:08.817. Server time = 14:29:59
    13:30:00 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 9 seconds at 2011/08/25 13:30:08.848. Server time = 14:29:59
    13:30:00 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 9 seconds at 2011/08/25 13:30:08.864. Server time = 14:29:59
    13:30:00 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 8 seconds at 2011/08/25 13:30:08.973. Server time = 14:30:00
    13:30:00 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 8 seconds at 2011/08/25 13:30:08.973. Server time = 14:30:00
    13:30:00 GuruLoggerCSV EURJPY,M1: Alert: EURJPY - Time difference 8 seconds at 2011/08/25 13:30:08.973. Server time = 14:30:00
    13:30:00 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 8 seconds at 2011/08/25 13:30:08.989. Server time = 14:30:00
    13:30:00 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 8 seconds at 2011/08/25 13:30:08.989. Server time = 14:30:00
    13:30:00 GuruLoggerCSV EURJPY,M1: Alert: EURJPY - Time difference 8 seconds at 2011/08/25 13:30:08.989. Server time = 14:30:00
    13:30:08 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 8 seconds at 2011/08/25 13:30:09.442. Server time = 14:30:01
    13:30:08 GuruLoggerCSV EURJPY,M1: Alert: EURJPY - Time difference 8 seconds at 2011/08/25 13:30:09.442. Server time = 14:30:01
    13:31:10 GuruLoggerCSV EURUSD,M1: Alert: EURUSD - Time difference 69 seconds at 2011/08/25 13:31:10.270. Server time = 14:30:01
    13:31:10 GuruLoggerCSV GBPUSD,M1: Alert: GBPUSD - Time difference 69 seconds at 2011/08/25 13:31:10.270. Server time = 14:30:01
    13:31:10 GuruLoggerCSV EURJPY,M1: Alert: EURJPY - Time difference 69 seconds at 2011/08/25 13:31:10.270. Server time = 14:30:01
    This was from a UK VPS. What do you make of those numbers?

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  7. #7
    Junior Member Mintaka's Avatar
    Join Date
    Apr 2010
    Posts
    29
    Quote Originally Posted by Jim View Post
    1. Were those results obtained from a demo account, a live classic account, a micro account?

    2. Were you running your MT4 instance on a VPS in the UK, a VPS in the US, or at home on your own PC connected to the global internet via broadband, cable or whatever?

    3. Imagine that you were attempting to short cable as the price dropped quickly at 16:54:20 Alpari time yesterday. You clicked the "Sell" button whilst your order ticket was displaying a price that was already 6 seconds out of date. What would have happened next, do you suppose?

    Cheers,

    Jim
    N.B. ad. is an abbreviation for a Latin word "adnotatio" - English annotation
    ad.1 I was running it on a live micro account. But have also been running it on a MT4 demo micro account.
    ad.2 I have been running at home on my own PC connected to the global internet via broadband
    ad.3 I would be too late and I wouldn't be able to get the results I was expecting. The delay means the price would have already changed.
    I hope I don't sound like an idiot. English is not my native language.
    If you keep your mind humble, pride will vanish like morning mist - Dilgo Khyentse Rinpoche

  8. #8
    Junior Member
    Join Date
    Jun 2012
    Posts
    1
    Could you possibly modify this indicator to log each day separately, i.e. to splits the logs?

  9. #9
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    492
    Quote Originally Posted by gwrigh View Post
    Could you possibly modify this indicator to log each day separately, i.e. to splits the logs?
    An excellent suggestion! It will be looked into as soon as the latest modifications to Sid the Superstitious Robot are complete. That might take another 2 or 3 days.

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  10. #10

    any idea why?

    Compiling 'GuruLoggerCSV.mq4'...
    'stdlib.mqh' - cannot open the program file C:\Program Files (x86)\MIG 2\experts\indicators\GuruLoggerCSV.mq4 (96, 1)
    'stderror.mqh' - cannot open the program file C:\Program Files (x86)\MIG 2\experts\indicators\GuruLoggerCSV.mq4 (97, 1)
    'WinUser32.mqh' - cannot open the program file C:\Program Files (x86)\MIG 2\experts\indicators\GuruLoggerCSV.mq4 (98, 1)
    3 error(s), 0 warning(s)

    any idea whats wrong/ mqh all in correct directory /

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •