[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Real world trading - brainstorming



PureBytes Links

Trading Reference Links




I have 
come up with some fairly profitable ways of using one of AB's very powerful 
features (AddToComposite).   Perhaps my approach is already old hat to 
many of you, in which case it's easy to hit the delete button.   I'm 
hoping, however, to stir up some dialogue regarding the concept in hopes that we 
can help each other through brainstorming the idea(s) even 
further.
<FONT face=Arial color=#0000ff 
size=2> 
In 
order to best utilise what I am proposing, you would ideally have a system that 
generates lots of trades (1,000 plus) and you would already be a believer 
in backtesting over several years of data.   It would also help if you 
believed in the need to use actual prices instead of backadjusted prices and 
that you have access to such information.    You can still 
benefit from this approach without these conditions being true, but not as 
much.
<FONT face=Arial color=#0000ff 
size=2> 
The 
first idea that I'm going to describe assumes that stocks in different 
price brackets do better than other stocks and that the bracket of the best 
performers changes over time.   I have proven, at least to myself, 
that this assumption is valid.   I'm sure all of you have heard 
commentators saying that the mid-cap stocks have been outperforming the 
large-cap recently or the micro-cap stocks have been the best performers over 
the last 30 days, etc.   
<FONT face=Arial color=#0000ff 
size=2> 
Let's 
assume that you have a fairly profitable system that generates too many trades 
in proportion to the amount of cash you have available.   One way of 
reducing the number of trades would be to only take trades for stocks in the 
price range that has been performing the best in recent 
times.    I made several composite files that contain 
the average returns for various price brackets.   For instance, I made 
a composite file containing the returns for stocks in the $1 to $5 price range, 
$6 to $10 price range, etc.  I used a simple formula (close/ref(close,-20)) 
for determining the returns and wrote the composite with a count for how many 
stocks met the criteria each day as well as the total returns for all of the 
stocks meeting the criteria each day.   
<FONT face=Arial color=#0000ff 
size=2> 
When I 
run a scan or optimization using my trading system, I can read these composite 
files (using the Foreign function) and calculate average returns for each price 
bracket.   Each day,  I can determine which price brackets 
are <FONT face=Arial 
color=#0000ff size=2>performing the best (or worst for shorting) and filter my 
trades to only trade the best one or two price brackets.   Of course, 
you can use various smoothing techniques to filter out some of the 
noise.
<FONT face=Arial color=#0000ff 
size=2> 
By 
placing this price bracket ranking in one of my Exploration columns, I can place 
my orders for the day by working my way down the buy (or short) signals in 
sequence until I run out of cash.
<FONT face=Arial color=#0000ff 
size=2> 
I have 
backtested this technique and it adds enough additional profit to the bottom 
line to make it worthwhile.   Sectors and/or industries work well 
if substituted for price brackets.
<FONT face=Arial color=#0000ff 
size=2> 
Here's 
another idea, very much related to the one above.   Let's say that you 
like to use moving average systems.   Or you would like to use them, 
but have trouble making them dynamic enough to adjust to various market 
conditions and cycles.    For sake of simplicity, we'll just look 
at a simple two-period crossover system.   Let's say that the short 
timeframe might range from three to eight days and the long timeframe might go 
from eleven to 20 days.   What I did in this case was make the 
following composite files:
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>~Composite311    (will contain returns based on using a 
3/11 crossover)
<FONT face=Arial color=#0000ff 
size=2>~Composite312    (will contain returns based on using a 
3/12 crossover)
<FONT face=Arial color=#0000ff 
size=2>etc.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2> 
I then 
run my system over historical data, creating a composite for each of the 
possible timeframes (3/11, 3/12, 3/13, etc.).   Tedious for 
sure.   If you are determined to use a moving average crossover 
system, however, this is worth the effort.
<FONT face=Arial color=#0000ff 
size=2> 
Each 
composite file would contain the equity curve information resulting from using 
the applicable crossover periods.
<FONT face=Arial color=#0000ff 
size=2> 
The 
actual trading system would determine (each day) which of the various timeframe 
possibilities has been performing over the last 20, 30, etc. days and would use 
the relevant timeframes for trading going forward.
<FONT face=Arial color=#0000ff 
size=2> 
There 
is a problem with what to do with trades that were entered using one pair 
of timeframes when you switch to using another.   But you have to 
deal with this problem anyway if you are going to use any sort of dynamically 
adjusted moving average or similar system.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>Another idea that I am playing with has two composite files.  One 
containing the results derived from trading the same system on 
stocks paying high yields and the other for stocks with low 
debt/equity ratios.   Through time, I can see definite times when one 
of these groups has better returns than the other.   Emphasis of 
investors and traders seems to switch from yield to debt and back again over 
time.
<FONT face=Arial color=#0000ff 
size=2> 
Just a 
couple of ideas.   The first one (price brackets) seem to have the 
best reward for the amount of time invested.   Substituting sectors 
for price brackets produced some interesting results.   It frequently 
pays to buy the worst performing sectors as long as the peformance is working 
its way back to the top.  Of course, you could substitute actual market cap 
for price brackets too.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>Have a think... you'll surely come up with some ways to use and/or 
improve on what I've done.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2> 






Yahoo! Groups Sponsor












Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.