Wednesday, December 29, 2010

Programming Chart Pattern in Excel - Part 3

                             
Here's the updated screen shot that anonymous requested.  The first one shows the short in 2008 and the second one shows the long in around mid this year. 

Please also take note that this is consider cherry pick and I am in no way promoting these trading rules.  Run the back-test and optimize the parameters on your own before even consider trading it.





Cheers & Happy trading!
                                     

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!
                      

Tuesday, December 28, 2010

Programming Chart Pattern in Excel - Part 1

                                             
In response to Excel's comment on my previous blog, here's the screen capture (graphical requested by Excel) of the rules (programmed in MS Excel using only in-cell formulas) given by Excel on the comment section on my previous post.

This is the ouput from  < 30 minutes of programming.  I am sure it can be further improved.


All the parameters in red color can be changed and calculations will be updated automatically!

Just do the reverse for Sell and plug-in your modules for back-testing and you are set to begin optimizations(since you already have the Buy/Long, Stop-loss and Profit target price)!

Cheers & Happy Trading !