Showing posts with label 3d charts. Show all posts
Showing posts with label 3d charts. Show all posts

Monday, September 03, 2007

AmiBroker testing and Excel

Many system testers focus on optimising variables like moving averages. But it is also possible to get a better understanding of position size, risk and other trade parameters.

The following charts were generated from Amibroker optimise runs. I optimised a number of criteria, %Risk, minimum position size $, capital and maximum number of trades held - all at the same time. What results is a lot of data that I then transfered to Excel. Using Autofilters and pivot tables in Excel I can fix some parameters, as well as exclude others, and create 3D charts as shown below.


I had some fun with colours - the default ones set on my version of Excel didn't really work for me.


So in the one spreadsheet I have, amongst other things, a large number of 3D combinations to consider. I lose the ability to rotate the charts but I did customise the colours to my liking. It's a little time consuming generating pivot tables and determining what values to include / exclude, what parameters to fix and what value to fix them at but I feel I am only scratching the surface with Excel.

regards
stevo

Sunday, September 02, 2007

3D rotating charts video


Rotating the charts in Amibroker makes it a lot easier to work out what is going on.
stevo - unfortunately the video didn't post.

Monday, July 09, 2007

3D charts & Trade-offs

The 3d plots are from a new system I have been working on and show a 2 variable optimise. The first chart plots Compound Annual Return, whilst the 2nd chart looks at drawdown. I find the 3d charts feature of AmiBroker a very useful tool - that's why I am posting these charts here.

What would be nice is if we could have 4 or 5 dimensional charts! I tried using Excel surface charts to get more insight but the 3d Amibroker charts are more convenient.


One variable (ATR multiplier) didn't have much impact over the range I tested - I could choose pretty much any value in the relatively tight range I tested. This suits me.


As is often the case using the values that give the best draw down result in lower CAR and visa versa. I could trade off CAR for lower draw down.

What was good is that I finally coded up profit target code. The following code was posted on the Yahoo AmiBroker site courtesy of Tomasz Janeczko;

/* a sample low-level implementation of Profit-target stop in AFL: */
Buy = Cross( MACD(), Signal() );

priceatbuy=0;

for( i = 0; i < BarCount; i++ )
{
if( priceatbuy == 0 && Buy[ i ] )
priceatbuy = BuyPrice[ i ];

if( priceatbuy > 0 && SellPrice[ i ] > 1.1 * priceatbuy )
{
Sell[ i ] = 1;
SellPrice[ i ] = 1.1 * priceatbuy;
priceatbuy = 0;
}
else
Sell[ i ] = 0;
}

All I had to do was modify it so that I also tested for a trailing stop. I initially tested using APPLYSTOP code but to set up the system I was more comfortable coding up the profit exit. Because the Sell is dependent on the buy what sounds quite easy does require something like the code above. GP's document on looping was also of value - it's in the files section of the Amibroker Yahoo site. The Yahoo site is a wonderful resource.

I will run some TradeSim tests before I take the system I have been working on live. As usual for me it's a longer term weekly system. I think I will call it Chaos, although Chicken & Chips is tempting! There is a small restuarant that does wonderful chicken & chips at Crows Nest and I do like my food. Why not name a system after food I like?

regards
Stevo