Saturday, August 4, 2007

Big issues with the sedona system

My forward testing wasn't going so well in the past couple of weeks, so I thought I'd take a closer look at the code to see if any problems could be seen. There's a big issue with the order entry algorithm. In summary, the algorithm would, in some cases, give an extra 3 to 4 pips to orders on days when the pair moved to a particular area in relation to the entry level. In the interest of disclosure, here's the code snippet:

The old code:

> if ($bid <= $orders{'short'}->{'open'}) {
> if ( ( $orders{'short'}->{'open_time'} < $epoch ) &&
> ( $epoch < $orders{'short'}->{'close_time'} ) && $bid > ($orders{'short'}->{'open'} - 4) ) {
> if ($verbose) {
> print $output "short\tentry:", $bid, "\t", scalar(gmtime($epoch)), "\trange:", $range, "\n\n";
> }


The new code:


< # new algorithm
< # go short if the bid falls within 2 pips from order
498,504c492,503
<
<>{'open_time'} < $epoch ) &&
< ( $epoch < $orders{'short'}->{'close_time'} ) &&
< ( (($orders{'short'}->{'open'}) + 1) > $bid) &&
< ( $bid > (($orders{'short'}->{'open'} - 1) ) ) ) {
< if ($verbose) {
< print $output "short\tentry:", $bid, "\t", scalar(gmtime($epoch)), "\trange:", $range, "\n\n";
---


Using the old code, if the pair got within 4 pips of the entry price, the code would trigger the order as if the pair actually made it to the entry level. In the situation where the pair didn't really get that far, we'd get an extra 4 pips, which vastly skews the test results.

So far, I've determined that GBP/USD and USD/JPY are no longer profitable using the old system. I haven't tried other pairs yet, but I'll be running tests this weekend. The lesson learned here is the importance of forward testing. It's also important to continually scrutinize any system that you test...not only the system variables, but the testing method as well.

My biggest mistake the past few weeks was spending far too much time optimizing the system - I should have been more suspicious of such good results....

No comments: