# Medium to Long term system development



## Milk Man (16 July 2005)

*Re: Developing a System to Trade Live*

_*Moderator's Note: This thread originally started in another general thread on systems development so it may be a bit jumbled at first for those unfamiliar with it. The idea here is to develop a medium to longterm system. Click here for a thread on a short term system.
*_



			
				mit said:
			
		

> Another thing to look at is stocks reaching a 52 week high. Once they pass this the skys the limit as there is little overhead resistance. However, the 52 week high itself is a resitance and stocks hitting this may subsequently dive. We would need some confirmation such as the stock has kept going up once it has hit the 52 week high or we can look at a 1-2-3 formation as this increases the probability of success and gives us an initial hard stop at the 2 point.
> 
> MIT




Thanks for the info,

Buy high and sell higher is the key concept in techtrader. I don't mind going down that path as opposed to a reversal system as we were aiming for a shorter term system (weren't we?) and generally a better win/loss ratio is needed. 

Does anyone else mind?

The Darvus/1-2-3 entry is one of my favorites. I've always thought the 52-week high would make an interesting variable. Has anyone tested this?


----------



## mit (18 July 2005)

*Re: Developing a System to Trade Live*



			
				loakglen said:
			
		

> Thanks for the info,
> 
> Buy high and sell higher is the key concept in techtrader. I don't mind going down that path as opposed to a reversal system as we were aiming for a shorter term system (weren't we?) and generally a better win/loss ratio is needed.
> 
> ...




Loakglen,

I thought we were going longer term for the beginners? Personally I have a long term system and would like to round out my systems with a short term system (I even have an idea for a go-short system). Maybe do a long term system first?

MIT.


----------



## mit (18 July 2005)

*Re: Developing a System to Trade Live*

Well the following is a basic system where you buy the 52 week high. It is profitable but the drawdown is unacceptable. But it is barebones to start fleshing out a system. It simply buys on open where yesterday was at a 52  week high and only selects stocks that have an average daily turnover of $500k or more

MIT

/********************************************************
 Aussie Stock Forums System
*********************************************************/

// Setup Options
SetOption("InitialEquity", 10000);
SetOption("FuturesMode", False);
// Parameters
TrailATR = 6.5; 
Period = 14;
MaxPosition = 15;   
// Set the trailing stop also used to set the position size
Trail = ATR(Period) * TrailATR;

Buy = Ref(H,-1) == Ref(HHV(H,250),-1) 
    AND EMA(V*C, period) > 500000;

// Yesterday was 52 week high and liquidity > $0.5m
BuyPrice = O; // Buy todays open

Sell = 0; // We don't need an explicit stop as we use trailing stop


// Set up trailing stop
ApplyStop( stopTypeTrailing, stopModePoint,Trail,  0, True );

// Set the position size so we only lose 2%
PositionSize= 2*BuyPrice/Trail;
// If the position is larger than 25% of our money then
// ask for a smaller amount
PositionSize = IIf(PositionSize >  MaxPosition, -MaxPosition, -PositionSize );
/**********************************************************************************************/


----------



## mit (18 July 2005)

*Re: Developing a System to Trade Live*

The trade stats are as below. The drawdown at over 80% is too high. Also the 72% annual profit is suspect when I test the sensitivity of the parameters. I reduced the trail multiplier from 6.5 to 6 and the profit halved.  
Sorry about the untidy format. I'll have to think of a way to get it tidier.

MIT

All trades
Initial capital        10000
Ending capital        67918.76
Net Profit        57918.76
Net Profit %        579.19%
Exposure %        65.86%
Net Risk Adjusted Return %        879.37%
Annual Return %        72.10%
Risk Adjusted Return %        109.46%


All trades        531
 Avg. Profit/Loss        109.07
 Avg. Profit/Loss %        7.37%
 Avg. Bars Held        107.95


Winners        245 (46.14 %)
 Total Profit        122567.66
 Avg. Profit        500.28
 Avg. Profit %        28.98%
 Avg. Bars Held        165.38
 Max. Consecutive        32
 Largest win        5362.52
 # bars in largest win        148


Losers        286 (53.86 %)
 Total Loss        -64648.9
 Avg. Loss        -226.05
 Avg. Loss %        -11.14%
 Avg. Bars Held        58.74
 Max. Consecutive        15
 Largest loss        -2092
 # bars in largest loss        65


Max. trade drawdown        -2548.8
Max. trade % drawdown        -74.65%
Max. system drawdown        -44040.84
Max. system % drawdown        -81.39%
Recovery Factor        1.32
CAR/MaxDD        0.89
RAR/MaxDD        1.34
Profit Factor        1.9
Payoff Ratio        2.21
Standard Error        13743.75
Risk-Reward Ratio        1.19
Ulcer Index        38.21
Ulcer Performance Index        1.75
Sharpe Ratio of trades        0.23
K-Ratio        0.04


----------



## mit (18 July 2005)

*Re: Developing a System to Trade Live*

I added the trend confirmation using the Guppy MMA as follows:

AND BarsSince( Cross(MA(C,50), MA(C,45) ) ) > period
AND BarsSince( Cross(MA(C,45), MA(C,40) ) ) > period
AND BarsSince( Cross(MA(C,40), MA(C,35) ) ) > period
AND BarsSince( Cross(MA(C,35), MA(C,30) ) ) > period
AND BarsSince( Cross(MA(C,35), MA(C,5) ) ) > period
AND MA(C,50) < MA(C,45)
AND MA(C,45) < MA(C,40)
AND MA(C,40) < MA(C,35)
AND MA(C,35) < MA(C,30)
AND MA(C,35) < MA(C,5)



and the profit increased to 98% and the drawdown reduced to 65%. Better but the drawdown is still larger than we would want. The profit seems incredible mainly because the market between March-2003 and March-2005. I'll do a run up until March-2003 and we should see the difference.

Time to feed to dogs

MIT


----------



## GreatPig (18 July 2005)

*Re: Developing a System to Trade Live*

Mit,

What settings are you using for your backtests?

I ran your exact formula (without the GMMA additions) as a backtest in AmiBroker and couldn't get anything like the results you got. Best I could get from 1/3/2003 to 31/3/2005 with buy on today's open and no brokerage was about 42% pa. With $20 brokerage per trade and buy on average price one day delayed I could only get about 28% pa. And the maximum system draw-down in the latter case was only -8.35%.

That was all using the ASX200 list as the stock universe, although another test using all stocks gave about the same result.

Cheers,
GP


----------



## mit (19 July 2005)

*Re: Developing a System to Trade Live*

GP,

Thanks, I'll have a look. I am using $20 a side as well. It looks to me as though it is trying to run in futures mode. I have deliberately have tried not to put forward a perfect system so the beginners can see how much you have to do to check it out.

MIT


----------



## mit (19 July 2005)

*Re: Developing a System to Trade Live*

GP,

That's interesting. I had futures mode set to off in the code. I had it set to off in settings but because I had Margin Requirement set to "1" in the settings Amibroker ignored the other settings and put it into Futures mode. (I usually test leveraged systems).

Using your period I get 24% annual profit and 6.5% drawdown. That's with the GMMA included and my asx200 could be out of date so it is pretty close to your result.

Michael


----------



## RichKid (19 July 2005)

*Re: Developing a System to Trade Live*



			
				mit said:
			
		

> Loakglen,
> 
> I thought we were going longer term for the beginners? Personally I have a long term system and would like to round out my systems with a short term system (I even have an idea for a go-short system). Maybe do a long term system first?
> 
> MIT.




I thought we were going for a short term system too as Techtrader is clearly there for those who want a tested longterm system.


----------



## Milk Man (19 July 2005)

*Re: Developing a System to Trade Live*



			
				RichKid said:
			
		

> I thought we were going for a short term system too as Techtrader is clearly there for those who want a tested longterm system.




Well I never wanted short. Just shorter than Techtrader. Medium being my preference. I like what MIT has come up with so far anyway; as a bare bones.


----------



## RichKid (19 July 2005)

*Re: Developing a System to Trade Live*



			
				loakglen said:
			
		

> Well I never wanted short. Just shorter than Techtrader. Medium being my preference. I like what MIT has come up with so far anyway; as a bare bones.




So would we define this method we are creating as one involving trading over weeks and months (as opposed to days)? I'm new to this so please excuse the need for detail. I assume techtrader is a longterm system in the sense of it looking at multi-year periods.


----------



## mit (20 July 2005)

Continued from the other system development thread. To continue developing a medium/long term systems.

MIT


----------



## mit (20 July 2005)

*Re: Short/Long term system development*

Story so far. The main idea was to buy on open shares that reach a 52 week high. To make sure that the stock is in an upward trend over a medium term we make sure that the long term set of EMAs of GMMA have not touched or crossed for some time and are in the appropriate order.

Exit for now is from a trailing stop. Brokerage is as per Commsec 19.95 upto 10k, 29.95 up to 20k and 0.12% after this.

We only risk 2% on each trade. The position size is then set that if we hit the trailing stop we will lose 2%. But if the size of the position is greater than 15% of our total capital we limit it to 15%


/********************************************************
 Aussie Stock Forums System
*********************************************************/

// Setup Options
SetOption("InitialEquity", 10000);
SetOption("FuturesMode", False);
// Parameters
TrailATR = 6.5; 
Period = 40;
MaxPosition = 15; 
// Set the trailing stop also used to set the position size

Trail = ATR(14) * TrailATR;

// Yesterday was 52 week high and liquidity > $0.5m

Buy = Ref(H,-1) >= Ref(HHV(H,250),-1)
AND EMA(V*C, period) > 500000
AND BarsSince( Cross(MA(C,50), MA(C,45) ) ) > period
AND BarsSince( Cross(MA(C,45), MA(C,40) ) ) > period
AND BarsSince( Cross(MA(C,40), MA(C,35) ) ) > period
AND BarsSince( Cross(MA(C,35), MA(C,30) ) ) > period
AND BarsSince( Cross(MA(C,35), MA(C,5) ) ) > period
AND MA(C,50) < MA(C,45)
AND MA(C,45) < MA(C,40)
AND MA(C,40) < MA(C,35)
AND MA(C,35) < MA(C,30)
AND MA(C,35) < MA(C,5)
;


BuyPrice = O; // Buy todays open

BarsSinceBuy = BarsSince(Buy);

Sell = 0;

// Set up trailing stop
ApplyStop( stopTypeTrailing, stopModePoint,Trail,  0, True );

// Set the position size so we only lose 2%
PositionSize= 2*BuyPrice/Trail;
// If the position is larger than 15% of our money then
// ask for a smaller amount
PositionSize = IIf(PositionSize >  MaxPosition, -MaxPosition, -PositionSize );
/**********************************************************************************************/


----------



## mit (20 July 2005)

*Re: Short/Long term system development*

