Monday, April 27, 2009

Forex and the MetaTrader Platform

The MetaTrader platform allows clients to place buy/sell trades on the Forex market. It's quite a nice product, but is it 'fair'? There is a plugin, shown in this thread, that allows the broker to 'tweak' the settings on their side to, possibly, rob you of your cash.

So, if you see some unexplained spikes, or wonder why every trend just hits your SL before reversing, then maybe your broker is using this plugin.

Wednesday, April 22, 2009

JSF 1.2 on Google App Engine

Seems like this guy has got it working. I'll have to try it when I get time.

Work sucks ;)

Sunday, April 19, 2009

Forex EA's (2)

Here's a site with a decently written EA ;)

Forex EA's

Yet another forex Expert Advisor I've developed based upon an indicator that shows great trend following capabilities in hindsight. Needless to say it's not very good at generating profits. The code is great though :)

I've slowly amassed a library of Metatrader trading methods that simplify the writing of an EA. This EA above took 2 hours to write including testing and debugging. Hmm, I could make a career of this ;)

Friday, April 17, 2009

Field Initialisation in Google App Engine

Had a weird problem that took a while to resolve. I'm still not sure what the issue really was, perhaps its a problem with GAE itself. Here are the details:

I have a class that is packaged within a Jar and included in the applications WEB-INF/lib directory.

I was struggling with the following errors:

javax.servlet.ServletException: [Ljava.lang.String;
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:239)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:63)
...

Nested in javax.servlet.ServletException: [Ljava.lang.String;
:java.lang.ArrayStoreException: [Ljava.lang.String;
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
...

The class I was using has an instance field initialised as:
private SimpleDateFormat sdf = new SimpleDateFormat("MMddyyHHmmssSSS");

If I remove the field initialisation and initialise the field in a method, then all works fine.

I'm not sure what the problem is, it works fine under Tomcat, but is there some instance field initialisation issue within GAE? Or is it just SimpleDateFormat has a problem, perhaps a locale issue?

Anyway, thought I'd post it here as it took a lot of trial and error to find this issue. It may save someone else the time.

If there's an 'real' answer to the problem then it may appear here.

Thursday, April 16, 2009

Turbo Lister

I've used Turbo Lister in the past to allow me to create eBay entries 'off-line' and upload them when I'm ready. I haven't used it for a while and when I cranked it up was told that I needed to phone 'this number' to prove my identity. wtf? Is this the internet or not? Do I have an eBay ID that is secure or not? wtf do I need to phone up eBay?

Stuff that, I'll just do it online instead with my obviously insecure eBay ID.

So, Macs Never Crash?

Er, yes they do. Mine crashes frequently. Hard crashes equivalent to the Windows Blue Screen of Death, program crashes and awful performance when memory is tight.

Currently I'm battling against a hard crash that happens when I use two competing Virtual Machine products, Parallels and Sun's free Virtual Box.

For those who've never experienced a Mac hard crash, or kernel panic to give it it's proper name, then here's a picture: