Australian (ASX) Stock Market Forum

System exits

Joined
5 January 2006
Posts
4,461
Reactions
1
Does anybody here have a system that shuts off:

*when the index passes below a certain point ? (eg. moving average).

*Or when maxDD reaches a certain point?

Or any other parameter that causes the system to switch off?

Did this enhance results in backtesting and/or actual trading?

Some discussion would be appreciated.
 
Jose Silva had a market breadth filter that worked on the AD line. Thats about all I know though... google pegasus trading, that might yield some ideas.
 
Nizar, my 2 cents,

One of the more interesting short-term trading switches, and used by some successful short-term traders that I am aware of, is using an MA or EMA of the system's equity curve. This could also be applied to longer-term systems.

I have done some 'basic' testing in this area, however I am still battling in properly coding this for my particular application in this area (still a WIP ... because my Equity Curves are flat during non trading periods, and these bars would be part of an MA calculation within my code !), so I unable to comment much further at this time.

Concerning switches in general, the benefit of such a switch, may only be obvious in hindsight, and using insufficent statistics to develop and make assumptions about the usefulness of such a switch (particularly in its future use).

On another note, but further to the discussion of long term trading, one switch or filter, that often comes up in these types of discussions is the Coppock Indicator.

http://www.incrediblecharts.com/technical/coppock_indicator.htm
 
There are 2 clearly defined parameters here Nizar.

(1) Switching a system off when it performs outside the numbers it generates particularly at the top end of Deviations from the mean of Montecarlo analysis.

(2) Switching a system off with a filter of some sort.
I have tested a few switches and have many Id like to test.
(1) I have tried a Relative Strength Comparison between the Universe I am trading and the All Ords.While this did improve results it also killed Nett return due to TAX issues.
(2) Id like to try R/S V Universe Im using and stocks in my portfolio.
(3) Then there is trading the/your equity curve.
(4) Jose's A/D line is a proven technique as I orgininally discovered in
"The Encyclopedia of Technical Market Indicators by Colby"

When trading longer term methods these filters generally shorten hold time and in doing so cause TAX problems unless of course their arent introduced until after 12 mths holding.---Havent tried that either.

Stevo Doesnt BUY any new positions if certain INDEX conditions arent met.

There are literally zillions of ways to filter a portfolio.
One thing I liked was to sell a portfolio at/near a top then re buy the whole portfolio identical to the one you sold at a low.

Ie sell at the top of a wave 3/5 buy back at a wave 4/1 of an index or Custom index of your universe of stocks or custom index of your portfolio.
Ive done quite a bit of work with Custom Indexes with which you can compare relative strength with.

Here are 2 Custom indexes I have.
The left chart is Techtrader.
The right 50 Small Uranium Miners.

The right chart tends to kick the Resourse theory of on going and stronger than other sectors in the head!!

Chart 2 is a comparison between Large Caps on the left with Small Cap uranium miners on the left.

As you can see endless things you can do with Filters.
 

Attachments

  • Custom.jpg
    Custom.jpg
    57.1 KB · Views: 176
  • Custom 2.jpg
    Custom 2.jpg
    77.5 KB · Views: 176
Wayne, weird, thanks for your responses.
I'll be looking into Jose Silva's technique. He seems a bit of a MS/Tradesim guru.

One thing I liked was to sell a portfolio at/near a top then re buy the whole portfolio identical to the one you sold at a low.


Tech, thanks for your response, but for the quote above, i think this is beyond me, as this will rely on my discretion to try and pick the top and then try and pick the bottom. Dont really think i have the skill (or luck!) to be able to do so successfully.

And who says those same stocks are going to up again??
 
Tech, thanks for your response, but for the quote above, i think this is beyond me, as this will rely on my discretion to try and pick the top and then try and pick the bottom. Dont really think i have the skill (or luck!) to be able to do so successfully.

And who says those same stocks are going to up again??

Red: this is for fools and fools get burned.
Lime: exactamento! this is where I see the limitations with assumptions and the assumption that system trading works because of BACKTESTS.
 
When trading longer term methods these filters generally shorten hold time and in doing so cause TAX problems unless of course their arent introduced until after 12 mths holding.---Havent tried that either.
Yes an issue.

There are literally zillions of ways to filter a portfolio.
At the expense of ruining something in the process - issues galore.
 
Lime: exactamento! this is where I see the limitations with assumptions and the assumption that system trading works because of BACKTESTS.

What are the alternatives? Its the best we've got to work with, isn't it?? The future is not the past but it is derived from it...there's a connection. Inspite of people saying (assuming) history repeats, I don't agree with that...in my eyes (thankfully) it doesn't!

What allows one to make the assumption that the discretionary method they're using works? The person who gave it to you was successful? How do you know they weren't just lucky? Have you been successful? How do you know you weren't just lucky too? ("you" is not YOU Snake...can be anybody).

ASX.G
 
Nizar,

A few more thoughts, not sure of your trading method, however concerning long term trading, I trade 2 weekly systems (which use quite different methodologies). And the entries are often long between, and so is the holding period.

Usually I trade about 10 stocks at one time. Also I don't usually have the ‘luxury’ of picking stocks using a discretionary method, because there are not too many to choose from !

The conditions to trigger an entry, are not "extraordinary", but it is a very bullish indication for that stock, regardless of the market conditions. That is, not simply picking a stock because it simply above an MA.

I am not saying that my systems are not influenced by the broad market, because the equity curve often follows most of the troughs and peaks, however it does comfortably outperform the index.

For long term 'long' systems, the obvious filter in backtesting, would be to include some sort of broad market condition. I would agree in especially backtesting random or very simple systems, this would most definitely improve the results (and also in more advanced systems), however this does not mean that "all" long term systems would necessarily benefit from such filters. That is, also look at additional individual stock filtering, and this could even be compared to the broad market.
 
What are the alternatives? Its the best we've got to work with, isn't it?? The future is not the past but it is derived from it...there's a connection. Inspite of people saying (assuming) history repeats, I don't agree with that...in my eyes (thankfully) it doesn't!

What allows one to make the assumption that the discretionary method they're using works? The person who gave it to you was successful? How do you know they weren't just lucky? Have you been successful? How do you know you weren't just lucky too? ("you" is not YOU Snake...can be anybody).

ASX.G

Exactly Mr Gorilla.

We all know discretion is corrupted due to the BRAIN. But it is also better than any backtest will ever be. With that bias in mind what assumptions we have are very important. Those with fundamental ones feed those who don't and vice versa.

Backtesting gives us something to work with though. Maybe assumptions can be formed from this. When filters are added isn't this discretion?
 
Here is some TradeStation code for an Equity Curve stop that was discussed in my first book (Everyday Traders) by Van Oadya. I have never used it, but others may find something in it. The theory is you turn the system off if the equity curve falls below an average, say 30-period. You turn it back on again when the equity curve passes back through the average.



Inputs: Period(0);

Vars: Equity(0), UseEq(0), LastEq(0);
Vars: Mo(0), Countr(0), J(0), K(0), CE(0), Size(200), Last(0);
Vars: P1(0), P2(0), P3(0), P4(0);
Array: Per[5](""), EQ[200](0);

if (BarNumber = 1) then begin
Per[0] = "Per-Trade"; Per[1] = "Yearly"; Per[2] = "Quarterly";
Per[3] = "Monthly"; Per[4] = "Weekly"; Per[5] = "Daily";
print;
print(Per[Period] + " profit:");
end;

Mo = Month(Date);
Equity = I_ClosedEquity;

{ If our chosen period has expired, record the end-of-period equity }

if ((Period = 0) and (Equity <> Equity[1]))
or ((Period = 1) and (Year(Date) <> Year(Date[1])))
or ((Period = 2) and (Mo <> Mo[1]) and (Mo=1 or Mo=4 or Mo=7 or Mo=10))
or ((Period = 3) and (Mo <> Mo[1]))
or ((Period = 4) and (DayOfWeek(Date) < DayOfWeek(Date[1])))
or ((Period = 5) and (Date <> Date[1]))
then begin
if (LastBarOnChart = False) then
print(Date[1]:6:0,",",Equity:7:2,",",Equity-LastEq:7:2);
LastEq = Equity;
EQ[Countr] = Equity;
Countr = Mod(Countr + 1, Size); { Move pointer in buffer }
end;

{ On last bar, plot the last Size periods of equity }

if LastBarOnChart then begin
Value3=2/(30+1);Value4=1-Value3; { Setup 30 bar XMA factors }
for J = 0 to Size - 1 begin { Loop to plot bars }
K = Mod(Countr + J, Size); { Calc pointer into buffer }
If J=0 THEN Value5=EQ[K] { Calc 30 bar XMA if not first }
ELSE Value5=Value5*Value4+Value3*EQ[K];
P1 = 0; P2 = 0; P3 = 0; P4 = 0;
if (J > 0) then begin { Set J=0 bar to 0 to "erase" it }
if EQ[K] < Last then P1 = EQ[K]; { Plot losing periods in red }
if EQ[K] > Last then P2 = EQ[K]; { Plot winning periods in green }
if EQ[K] = Last then P3 = EQ[K]; { Plot flat periods in dark gray }
P4 = EQ[K];
end;
Plot1[Size - 1 - J](P1,"ClosedEq");
Plot2[Size - 1 - J](P2,"ClosedEq");
Plot3[Size - 1 - J](P3,"ClosedEq");
If J>30 then Plot4[Size - 1 - J](Value5, "average30"); { Plot white line at top of histogram }
Last = EQ[K];
end;
end;
 
at/near a top

This doesnt mean attempting to pick tops and bottoms.
This is placing a set of conditions within a system which when tested either improves or fails to improve a method.

Way Way different from attempting to pick a top or bottom.

And who says those same stocks are going to up again

Well I do.
I've actually taken the time to check if this occures within portfolios.
AND it does in mine which is the (Broadly) ASX 300.
If a stock was/is performing strongly before a correction or downturn,I have found it will continue to do so when trading resumes bullish.
So you sell high and buy MORE with the profit at a lower price.
(As I say havent perfected it but has promise).

assumptions and the assumption that system trading works because of BACKTESTS.

Snake no "Assumptions" relative to backtesting.
If you have a positive expectancy System it will have a "Blueprint" if trading subsequently trades within the Blueprint then you WILL be profitable.

If testing is purely based upon assumption then next time your in a plane just hope that the "Assumptions" made when testing "Metal Fatigue" stay within the "Blueprint"!
 
The theory is you turn the system off if the equity curve falls below an average, say 30-period. You turn it back on again when the equity curve passes back through the average.

Turning it back on does not mean buying back the same stocks again does it?

It could be -- but it could be different stocks, depending on which ones meet the entry criteria again (first).

Weird -- looks like you have a great system, one which doesnt trigger too many entries so doesnt leave alot of room for discretion.
Thank you for your thoughts.

ASX.G -- I agree.

Tech -- Well if you have tried and tested this method, then im not gonna argue with the results! ;)
 
Does anybody have a metastock/tradesim code or any ideas on how to apply a signal for the system to turn off and then back on?

Nick's idea was interesting; an equity curve stop.
Any thoughts on how you code this?

Stevo Doesnt BUY any new positions if certain INDEX conditions arent met.
Tech -- do you know how to code for this?

And what does system turning off actually mean?
That you dont take any new entry signals and only take exit signals?

Thanks.
 
Does anybody have a metastock/tradesim code or any ideas on how to apply a signal for the system to turn off and then back on?

Nick's idea was interesting; an equity curve stop.
Any thoughts on how you code this?

Tech -- do you know how to code for this??


Wow----Nizar need to do some crawling first.(As in learning not begging for the solution!!).
But I have Tried switches,For me I need to use the clunky "P" variable,for you with the newer version you can use the "Compare security".

And what does system turning off actually mean?
That you dont take any new entry signals and only take exit signals?

Thanks.

It can Steve Does this in his --Check his blog.
I'm still playing with the idea.
There are many possible answer to what it means.
(1) As suggested
(2) Sell all of the portfolio and buy it all back when the switch is turned.
(3) As (2) but buy new triggers.

HINT
For triggers I have made a composite chart of the portfolio--Equity curve.
one of the index asx300
one of those in my universe
and a few others these are my switches.

Do they improve things.
Marginally---from current testing,but there is potential---ask me in 6 mths when this settles.
I sold my entire portfolio/s at 6170 from analysis and the Switch was teling me to do the same!
 
......On another note, but further to the discussion of long term trading, one switch or filter, that often comes up in these types of discussions is the Coppock Indicator.

http://www.incrediblecharts.com/technical/coppock_indicator.htm

The Coppock Indicator was mentioned in today's Eureka Report. It mentioned that this indicator has now fallen below zero and that it can have some value in suggesting where the next bull market may lay. If I read it correctly the indicator was last at this point in May 2003. Prior to that it was 1995. There are claims, I understand, that the Indicator can successfully pick the next wave up.

I'd never heard of the Coppock indicator and did a search on ASF, finding this thread. Any comments?
 
Here are several variations take your pick

Coppock curve 22 250 150:

(Mov(ROC(Mov(C,22,S),250,%),150,E))/100
_____________________________________________

Coppock Curve Jose

mo1:=Input("Close MA:",1,252,21);
ro1:=Input("ROC periods:",1,2520,252);
Smooth:=Input("Coppock Smooth:",1,252,150);

Mov(ROC(Mov(C,mo1,E),ro1,%),Smooth,E)
_____________________________________________

Coppock curve 11 14 10 W signal

A:=Mov((((C-Ref(C,-11))/Ref(C,-11)) +
((C-Ref(C,-14))/Ref(C,-14))),10,W);
Sig:=Mov(A,5,S);
Red:=If(A<Ref(A,-1),A,0);
Green:=If(A>Ref(A,-1),A,0);
Sig;
Red;
Green;
_____________________________________________

Coppock curve W Kase filter 5 34 13

Pk:=Mov((((MP()-Ref(MP(),-5))/Ref(MP(),-5)) +
((MP()-Ref(MP(),-34))/Ref(MP(),-34))),13,W);
Per1:=30;
MN:=Mov(Pk,Per1,S);
SD:=Stdev(Pk,Per1);
Val1:=If(MN+(1.33*SD)>.382,MN+(1.33*SD),.382);
Val2:=If(MN-(1.33*SD)<-.382,MN-(1.33*SD),-.382);
Val3:=If(MN+(1.33*SD)>.25,MN+(1.33*SD),.25);
Val4:=If(MN-(1.33*SD)<-.25,MN-(1.33*SD),-.25);
LN:=If(Ref(Pk,-1)>=0 AND Pk>0,Val1,If(Ref(Pk,-1)<=0 AND Pk<0,Val2,0));
LN2:=If(Ref(Pk,-1)>=0 AND Pk>0,Val3,If(Ref(Pk,-1)<=0 AND Pk<0,Val4,0));
Red:=If(Ref(Pk,-1)>Pk,Pk,0);
Green:=If(Pk>Ref(Pk,-1),Pk,0);
Sig:=Mov(Pk,10,E);
Red;Green;LN;LN2;
Sig;
_____________________________________________

CCT Coppock curve

PK:=(ROC(CLOSE,14,percent )*10 + ROC(CLOSE,11,percent)*10 + ROC(Ref(CLOSE,-1),14,percent)*9 + ROC(Ref(CLOSE,-1),11,percent)*9 + ROC(Ref(CLOSE,-2),14,percent)*8 + ROC(Ref(CLOSE,-2),11,percent)*8 + ROC(Ref(CLOSE,-3),14,percent)*7 + ROC(Ref(CLOSE,-3),11,percent)*7 + ROC(Ref(CLOSE,-4),14,percent)*6 + ROC(Ref(CLOSE,-4),11,percent)*6 + ROC(Ref(CLOSE,-5),14,percent)*5 + ROC(Ref(CLOSE,-5),11,percent)*5 + ROC(Ref(CLOSE,-6),14,percent)*4 + ROC(Ref(CLOSE,-6),11,percent)*4 + ROC(Ref(CLOSE,-7),14,percent)*3 + ROC(Ref(CLOSE,-7),11,percent)*3 + ROC(Ref(CLOSE,-8),14,percent)*2 + ROC(Ref(CLOSE,-8),11,percent)*2 + ROC(Ref(CLOSE,-9),14,percent) + ROC(Ref(CLOSE,-9),11,percent))/2;
Per1:=30;
MN:=Mov(Pk,Per1,S);
SD:=Stdev(Pk,Per1);
Val1:=If(MN+(1.33*SD)>2.08,MN+(1.33*SD),2.08);
Val2:=If(MN-(1.33*SD)<-1.92,MN-(1.33*SD),-1.92);
LN:=If(Ref(Pk,-1)>=0 AND Pk>0,Val1,If(Ref(Pk,-1)<=0 AND Pk<0,Val2,0));

Green:=If(PK>Ref(PK,-1),PK,0);
Red:=If(PK<Ref(PK,-1),PK,0);
Signal:=Mov(PK,5,S);
LN;
Signal;
Green;
Red;

Just another indicator---nothing magical---unfortunately
 
Well if you own metastock then here is 4 versions (Metastock codes) of the Coppock indicator.
If you dont then I guess for you they are pretty useless.

Here a whole heap of questions relating to the Coppock indicator are answered.

http://www.bwts.com.au/qa.cfm?cmd=keyword&id=22

Youll also find here Colin Nicholsons Coppock Indicator spread sheets which you can up date.
For ASX NIKKI DJIA and others.
Note that the NIKKI has been negative for 6 mths! Way way negative!

http://www.bwts.com.au/text.cfm?15
 
Top