Australian (ASX) Stock Market Forum

Amibroker FAQ

Please ignore my previous question, too much trouble with 1.8.2 plugin, I've deleted it and gone back to my old trusty 1.7.1.

I think I may have asked this before, but for those that still have the old format for IB tickers in AB, eg. APU9-SNFE-FUT, none of those currency business and shortened product type, ie. prior to plugin 1.8.0, do you have any problem with using SMART as an exchange?

I'm trying to pull up US stocks using SMART, but some of them work, but most don't, eg, I can't even get C (citigroup) to show up, says symbol not correct, even with C-SMART-STK, it's really driving me crazy :banghead:

Anyone got theirs working properly?

Thanks
 
I have been searching through the forum now for a good few days but couldnt find what im after so... :) her I am ready to ask probably some confusing/dumb questions.... (newbies = :banghead:) :rolleyes:

  • The use of AmiBroker? Is it to show CURRENT entry/exit signals/opportunities? (as well as backtesting of course) or just to test your system/coding?


  • Do AmiBroker users have different Formula Coding, and Analysis Settings for short trades vs long trades? (Im guesing YES for the coding but NO for the settings)
    • What setting would you use for trades lasting 2days-2weeks, by this I mean is it like the Daily/Weekly settings? or is this purely something to do with the way it backtests?

  • The more coding = finer/more defined results?

  • Just because you enter some coding, run a scan, then backtest and show profits does this mean if you traded on those results with your settings that you SHOULD/COULD make these returns in real trading?

  • IS there a grey area/range (in the STATISTICS part of the results) of results that one should aim for through the whole testing process... for example...
    Exposure (should be) 3-5%
    Risk Adjusted Return 1000-2000%
    Risk/Reward Ratio 20-25% so on and so on till throughout the Statistics Results.

:)
 
  • The use of AmiBroker? Is it to show CURRENT entry/exit signals/opportunities? (as well as backtesting of course) or just to test your system/coding?

Amibroker is a program for charting & backtesting trading systems. You can test your systems as well as plot the trades on a chart, as well as do an explore to find system entries for tomorrow. Taking it a step further you can link Amibroker to IB and send trades automatically.


  • Do AmiBroker users have different Formula Coding, and Analysis Settings for short trades vs long trades? (Im guesing YES for the coding but NO for the settings)
    • What setting would you use for trades lasting 2days-2weeks, by this I mean is it like the Daily/Weekly settings? or is this purely something to do with the way it backtests?

  • The more coding = finer/more defined results?

This can be true,
Generally keeping the rules of a system quite simple will provide good results. The problem is you may find some undesirable entries/exits or trades that didn't happen. When you do this you'll have to go back to the drawing board and work out how you can code the undesirables out of your system, so that the system reflects what you had in mind before you started coding.
One thing that alot of people will get stuck on is curve fitting, instead of making the system how the first wanted it, they'll keep optimising so that it looks great in past data, but in reality it might not have positive expectancy going forward.


  • Just because you enter some coding, run a scan, then backtest and show profits does this mean if you traded on those results with your settings that you SHOULD/COULD make these returns in real trading?

No.
Backtesting means nothing for the future success of a trading system.
You can test it in sample and out of sample, but in the end that doesn't dictate whether the system will be profitable going forwards. The more robust a system is, the more chance it will have of being profitable, If you follow all the signals!


  • IS there a grey area/range (in the STATISTICS part of the results) of results that one should aim for through the whole testing process... for example...
    Exposure (should be) 3-5%
    Risk Adjusted Return 1000-2000%
    Risk/Reward Ratio 20-25% so on and so on till throughout the Statistics Results.

:)

When designing a system i look for
CAR of >20% (though this is not always realistic)
Max System DD of <10% (preferably less than 5%)
Profit Factor >2
Car/MaxDD >2

It's also nice to have a High amount of trades (so i can be confident the sample is as accurate as possible)

Some other people look for consistency, for example 11 profitable months out of 12. This doesn't bother me too much as i'm not trading for a living.
 
I've just read a book by John Sweeny called Campian Trading and notes the following about back testing which I feel is true.


From Page 65

"Testing in general is suspect because we aren’t dealing with a
repetitive process where we expect to find x that causes y. We are
painfully aware that the world is evolving and changing. Therefore,
the markets are evolving and changing. New markets come into being
and old markets fade away; new stocks are created and old favorites
die, dissolve, or fall out of favor. The ground on which we
validate our trading rules won’t be the ground on which they are
used."

Page 68

"IN SAMPLE OR OUT OF SAMPLE

It’s thought that, ideally, when testing a trading system, we’d create
it using one set of data and test it on a second, third, or fourth set,
perhaps stepping forward in time as we do so. This might give us
an opportunity to discover problems with the trading rules and
modify the rules somewhat, always keeping in mind that the more
elaborate the rules, the more rigid the systems and the less likely it
is to behave robustly in the future. Actually, all stepping forward
does is increase the responsiveness of our rules if we continually
modify them. It cannot change the fact that we are testing on the
past for a very different future. Our only true defense is keeping the
rules simple.

This is contrary to the instinct of the novice developer who
thinks that by piling on more rules more ifs, and more filters, the
system becomes more refined and specific. As it turns out, we’d
generally like to get by with one, two, or at most three decision
rules; our knowledge of market behavior is that vague. This general
guidance is one reason moving averages are useful: they are simple."
 
When designing a system i look for
CAR of >20% (though this is not always realistic)

It's also nice to have a High amount of trades (so i can be confident the sample is as accurate as possible)
What is CAR? I dont see that in my Statistics Report!
Do you know of any threads where someone has posted the Statistics of a working system for comparison? It would be good to have a full guide as to what we are trying to achieve with AmiBroker.

Testing in general is suspect because we aren’t dealing with a repetitive process where we expect to find x that causes y. We are painfully aware that the world is evolving and changing. Therefore, the markets are evolving and changing. New markets come into being and old markets fade away; new stocks are created and old favorites die, dissolve, or fall out of favor. The ground on which we validate our trading rules won’t be the ground on which they are used.

Thats understandable... I gues sthis is why trading is and always will have the 'X' factor...

This is contrary to the instinct of the novice developer who thinks that by piling on more rules more ifs, and more filters, the system becomes more refined and specific. As it turns out, we’d generally like to get by with one, two, or at most three decision rules; our knowledge of market behavior is that vague. This general guidance is one reason moving averages are useful: they are simple."

Keeping it simply sounds good when dealing with AFL :)
 
What is CAR? I dont see that in my Statistics Report!
Do you know of any threads where someone has posted the Statistics of a working system for comparison? It would be good to have a full guide as to what we are trying to achieve with AmiBroker.

CAR is Compound annual return.
Simply, how much % the system returns each year

I don't have the stats for forward testing but here is one of my systems backtested from 1/1/2003-26/06/2009

Universe ASX 300

ss20090627144749.png


One problem that will make alot of systems fail is people don't realise they are using indicators that look forwards, every single signal will be looking forwards unless you apply it to yesterdays bar. You can't know the MA, Bollinger Band or any other indicator on the day you buy, the most recent one is the one on the previous bar. Therefore you must delay buy signals.

Brad
 
CAR is Compound annual return.
Simply, how much % the system returns each year

I don't have the stats for forward testing but here is one of my systems backtested from 1/1/2003-26/06/2009

Universe ASX 300


One problem that will make alot of systems fail is people don't realise they are using indicators that look forwards, every single signal will be looking forwards unless you apply it to yesterdays bar. You can't know the MA, Bollinger Band or any other indicator on the day you buy, the most recent one is the one on the previous bar. Therefore you must delay buy signals.

Brad

Aaaa ok I see the Annual Risk %, that seems to be more than ok...
A few things with your results though...surely this isnt one that you use. Through my newbie eyes this looks like a losing setup?
Also some of my results show what seems to be pretty high result numbers that make me think im a long way off... :)
Your Ulcer Performance Index shows 10.38 yet mine scares me and shows 220.03, also my CAR/MaxDD is 74.47 which seems too high )))) surely I have LOTS of problems with my coding! Maybe like you said it's looking forward :(
 
My system has positive expectancy, not sure how you came to the conclusion that it is a "losing setup"

Secondly your CAR/MaxDD at 74.47.

You have either

A) Made a mistake in your coding (99% chance)
B) Found the holy grail (1% chance)

Anything over 4 is pretty good for Car/MaxDD
 
My system has positive expectancy, not sure how you came to the conclusion that it is a "losing setup"

Secondly your CAR/MaxDD at 74.47.

You have either

A) Made a mistake in your coding (99% chance)
B) Found the holy grail (1% chance)

Anything over 4 is pretty good for Car/MaxDD

:) sorry.. I looked at your 100'000 then THOUGHT i was looking at 75'000... Thats awesome, cheers for that I'll try my best to rub the lack of sleep from my eyes and work my codes till i can get something like yours. i would definately say my codes are lacking.... I might post my stats if I can work out how too :)
The results I work on bettering are..
Ending capital
Exposure %
Average Bars Held
Risk-Reward Ratio
Bars Held


Tell me something though. When you run the walk forward (obviously you would have) and it does year by year, is that a better test result as to how reliable your system is?(going forwards rather than back)

I know testing is still not a 100% as to how your trading will go but it sureley it is a GOOD indication...
 
:) sorry.. I looked at your 100'000 then THOUGHT i was looking at 75'000... Thats awesome, cheers for that I'll try my best to rub the lack of sleep from my eyes and work my codes till i can get something like yours. i would definately say my codes are lacking.... I might post my stats if I can work out how too :)
The results I work on bettering are..
Ending capital
Exposure %
Average Bars Held
Risk-Reward Ratio
Bars Held


Tell me something though. When you run the walk forward (obviously you would have) and it does year by year, is that a better test result as to how reliable your system is?(going forwards rather than back)

I know testing is still not a 100% as to how your trading will go but it sureley it is a GOOD indication...

When designing a system i don't walk forward.
I choose 3 ranges, example i'll test on 2004-2006. Once im happy with my code i'll then test 2001-2003 and 2007-2009. It doesn't make much difference to me because i don't optimise, but i like to see that it performs in and out of sample.

Once im happy with it i will take a good hard look at the equity curve and see how consistent it is, see where the largest drawdown is and see what years don't perform too well. I'll then look at the profit table for more confirmation to what i've seen in the equity curve.
 
i like to see that it performs in and out of sample.

Once im happy with it i will take a good hard look at the equity curve and see how consistent it is, see where the largest drawdown is and see what years don't perform too well. I'll then look at the profit table for more confirmation to what i've seen in the equity curve.

Is there a reason why you do those years and not all years maybe 1 or all at one time?
What exactly is this 'in and out of sample' :confused:
 
Beamstas & others, just wondering what you are testing, ie. the whole ASX equity market or an area of it.

The reason I ask is that I have narrowed my EW scans to stocks with a market cap of >$50 million which is around 630 ASX stocks.
The candidates seem to be more stable and also the patterns seem to be more reliable.

I am not so much interested in your system but wondering if you have singled out the "rubbish" that can play havoc with backtest results and what the effect of that has been.

In my testing of my own system in TradeSim I get a much more linear pattern (and better result) by eliminating the bottom 500 or theabouts from the scan.

If you need any groups for testing based on any similiar factors let me know and I can create them in a text file similiar to the attached.
 

Attachments

  • MJW Market Cap over $50m.txt
    5.5 KB · Views: 25
Anyone know the ticker for ASX options from IB in AB? Can chart the other options fine (US, EURO...etc), but not ASX ones, even using the symbols from ASX site. If TWS is able to display it in a chart, then I assume it's possible to do it in AB?

Thanks.
 
Is there a reason why you do those years and not all years maybe 1 or all at one time?
What exactly is this 'in and out of sample' :confused:

Ok so I now know what In/Out of Sample is....:p: but...
After backtesting my system on all my data and also odd times and running 'Optimize' on several choices.. Have I now ruined my system? (I just read a thread about how you should have 2 sets of Data to test in :banghead:...
 
Some AmiBroker Questions if someone cares to shed some light....

After backtesting my system on all my data and also odd years here and there (just random selection) and running 'Optimize' on several choices.. Have I now ruined my system? (I just read a thread about how you should have 2 sets of Data to test in :banghead:...

The arrows in AmiBroker, what is the difference between a filled arrow and non filled?
 
Hi, just wondering if anyone knows whether you can display the chart title to the left hand side of the chart? Currently it's on the RH side.

Thanks
 
Another one :eek: I'm currently using 5.10 with IB, I can chart QQQQ, IWM...etc, however just can't seem to get SPY to work.

IWM (Russell 2000ETF) is in the exact same category as SPY, yet using just SPY as symbol in IB it doesn't work, says invlaid symbol, but IWM works!?

Anyone able to chart SPY through AB with IB?

Thanks
 
Order options? Looking to use automatic systems run through IB, so suggestions for what is needed and what is not?

Need Amibroker (professional?).
Don't need Amiquote?
Need AFL Code wizard?
 
Top