Saturday, October 27, 2007

Yearly % profit charts in Amibroker

This is something for system testers.

There is a really nice bit of code at the AmiBroker Knowledge Base



The chart above was produced in Amibroker. The Knowldege Base explains a bit about it.

Anyone that has been reading this blog might realise that I was successful at the auction I went to a couple of weeks ago - see the weekender picture below.

stevo

3 comments:

Anonymous said...

Stevo,

Very nice !! thanks for the heads up.

Dave

HardMoney (reefcap)

Nizar said...

Hi Stevo,

Congrats on the auction. Location seems to be prime!

Just a question for you, on the yearly %Profit chart, it says you made 92% last year. But on another chart in this post (http://bp2.blogger.com/_WUgp_EWyRX0/RoWeOlbld3I/AAAAAAAAAHM/snkaqv_giL8/s1600-h/Cumulative+monthly+profit+affrica.png) it says you made about 37%?

Are the results different because they were achieved with different systems, since you have mentioned you do trade two?

Nizar.

stevo said...

Nizar
The chart is just an example - totally different system with different position sizing.

Actual and theoretical results can be quite different for lots of good reasons, like adding substantial capital to a portfolio during the year, or pulling money out.

I was playing with this bit of code;
rules = Optimize( "Buys Opt" , 1, 1, 15, 1);
r1 = Buy condition;
r2 = Buy condition;
r3 = Buy condition;
R4 = Buy condition;

Buy =
IIf( rules ==1, R1 AND R2 AND R3 AND R4,
IIf( rules ==2, R1 AND R2 AND R3,
IIf( rules ==3, R1 AND R3 AND R4,
IIf( rules ==4, R1 AND R2 AND R4,
IIf( rules ==5, R1 AND R2,
IIf( rules ==6, R1 AND R3,
IIf( rules ==7, R1 AND R4,
IIf( rules ==8, R1,
IIf( rules ==9, R2 AND R3 AND R4,
IIf( rules ==10, R2 AND R3,
IIf( rules ==11, R2 AND R4,
IIf( rules ==12, R2,
IIf( rules ==13, R3 AND R4,
IIf( rules ==14, R3,
IIf( rules ==15, R4, 0)))))))))))))));

So I can put in 4 different buy criteria and optimise to see what goes together or works best on it's own. Just a bit of fun! There might be a better way of writing the code but I didn't want to spend too much time on making it pretty - got to catch a plane soon.

stevo