Testing for the period 1-Mar-1999 until today returned 17% per annum on average (MDD 26%). Which is better than the market. 
However, there would be some survivorship bias in the results as we are using the current asx200.

There was a discussion on another thread about bang for buck. One way to measure this is the equation ATR()/C. A higher value means that a share is more volatile than other shares.

On  any day if you have more shares than you have money, Amibroker by default simply pick's shares in alphabetical order. 

You can override this and by including the line

positionscore = ATR()/C

tells Amibroker to buy shares in order of bang for buck. I added and the difference was SFA. Which surprised me as I expected a difference one way or the other. It could be that the GMMA filter forces a lower volatility.


----------



## Milk Man (21 July 2005)

*Re: Short/Long term system development*

Can you guys test a portfolio exit for me based on the XJO?
I'm on to TJ (Amibroker Creator) about it but still no reply on how to  fix my setforeign function.
I'm going to do up the index so I can get around it that way   

Here it is:

SetForeign("xao",True,False);
Sell=Cross(L,EMA(C,180));
RestorePriceArrays(False);

It should fit in nicely with your trailing stop.

Have a play and see what you come up with- 

Thanks.


----------



## Milk Man (22 July 2005)

*Re: Short/Long term system development*



			
				loakglen said:
			
		

> Can you guys test a portfolio exit for me based on the XJO?
> I'm on to TJ (Amibroker Creator) about it but still no reply on how to  fix my setforeign function.
> I'm going to do up the index so I can get around it that way
> 
> ...




Don't worry about it- I fixed it myself! I'm smarter than I thought- I can fix a simple data prolem   

I'm coming up with some pretty good stuff with that idea. There's heaps of stuff, most of which ive never heard of on the Amibroker site even just to get ideas.


----------



## mit (22 July 2005)

loakgen,

There is also some interesting things you can do in Amibroker with your equity curve. Using the XJO is good but I have noticed that in a short term my equity goes north when the XJO goes south and visa versa. I think that this is because the few largest stocks tend to drive the market or a particular sector drives the market.

Another one if to do an equity based filter do the following. Run your system in backtest.

Add the following line:

AddToComposite( Equity(), "~RawEquity", "X" );

Do a scan and a new ticker "~RawEquity" should appear. It will be in group 255. Now comment out the line above

and you can use

eqC = GetForeign("~RawEquity","C");

and do pretty much the same thing you are doing with XJO.

I have done some work on this system with good results, I'll post when I get a minute.

MIT


----------



## mit (22 July 2005)

*Re: Short/Long term system development*



			
				loakglen said:
			
		

> Don't worry about it- I fixed it myself! I'm smarter than I thought- I can fix a simple data prolem
> 
> I'm coming up with some pretty good stuff with that idea. There's heaps of stuff, most of which ive never heard of on the Amibroker site even just to get ideas.




The last six months with Amibroker have been pretty exciting. Now that you can get very low level with the backtester we can try things that no other system can do (Other than writing a backtester from scratch). I currently find it hard to get my head around some of it. but to be able to test ...

. pyramiding into and out of a position. (Some systems can simulate it with difficulty)
. Test position size based on portfolio size (A person with $10k may be willing to risk 5% but someone with $200k may only want to risk 1%).
. Or if the last buy signal was unsuccessful then double/halve the bet on the current signal

I think that there could be some amazingly profitable techniques out there to be discovered beyond what people have been able to do over the last 10 years or so.

MIT


----------



## tech/a (25 July 2005)

Any further headway on this?

Is there a sticking point?

Can I help?


----------



## mit (25 July 2005)

Sticking point is time at the moment. I have done some changes and am getting good results of around around 28%. Just need time to write it up. I have some work deadlines I need to meet (Alas I will be happy when I can trade full time). Probably write up the latest tomorrow.

MIT


----------



## Artamon (25 July 2005)

*Re: Short/Long term system development*

G'day all,



			
				mit said:
			
		

> Testing for the period 1-Mar-1999 until today returned 17% per annum on average (MDD 26%). Which is better than the market.
> However, there would be some survivorship bias in the results as we are using the current asx200.




I tried this in AB and got nowhere near these results. For this period I got a total of 39 trades! And 4% annual return. Obviously something is amiss in my settings. Can anyone else confirm the above figures???

Thanks,
Andrew.


----------



## mit (25 July 2005)

Could you show me your code and your settings? Look under amibroker\reports and you should be able to zip the report and send it to me or post it on the site. 39 trades seems way too low. Are you running out of equity?

MIT


----------



## Artamon (25 July 2005)

Hiya,

After updating my ASX200 I now get 65 trades but still only just over 6% annual return. i'm using the AB code posted previously.

How many open positions are we allowing? I have it set at 5. Setting it higher gives me 87 trades and just over 8% return but my MaxDD goes from 18% to 27%.

Still something not right though. 

Thanks,
Andrew.


----------



## Artamon (25 July 2005)

sorry, forgot to attatch backtest report


----------



## mit (26 July 2005)

Artarmon,

If you could zip all of the files for this report as I would like to see the settings as well. 

MIT


----------



## Milk Man (26 July 2005)

Just a thought on the survivorship of the XJO issue- does anyone know where to get past XJO lists or actually have any? I think this is a pretty big problem with testing the current XJO so i'm just testing on liquidity basis ATM.
Getting returns of 35% and have come up with a new indicator (someones probably already come up with it but its new to me). I don't think it fits with a 'buy high and sell higher approach' though as it buys on momentum. Do you guys want a look anyway?

P.S- If you get any unusually large profits check there arent gaps in your data- 264%pa I wish!


----------



## Artamon (26 July 2005)

Hi all,

Complete backtest report.

Thanks,
Andrew.


----------



## mit (26 July 2005)

Loakglen,

Certainly looks interesting. Post it, it sounds worth looking at. Yes there is a survivorship bias in using the current asx200. However, it is much quicker backtesting using the asx200 rather than the entire asx with a liquidity filter. I just keep in the back of my head that I am getting a better number than reality. When I get a system that seems robust I then do it against the entire asx and hopefully it will just shave a few percent off. Unfortunately, sometimes the system just falls apart entirely. The system I am currently trading actually did better against the asx rather than just the asx200.



MIT


----------



## mit (26 July 2005)

Artamon said:
			
		

> Hi all,
> 
> Complete backtest report.
> 
> ...




Great,

I'll look at it on the train tomorrow. I have a three hour train trip on Wednesdays to go to the big smoke.

MIT


----------



## mit (26 July 2005)

Artarmon,

Found the problem. Well my problem actually. The parameters I am using are not the ones above. I must have used the above setting when I was seeing the sensitivity of the settings.

Use:

Period = 15


I originally had period = 15 but then I thought that this was a pretty short period so I lengthened it to "40" as I thought it made better sense. But 40 does a lot worse and went back to 15.  

MIT


----------



## Artamon (26 July 2005)

mit said:
			
		

> I originally had period = 15 but then I thought that this was a pretty short period so I lengthened it to "40" as I thought it made better sense. But 40 does a lot worse and went back to 15.




Hiya MIT,

Yep that did it. Annual return of just under 18% and max system DD of just under 17%. All up, there were 92 trades in that period, according to my backtest. The results are largely due to 2 trades - CTX (almost 300% profit) and OSH (180% profit and still going). A lot of other very decent trades too though. 

Testing from 1/1/2000 to present yielded 78 trades, 21.8% annual return, 14% max sys DD and from 1/1/2004 to present yielded 21 trades, 23.8% annual return, 9.9% max sys DD. Obviously, this last period was a very good time in the market. 

Andrew.


----------



## Milk Man (27 July 2005)

Heres the formula:

pos=IIf(C>O,Sum(C-O,50),Null); // plots the value of positive momentum 
neg=IIf(O>C,Sum(O-C,50),Null); // plots the value of negative momentum
IIf(C>O,Plot(Sum(C-O,50),"pos",colorBlue,styleLine,styleLeftAxisScale),Null);
IIf(O>C,Plot(Sum(O-C,50),"neg" ,colorRed,styleLine,styleLeftAxisScale),Null);	
x=4;
y=4;
Buy= pos>HHV(pos,260)/x AND H==HHV(H,260)   AND Sum(V*C,260)/260>10000000 ; 
/*Buy when momentum is above ratio of highest Value of pos (see chart) and highest high of price in 260 bars*/
Sell= pos<=HHV(pos,260)/y AND Ref(pos,-1)> HHV(pos,260)/y;	
/*sell is same as buy in reverse is 'y' value so it can be toyed with*/	
SetOption("initialequity",10000);					
PositionSize=-20;
PlotShapes(shapeUpArrow*(Buy),colorGreen); 
PlotShapes(shapeDownArrow*(Sell),colorRed); 
Plot(HHV(pos,260)/x,"",colorBlack,styleLine);
Plot(HHV(pos,260)/y,"",colorBlack,styleLine);
BuyPrice<H+(Sum(H-L,15)/10);

IMPORTANT: SETTINGS!
Buy and sell on open with delay of 1 (next open after signal if im correct?)
Max stop- 15% with exit intraday and re-entry delay =1
Profit target- 25% with exit next day at trade price and re-entry delay=1
Brokerage- $25 (to account for autmated stops)
5 open positions at a time

These are my results 1-1-00/22-7-05
Annual return-38%
Avg trade length- 56bars
Win rate- 61%
Max drawdown- 22%

Please pick it to bits.


----------



## mit (27 July 2005)

Artarmon,

Great just a few more things before we can start tearing it part again and looking at the optimization. The system simply looks at beating the 52 week high and makes sure that the long term GMMA are separated.

Now a share that is just drifting along can probably just drift up to a 52 week high. We want some shares that have some oomph. One function is ROC. This is just the percentage change between now and some period in the past. Because today could be an up day and the close n periods ago could be a down day. We do it against an EMA to smooth the curve out a little.

Adding the line

AND ROC(EMA(C,5),20) > 20

Which says that the share has returned 20% over the last month. For me it hits an annual return of 33%. Even between 01-Mar-1999 and 1-Mar-2003 returns 21%. (Unless somebody finds an error)

I would still like to look at the 52 week entry. Whether to look at a pull back and partial recovery after a 52 week high, or a short term entry. 

Another area to investigate is to sell on some kind of weakness rather than a trailing stop.

Thirdly use Amibroker's 4.7 features and try scaling in and out. Or as we are starting at a low capital start try using 5% risk at the start and move to 1% risk as the capital builds.

MIT


----------



## mit (27 July 2005)

loakglen,

I can't reproduce your results. I get 4% return over the period (seems to be a common problem with this thread). 


MIT


----------



## Milk Man (28 July 2005)

mit said:
			
		

> loakglen,
> 
> I can't reproduce your results. I get 4% return over the period (seems to be a common problem with this thread).
> 
> ...




My data is in cents so the volume is actually $100000 not $10mil.
Hope that fixes it!

The system does suffer pretty bad drawdowns over different timeframes. I'm just trying to remedy that ATM. Currently, return is 28% 1/1/00-22/7/05 and max drawdown is about 14% over any time-frame. The worst it has performed is -10% 1/1/05-22/7/05 but I think that's just the initial drawdown effect.

You might want to try scanning your start/finish dates as well.

I'm going to play with some volume tests and see how that goes. 

Cheers


----------



## idribble (28 July 2005)

F/A will always win in the end.  Why bother buying a stock that is not making money?  You may be surprised to learn that you can wait for a couple of quarterly reports to confirm a strong balance sheet and still buy value.  And get great trading opportunities, and good short term increases in SP.  The so called "great opportunities" in the market are not restricted to companies with new products, exploration companies or the like. 

1) A recurring revenue stream (that a customer base is constant).

2) Organic growth of revenues from that existing base.

3) Potential to acquire revenue streams from acquisition of new customers.

4) A product that is easily differentiated, with strong brand and pricing power.

5) A cost base that is constant or lagging revenues on a marginal base.  The best base is one that is fixed.

6) Exists in a market that is expanding, and the position of the company is improving within that market, ie. Increasing market share.

7) High return on equity.

8) High operating cashflows (you can fudge profit but you can’t fudge operating cashflow).

Avoid Companies that fail point #1.

There is always a sector that these rules apply, and there are always companies that fit these rules.  And these companies usually have plenty of  appreciation left in their SP, long after you have identified them.  In direct contrast to speccies.


----------



## Milk Man (28 July 2005)

idribble said:
			
		

> F/A will always win in the end.




That's a point of contention. Its results can't be easily quantified unless you go burrowing through years of annual reports. T/A is my weapon of choice for this reason.

You can talk about Buffet all you like but that doesn't give us all the ability to pick winners on Fundamental Basis.


----------



## idribble (29 July 2005)

loakglen you said >>You can talk about Buffet all you like but that doesn't give us all the ability to pick winners on Fundamental Basis.<<

Actually I couldn't agree more.  

What I was trying to communicate was that the market will eventually recognise the fundamental value of the company, to the extent of the current strength of the market.

I'm not suggesting that F/A is better than T/A at all.


----------



## idribble (29 July 2005)

..... and further loakglen, that check list I posted is extremely easy to tick off.  

You don't have to have any special skills to evaluate a company against that criteria.  Got any stocks that are relevant?


----------



## mit (29 July 2005)

idribble,

I am curious about your comment "FA will always win in the end" Do you mean that as a method it beats TA or that a company will eventually reach it's "true" value?

I am curious about FA because I don't really know what kind of returns you can expect. Through backtesting I know what you can expect using mechanical TA and extrapolating out to what a good discretionary trader can make.

I know a couple of people at work who just did FA and weren't making money until I showed them the use of simple EMA crosses and trailing stops. Also they weren't accounting properly. They buy a share it would go down and sell it 12 months later and then sell it when it came up again and think they made a profit, when it was a loss.

I have two problems with pure FA (as opposed to looking for healthy companies and using TA to get in and out)

1/ The simplest FA doesn't work. (I'm trying to find a PDF document I had on it) where people were testing various formulas such as sustained EPS growth. Debt, PE and the such like. The only thing that worked was buying companies with high PE with a simple sell strategy.

2/ I believe that more in depth analysis can pick better companies as you need to put the numbers into context. High Debt may make sense for some companies (Envestra for instance). Historical EPS growth should be ignored as the company is getting to be too large a player to replicate high historical growth (Origin Energy) and so on. But it can get very subjective.

3/ When do you sell? Going down is no reason to sell. The share not moving is no reason to sell. When does the share become a "dog". Also there is the emotional attachment. Share forums are full of people who are holding onto stocks that have lost the majority of their value and hanging onto every word that the chairman has released.

I am not trying to knock FA investing as I don't know much about it especially from a successful FA trader and I would be interested in hearing from "pure" FA traders about how they invest end to end (When to buy, money management and when to sell)

A reasonably simple mechanical portfolio share system can return 20-30+% a year on average and take a couple of hours a week to run.  T/T has shown this live. Tech himself says that there are private versions around that return better results I believe this as I have a  completely different system which returns better results. I believe that discretionary traders can return much more.

MIT


----------



## Milk Man (29 July 2005)

I know how good f/a can be. The best trade i've ever made was fundamental-Australian Hospital Care: got taken over by Mayne. Need I say more.

If youve got the patience to do things fundamentally its great. I do plan on doing some business this way still; i'd like to do take-over bids on TV networks and send their owners to the poorhouse for being such lousy SOB's.  
I like the whole robin hood type scenario- without the tights and poofy shoes that is.

