Wednesday, December 29, 2010

Programming Chart Pattern in Excel - Part 2

                                                  
As expected, Excel realised the "strangeness" in the output on my previous post.  I realised the ambiguity in the rules given when I did the programming to let beginners know that when writing your algo, you can't assume that the programmer can use common sense to fill in the blanks left by the rules, it has to be clear and precise otherwise it will be GIGO (garbage in, garbage out).

To make some sense out of the rules given, here's my interpretation of the blanks being left out (in addition to the updates given by Excel that I've missed as it went into SPAM's tab) and the output from the updated version.

1.  The z bar lower close compare to z-1 happen while market is in uptrend (y continuous higher highs AND x continuous lower lows).
2.  Market is considered to be in uptrend until they are in down trend (b continuous lower highs AND a continuous  lower lows) and vice versa.
3.  Buy-stop order instead of buy (that's is just my mistake on typing the order type, I assume that you know it is a buy-stop order when the buy price is much higher, I am sorry, thanks for the correction, Excel)
4.  You could define different parameters for up trend and down trend, although you have to be careful on the long or short bias in your system when you use different values, usually it is consider bad if one side is easier to be fulfilled than the other.  You would have trouble when there is a regime or paradigm shift.  I hope you understand what I mean :).

Here's the updated screen (done in <10 min):


Oh yes, one more thing Excel, I am sorry that I am lazy to do the charts since the numbers already speaks to me :) and personally I think this could be further improved to be a good trend-following system. 

Cheers & Happy Trading!
                      

3 comments:

  1. Lim, can you post the screen with complete buy and sell rules? tq.

    ReplyDelete
  2. Since you ask so nicely, I'll try to squeeze some time to update for you :)

    ReplyDelete
  3. I think that thanks for the valuabe information and insights you have so provided here. mq4 to mq5

    ReplyDelete