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 14

Thread: TOD the Time of Day Trader

  1. #1
    Senior Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    139

    TOD the Time of Day Trader

    This thread introduces a new member to the trading family... enter TOD, the Time Of Day trader.

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    139
    Having given TOD a very brief introduction, please find attached a Matlab/Octave implementation of his inner workings. The attached results are based upon dukascopy 1 minute bar data, ignoring spread and commission. He trades EURUSD, buying at 1am and selling at 10am... taking the rest of the day off to do whatever resting robots like to do.

    Cheers,
    Pete
    Attached Images Attached Images
    Attached Files Attached Files

  3. #3
    Senior Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    139
    Since I've added this thread to the jForex sub-section, I thought that I should upload a jForex implementation. The usual warnings apply, i.e. don't use on a live account. But, it's ok for running backtests through the jForex platform. In fact, that's exactly what I've done. The results include simulated spreads and commissions, and the cumulative pips curve is attached, along with an Excel file listing the trades and the java source code.

    This version was run on 1 minute bars, although interestingly, the jForex backtest run on tick data produced greater profit... so, not sure what is going on there!
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    493
    Hi Dr. T,

    Thanks very much for sharing your latest robotic creation. TOD seems to embody Ray's KISS spirit perfectly!

    I'll take a look as soon as I have a spare second, which won't be for a day or two I'm afraid. Apart from Ray Robot 2, I've recently ported some other software to my Raspberry Pi which is keeping me fully occupied just at the moment.

    Cheers,

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

  5. #5
    Senior Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    139
    Hi Jim,

    I'm glad that you are able to have your Pi and eat it/code it/ number crunch it... mine is still in the box. It turned up a few weeks ago, I just haven't had an opportunity to power it up. A very sad state of affairs, I'm sure that you'll agree. That said, little does my Pi know the grand things that I have planned for it.

    Cheers,

    Pete (aka Dr T)

  6. #6
    Senior Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    139
    I haven't updated here for a while, so I thought that I would pop back. I implemented an MT4 version of TOD and set him loose on a GKFX spread bet demo account. You can view his exploits here. I know this isn't jForex, but it is an MT4 implementation of TOD.

    Regarding my live dukas account, it's moving very slowly. I've been working on my own Java optimiser for jForex strats. I'm still waiting for it to complete... I get strange errors and it seems to be very RAM hungry... it eats 24 GB RAM for breakfast... and then slows the server down to a crawl. I suspect that it has something to do with the way the dukes API handles caching for price data. I'd look through the debug logs, but by the time I catch the error, the log has grown to over 6 GB!

    Anyway, when I'm fully convinced that everything works, TOD may well get a live outing into the Swiss FX Marketplace.

    Cheers,
    Pete

  7. #7
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    493
    Hi Pete,

    Thanks for the update on TOD's progress. He certainly seems to be heading in the right direction at the moment!

    I don't recall ever having similar problems at Dukascopy, even when leaving strategies running for months on end. Mind you, I wasn't trying to write an optimiser! You reckon you're loading umpteen copies of the same historical data?
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  8. #8
    Senior Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    139
    It's a bit messy... partly because I haven't fully figured out how to properly use the ITesterClient class yet, I'm just hacking at the examples. It's also not a clever optimiser - I just wanted to automate cycling through multiple sets of parameters.

    Anyway, I started by trying to load the data once using Future.get() with a single ITesterClient interface. But this seems to crash and eat memory. Then I figured that it could be a memory leak if I'm creating client objects that are unused but still referenced. To Ensure this wasn't happening, I wrapped everything in it's own method which I call multiple times, ensuring that at each pass all of the objects are set to null before passing control back to the main loop.... and.... same problem!

    Anyway, I did just notice that a run had completed. Strangely, my own logs indicate that the optimisation completed... so the crash must occur during the exit phase... although not repeatably! The server still needed a restart, which strikes me as odd because closing the JVM should release any memory tied up by the jar.

    The short answer to your questions is, yes, I think that I'm loading at least umpteen copies of the same historical data. I don't really understand this, because I thought it was cached to disk in a standard location. Surely the point of a cache is that it is not repeated if multiple processes are calling for the same data segment?

    I might have some more time for this next week.

    Cheers,
    Pete

  9. #9
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    493
    On a financial rather than technical note this time, Dukascopy just rang to inform me that I need to sign a piece of paper giving the UK Government the right to snoop around in my "Swiss bank account". Either that or cough up a significant sum of money "up front".

    What is the world coming to?
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  10. #10
    Senior Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    139
    So you can avoid the snooping if you are sufficiently wealthy? Doesn't that somewhat undermine the point of the snooping?

    On the topic of TOD... the problem seems to occur when the internet connection gets dropped (even momentarily). Unfortunately, the ITesterClient interface doesn't like this very much. I haven't figured out how to catch this happening and hence handle it. Any ideas?

    If you want to replicate the errors, setup a java project that calls the dukascopy ITesterClient interface to backtest a strategy. While the strategy is running, turn off the internet connection until a bunch of dukascopy connection errors are spewed out. Keep the connection off and eventually you get errors that look something like those below. Any ideas how to catch and fix this?


    2013-07-05 16:39:19.016 ERROR AbstractHTFlowDataCreator - Wrong parameters: EUR/USD / 1262304000000, -9223372036854775808 / com.dukascopy.dds2.greed.agent.strategy.tester.dat [email protected]
    java.lang.IllegalArgumentException: Wrong parameters: EUR/USD / 1262304000000, -9223372036854775808 / com.dukascopy.dds2.greed.agent.strategy.tester.dat [email protected]
    at com.dukascopy.charts.data.datacache.LoadDataAction .<init>(LoadDataAction.java:136)
    at com.dukascopy.charts.data.datacache.FeedDataProvid er.getLoadTicksDataAction(FeedDataProvider.java:11 41)
    at com.dukascopy.charts.data.datacache.FeedDataProvid er.createCustomTicksLoadingAction(FeedDataProvider .java:2454)
    at com.dukascopy.charts.data.datacache.FeedDataProvid er.loadCustomTicksSynched(FeedDataProvider.java:24 17)
    at com.dukascopy.dds2.greed.agent.strategy.tester.dat aload.AbstractHTFlowDataCreator.performDataLoad(Ab stractHTFlowDataCreator.java:155)
    at com.dukascopy.dds2.greed.agent.strategy.tester.dat aload.AbstractHTFlowDataCreator.run(AbstractHTFlow DataCreator.java:131)
    at java.lang.Thread.run(Thread.java:680)

Page 1 of 2 12 LastLast

Posting Permissions

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