But seriously, maybe we could develop a system based on f/a and t/a to trade live. (after i'm finished with the t/a threads would be good- missus keenon smashing computer already)


----------



## tech/a (29 July 2005)

Just a suggestion.

Why not pick your universe of stocks from F/A and time entry and exit with T/A.

MIT

I'd like someone who trades in a discretionary manner show live over say 6-12 mths that they can return better than 50% on capital invested----trading shares.--I am getting a bit more than that on T/T---well got that for 3 yrs before I sold the lot in June.


----------



## mit (29 July 2005)

loakglen said:
			
		

> I know how good f/a can be. The best trade i've ever made was fundamental-Australian Hospital Care: got taken over by Mayne. Need I say more.




But this is a single trade. I'm just wondering about people who systematically trade FA. What is their annual return/drawdown and so-on. I know most fund managers invest using primarily FA and on average barely make the index. But this is unfair as they have issues due to their size and rules in what they can and can't invest in.



> But seriously, maybe we could develop a system based on f/a and t/a to trade live. (after i'm finished with the t/a threads would be good- missus keenon smashing computer already)




I'll see if I can find the pdf. The high PE system sounds interesting.

MIT


----------



## Milk Man (29 July 2005)

Yeah, the fundies aren't a fair view on f/a. They can't maneuver well enough with their size and theres sure to be a lot of corporate back-scratching going on.


----------



## mit (29 July 2005)

tech/a said:
			
		

> I'd like someone who trades in a discretionary manner show live over say 6-12 mths that they can return better than 50% on capital invested----trading shares.--I am getting a bit more than that on T/T---well got that for 3 yrs before I sold the lot in June.




Tech,

You would have to find someone who could do it and somebody who was motivated to do it. Somebody once said that it is easier to get somebody to talk about their sex-life than to admit what they make trading.

Guppy makes in his newsletter around 70% a year. I know he got a bit of a bad rap back in Stock Central days but I think that he got a bit lazy with his paper trading, not that he was cooking the books. Even if you took out the suspect exits then I still think that his profit was still high. 

Alexander Elder mentions in his book classes of profitable trader and he talks about the best earning around 100% per year.  Again not proof, but you rarely hear any thing bad said against Elder.

... But I could just be gullible ...

Some clues are that they don't really seem to actually have many trades per year, maybe a dozen or so, so they are very selective. Another clue is a comment by Linda Raschke (sp?) in that she day traded entries and exits and she said that turned some average systems into good systems. Change your system to buy on the low of the day and sell on the high of the day and see the difference. Not that you could always pick the highs and lows but a small improvement can make a large difference to your numbers.

Maybe, we mere mortals can do it. Run a 20%+ medium/long term system but be extremely picky on which buy signals to take. Say, look for two additional reasons to buy it (Just above a long term support, or nicely following a trend line).

Also don't just buy on the next day but wait for a short term entry signal and  buy at the point in the day that is most likely to be the low for the day. 

Same for exits.

MIT


----------



## tech/a (29 July 2005)

mit said:
			
		

> Also don't just buy on the next day but wait for a short term entry signal and  buy at the point in the day that is most likely to be the low for the day.
> 
> Same for exits.
> 
> MIT




Done some work on this.
I found in the end that all averages out with enough trades.
Like selling or buying on the next open.
Sometimes the next open will be higher sometimes lower.
Sometimes youll pick it better sometimes youll be late or to early.

But yes I do agree that some discretionary element/s can increase performance.I've done it myself.
Your comment about frequency of trades makes sence.
I think that the more often you trade (Unless trading a single futures contract that you know) the more likely you are to lose.


----------



## mit (29 July 2005)

Tech,

Yeah, agree, I've tried backtesting it myself. I was thinking more like the following. You run the system. Get a couple of candidates. Put them on a watch list and watch their charts daily and use your basic TA for the entry. You might buy one because it has bounced off support with an initial very tight stop below the support or it may have just completed a 1-2-3 pattern (Initial stop at the 2). or it may have just had fulfilled a 5-day volatility break out.  

After it starts moving you can revert to the longer stop used in the mechanical system but you may exit early because it had failed its trend line. Or has four black candles in a row on high volume Or the CEO has just been thrown in jail or it has just created a double top.

This might be worth doing in parallel with this project. Run a version mechanically and we can have heaps of fun fighting over best entries on our discretionary version.

MIT


----------



## Milk Man (30 July 2005)

I think the discretionary element in selecting buys will be very intresting when going live. Unsure on premature exit on untested parameters though.
Kind of undermines the system IMO.


----------



## tech/a (30 July 2005)

Loakglen

I agree,I think the discretionary part *shouldnt* be any of the parts which makeup the basis of the system.
Those that i use dont determine when to buy rather those prospects (which have been found by the entry criteria) are selected for eyeballed---best potential.

Again I'll mention my 2 criteria.

(1) Cant' have been ranging over a few years eg:- $1.20-1.65 up and back up and back--fairly tight range--unless the breakout entry is out of this range.

(2) Must either be in a clear trend OR Clearly breaking a down trend and breaking into a possible new up trend.


----------



## idribble (1 August 2005)

Hi there MIT.  I am saying that companies will eventually realise their true value, and F/A will be the reason why.  (F/A is obvious once it's happened!!, similar to the argument against T/A)  I do agree with you that F/A is terribly difficult because you simply cannot have all the pieces to the jigsaw puzzle ..... then you have to take market sentiment into account.

I simply look for companies showing continued improving cashflow and cash,  and buy on the dips (decent dips).  ROC is a good example.  Couldn't understand why the market lost interest in them.  The CEO did an open briefing a few months ago and it made for compelling reading.  They are no different a company now than they were a couple of months ago.


----------



## idribble (1 August 2005)

g'day techa, you posted >>(2) Must either _be in a clear trend _  OR Clearly breaking a down trend and breaking into a possible new up trend.<<

What about a stock _in a clear trend of improving cashflow?_  I'm not talking some piddly little tech or mining company, a decent company with a couple of quarters' of increasing cashflow and an improved balance sheet.

These companies are easy to find and are usually in one of the hot sectors.  There are not normally too many of them, and they always seem to have plenty of price appreciation left in them AFTER a couple of good quarterly's.


----------



## tech/a (1 August 2005)

dribbles.

What you suggest would probably be fine.
I was just re stating the 2 I've adopted for Techtrader over the last 3 yrs.


----------



## idribble (2 August 2005)

I wasn't criticisng your post or the content tech/a.

Just putting forward a very, very simple way of selecting stocks, that shouldn't put you in a crook stock.


----------



## tech/a (2 August 2005)

Dribbles
I'm certaintly interested in anything that identifies a way of selecting a universe of prospects that has a stronger probability of a positive return than others,as this alone I have found will have a dramatic effect on your chances of success,in particular the degreee of success.

How would or where would you find information to do this?
Do you have a list from say 3 yrs ago? (I doubt it as this will be similar to identifying a margin list or the ASX 200 3 yrs ago.)--just that if you did we could test it.


----------



## idribble (3 August 2005)

Sorry, haven't got any database or the like.


----------



## mit (3 August 2005)

Try

http://www.ascii-data.com/index.html

It has some historical Fundie data.
MIT


----------



## mit (3 August 2005)

Back to the subject at hand. I did some more work on the system. I played with the actual breakout. I tried a second attempt at a breakout or if the breakout is the first actual 52 week high for 12 months and none gave a better results. Some seemed to increase the EXPECTANCY but reduced the OPPORTUNITY more. If we could take some leverage with CFDs it might be worthwhile.

I then looked at the system as is. I took out the Guppy GMA and it improved the result. I also dropped the liquidity requirement to $100k. The core buy code is now
=======================================================
New52WeekHigh = Ref(H,-1) >= Ref(HHV(H,250),-1);

Liquidity = EMA(V*C, period) > 100000 AND StrLen( Name() ) == 3;

Momentum = ROC(EMA(C,5),ROCPeriod) > ROCMin; 

Buy =  
New52WeekHigh
AND Liquidity
AND Momentum
;

BuyPrice = O; // Buy todays open
======================================================

This results in an average annual return of 39% and even a return of 20% to March-2003. I have included the entire report.

MIT


----------



## tech/a (4 August 2005)

Dropping the liquidity requirement would in some cases make a trade buy or sell impossible as there wouldnt be the volume to fill it.

Think youll find that universe selection will be more important and more positive than the entry.
Have you a stop in place?

Only other comments are that the R/R ratio is very low--under 2.5
and the recovery factor of 5 + is high.


----------



## mit (4 August 2005)

Tech,

Stop is a trailing stop at 6 atr. 

The return is okay but I wouldn't trade it as yet. The drawdown is in one particular year but the other years do well. I think I'll look at the parameters now and see what happens.

The liquidity is lower but you are starting with $2k positions so it shouldn't be hard getting fills. Really for a beginner once you position grew you'd margin it and go for a system with a lower drawdown.

MIT


----------



## Milk Man (29 August 2005)

Well, after spending about 5 hours every day staring at this bloody monitor I have something I think we can trade!

51% annual return
51% winners
max. string of losses= 6
30.4% max. drawdown

To put that in perspective; if you started with $10000 at 1/1/95, you would now be the proud owner of $810000 worth of aussie stocks! (not counting tax, interest, divs etc)

Check the attachment for a full run-down.

Thank you to all who aided in its creation especially Greatpig and Kaveman for their Amibroker help and Tech/a for constant words of wisdom.

See you all in the Bahamas!  :bier:


----------



## tech/a (29 August 2005)

Just a few things.

Can I have a look at the Stats?
Have you delayed the entry and exit by 1 day?
What is your universe of stocks?

Thanks.


----------



## doctorj (29 August 2005)

Have you limited your universe of stocks?  I've just copied the formula into amibroker and deleted a couple of zero's to reflect my data being in dollars and tested it over this year (-4% net profit,36% Max DD) and from 1/1/2004 until Friday which didn't show anything much more encouraging (3.35% annualised return, 33% winners of 18 trades executed with a max DD of 46$).

Testing back to 2000 is a little more promising, but is primarily the product of two trades.  See stats for testing back to 2000 below.


----------



## Milk Man (29 August 2005)

Try this (attached). There was something wrong with it but I don't know what. Just tested at about 55% pa 1/1/00-26/8/05

Tech-
The universe is just the xao- uncut. All the universe mods I made didn't seem to work any better.

I set buy and sell delay to 1. This just buys next day on open and sells next day on close.


----------



## doctorj (29 August 2005)

Have so far been unable to replicate results anything like yours.  I'll keep plugging away.


----------



## tech/a (29 August 2005)

Ok a few things.

The Reward to Risk Ratio is only 1.25 this is very low 2.5 is the expected minimum.I trade 3 systems the worst with 8. best 12x.

Try the method using 50K rather than 1 million.

Also try various dates 2000-2005,2001-2005 etc.

It is possible (And Montecarlo Analysis will bear this out) That the Standard deviations are very wide and there maybe of 5000 tested portfolios 1000 that win and 4000 that lose---you have a winner--if you traded it on another set of dates it may be a loser.

I'll also try and code it to Metastock and see how it goes there.

Good work though its got to stand all tests so dont think everyone is ganging up!


----------



## doctorj (29 August 2005)

Good point.  Loakglen's system will only benefit from the rigors of thorough testing.

Tech, most of us have studied techtrader and its evolution in detail via the threads at reefcap.  Could we convince you to share the other systems you trade for educational purposes?


----------



## tech/a (29 August 2005)

Doc.

I really do want to have some things for me.Ive spent 100s of hrs and dont wish to give it all away.After all the best learning is that which you experience.

But I will say that one is a weekly system which is a hybrid of the method Steve adopted on Reefcap.

The 3rd is another longer term method.
All are based around Margin Stocks thats what I trade.

I'm yet to find a medium term method which stacks up.
By that I mean a stock trading portfolio type method.
I really think if your going to trade in this manner you should be trading Futures.(Medium or short term).

I also like the idea of trading one or 2 favorite stocks heavily.
I also think we trade with blinkers---we should be trading the bourses which are out performing---not just the ASX.


----------



## Milk Man (30 August 2005)

I'm seeing even better results with 25% positions. Ive also altered the min position size, to account for initial drawdown possibilities, to $1350 and the max s/price of  stock to $50. Getting bad return on 1/1/2004 to present and 1/1/2005 to present. The main issue seems to be cash managment.

I have tried portfolio stop buy and sell criteria with some success but I felt they were optimized too much for the periods I was testing.

Since the reward/risk ratio's are so low the cash management has to be spot on. What it boils down to ATM is "do I trade my free capital or is it not enough for a new position". 

PS- tech, my data is in cents so portfolio size is 1 million cents not dollars.


----------



## tech/a (30 August 2005)

Loak.

I'm trying to code ami to M/S so have a few questions---most is OK.

What is the code for Priceboundcheck?

What does Null mean? (Zero?)

Think I'm OK with the rest.

Ta Muchly.


----------



## doctorj (30 August 2005)

"PriceBoundChecking" - if set to False - disables checking and adjusting buyprice/sellprice/coverprice/shortprice arrays to current symbol High-Low range. 

IIf(C>O,Sum(C-O,60),Null);  

Translated:

IF Close is greater than the Open
THEN Pos is equal to the sum of (Close - Open) for the last 60 days
Else Pos = null

Null is to have no value - null does not equal zero.


----------



## tech/a (31 August 2005)

Thanks doc.

Metastock when using the IF function is a little different.

I should be fine.

Thanks


----------



## Milk Man (1 October 2005)

Sorry for the delay guys, first day off at home since last attempt. The joys of dairy farming!

I'll attach a copy of what i'm up to. The % gains are down but the drawdowns are way down. This leaves the door wide open for those wanting to gear. Keep in mind that data is in cents (ezycast sucks! do not subscribe!) so dollar gains are cents and liquidity is cents etc. 

Please pick it to bits. One thing i'm wary of is the 'universe'. The sooner we get something to use the sooner we can test it in real time; eliminating the crystal ball effect that using XJO or margin lists might have on backtesting.

Has anyone else done anything? Not making any headway or found something too good to share  ?


----------



## Milk Man (16 November 2005)

Please find attached the results, formula and settings for this puppy. Sorry, I didnt realise you guys couldnt view all this on previous post  . I'll also attach all the watchlists in the amibroker formula. If you import them into amibroker and number them 10-21 from oldest to newest it will work straight up. Again, remember data is in cents so youll probably have to knock the last two zero's off the numbers that are too big. Ezycast was bought by Bodhi so my data should be fixed soon anyways.

Let me know if your numbers arent stacking up the same as mine- but ill be buggered if I know why they have been in the past.


----------



## Milk Man (16 November 2005)

Here are the amibroker files for the watchlists. "jan00" corresponds with watchlist10 in the formula. So you can start watchlist 10 by adding a common stock to all watchlists in there (BHP or something) then importing the unzipped jan00 file. I use the "whole lot" file to test from instead of "all files" (heaps quicker) so just save it to a watchlist thats not 10-21 and select it. You dont have to do it this way but otherwise youd just have to change the watchlist numbers in the formula.

Good luck.

PS- You all owe me a beer; that watchlist crap took me ages on the S&P site.


----------



## Milk Man (16 November 2005)

Heres some more: they wouldnt all fit.


----------



## Milk Man (16 November 2005)

Heres the last of em. PHEW! 
:


----------



## Artamon (11 January 2006)

G'day all,

Has anyone been forward testing this strategy since it was posted back in November??? 

Cheers,
Andrew.


----------



## tech/a (11 January 2006)

For those interested there is some good work happening here.
Both Amibroker and Metastock code.

http://lightning.he.net/cgi-bin/suid/~reefcap/ultimatebb.cgi?ubb=get_topic;f=15;t=000264;p=6

Different to what was discussed here but promising in the medium longterm.


----------



## doctorj (12 January 2006)

Have been following the thread, but as of yet been unable to replicate their results on my end.

Anyone else following?


----------



## Milk Man (12 January 2006)

Should have returned about 5% since it was posted. My data was corrupted so it wasnt actually as good as was tested initially. Forward testing is the most important part IMO to check the formula isnt "data mined",  to use nick's expression.


----------



## Milk Man (12 January 2006)

I knocked this one up with the new and improved data. Hopefully the results look the same as someone elses for a change. Returns around 35%pa and 25% drawdown, although results for 2005 were 15%. Seems to improve as timeframe gets longer. Could well be too data-mined though.


----------



## Milk Man (7 February 2006)

Profit now looks like 12.5% since first posted as at 16/11/2005. Is anyone else getting different results to this?


----------



## stevo (21 February 2006)

MM
I am just trying to get to grips with the POS indicator and your system in general. 

Why use NULL in the code for POS? If I test POS without the NULL statement I get the same results. POS also also plots the same with and without NULL, except that the blanks get filled in. 

Am I missing something?

stevo


----------

