# Channel Trading & Stops



## get better (6 April 2016)

So I've spent the last few months coding away at an idea I've had for a while (nothing new though) - using a mechanical system to channel trade. I think I've finally coded something up that works and tested thoroughly through Amibroker.

As a part of my testing, I was playing around with the trailing stop I set in the system - I originally had it set at 15% and it gave me the following results over a 5 year period:



While playing around with the stop loss, I started making it wider and wider just to see how the results would change and was a bit dumbfounded with the results. This is what a 30% stop looked like:



I have tested this over different sampling periods as well and the results still show the same thing. The wider the stop, the higher the % annual return. However, drawback is that the drawdown also increases with wider stops.

Has anyone else seen the same sort of phenomena here? This is the first time I've seen a system that increases in profitability by having wider stops...


----------



## Wysiwyg (6 April 2016)

get better said:


> I have tested this over different sampling periods as well and the results still show the same thing. The wider the stop, the higher the % annual return. However, drawback is that the drawdown also increases with wider stops.
> 
> Has anyone else seen the same sort of phenomena here? This is the first time I've seen a system that increases in profitability by having wider stops...




Your backtester settings and consideration of actualities are far far from reality. I have been where you are and it is exciting thinking a backtest can deliver so much. I started backtesting trading ideas in 2009.


----------



## Trendnomics (6 April 2016)

get better said:


> Has anyone else seen the same sort of phenomena here? This is the first time I've seen a system that increases in profitability by having wider stops...




I don't think "_phenomena_" is the correct word to use (i.e. rough definition: "_something that is impressive or extraordinary_") - maybe a better word to use is "_fact_" (i.e. rough definition : "_something known to be true_"). 

I've repeatedly observed this (what you have described) during my earlier years of back-testing and this "fact" can easily be explained in terms of general risk-reward understanding (i.e. the greater the potential risk, the greater the potential reward).  

As I've stated in other posts, I am a firm believer that robust and highly profitable systems can be found in the psychologically "un-tradeable" universe (i.e. system with high potential draw-downs) - it's up to you to control your inner caveman.

Hence, the reason why my trend-following system has very wide stops (i.e. fixed 30% from initial entry - no trailing).


----------



## Trendnomics (6 April 2016)

Wysiwyg said:


> Your backtester settings and consideration of actualities are far far from reality. I have been where you are and it is exciting thinking a backtest can deliver so much. I started backtesting trading ideas in 2009.




Back-testing has it's merits, given the testing performed reflects real trading. 

The higher the win rate of a system, the more accurate your back-testing needs to be (precise slippage, brokerage, available trade volume) - vise versa: the lower the win rate, the less accurate your back-testing needs to be (approximate slippage, brokerage, available trade volume).


----------



## cynic (7 April 2016)

By allowing a trade more breathing space (via wider stops) the trader is effectively increasing the likelihood of larger drawdowns on each trade, whilst at the same time potentially improving the overall success rate of the trades. 

However, this needn't necessarily translate into an improved profit performance, as the more numerous profitable trades will still need to overcompensate for the fewer (albeit larger) losses in order to justify the case for wider stops.

At the extreme, a superior success rate might be achieved by using the widest possible stop (i.e. none at all). Again one needs to consider whether there is sufficient reward to compensate for the additional risk.

Getb, I've observed a number of volatile markets that also tend to mean revert. Such markets do offer the prospect for superior rates of return to traders with a commensurate tolerance for drawdown.


----------



## Wysiwyg (7 April 2016)

Trendnomics said:


> Hence, the reason why my trend-following system has very wide stops (i.e. fixed 30% from initial entry - no trailing).



I have also found trend following systems are easier to trade and there are many variations of them. I consider the missed opportunity (i.e. other trending stocks) that being in an extended period underwater with a wide stop loss experiences when the price has stopped trending.


----------



## rnr (7 April 2016)

get better said:
			
		

> I have tested this over different sampling periods as well and the results still show the same thing. The wider the stop, the higher the % annual return. However, drawback is that the drawdown also increases with wider stops.
> 
> Has anyone else seen the same sort of phenomena here? This is the first time I've seen a system that increases in profitability by having wider stops...




Based on the equity graph and average trade frequency of 33 trades per month for the initial system I would hazard a guess that this a mean reversion system and not a trend following system.
If this assumption is correct then it is reasonable to expect that an increase in profitability would result in an increase in drawdown.

In a trend following system increasing the stop from 15% to 30% would generally have a detrimental effect on profitability and drawdown.


----------



## CanOz (7 April 2016)

rnr said:


> Based on the equity graph and average trade frequency of 33 trades per month for the initial system I would hazard a guess that this a mean reversion system and not a trend following system.....






> Re: Channel Trading & Stops




I'm also guessing its mean reversion....unless he's taking breakouts of a channel, which don't work that well...


----------



## get better (7 April 2016)

Ah, yes that was the word I was after - its more of a mean reversion strategy. The best word I could come up with was channel trading because it kinda trades in a short channel i.e. in between the upper/lower ranges of bollinger bands (just as an example).

I recently started paper trading the system to see if it 'actually' works in reality but will need to do this for a few months and put it through the trial of fire before doing anything else with it. One thing I have been very conscious about is for everything to be as close to reality as possible. Slippage is something I have been focusing on a lot in the paper trading.


----------



## rnr (7 April 2016)

get better said:
			
		

> I recently started paper trading the system to see if it 'actually' works in reality but will need to do this for a few months and put it through the trial of fire before doing anything else with it. *One thing I have been very conscious about is for everything to be as close to reality as possible. Slippage is something I have been focusing on a lot in the paper trading*.




Why do you believe that slippage is relevant to your system (Entry, Exits or both)?


----------



## Wysiwyg (7 April 2016)

rnr said:


> Based on the equity graph and average trade frequency of 33 trades per month for the initial system



Yes smells like a buy open and sell close same day or sell next day at such frequency or no signal delay. Not one mc random pass was negative and the brokerage would be at $40 (20 in/out) per trade * 1750 = 70k. Top it off with unlimited funds available to take each trade.


----------



## get better (7 April 2016)

rnr said:


> Why do you believe that slippage is relevant to your system (Entry, Exits or both)?



I'm only concerned about slippage when it comes to trading the stocks < $0.50. Slippage of a few cents would make a huge difference to whether a trade may or may not be profitable. The buy/sell parameters I have set doesn't give much leeway to slip a few cents with lower priced stocks. It's not so much of an issue with > $0.50.

I have a volumne*price limiter that stops it trading anything with less than an average of $1,000,000 over a one week period but it still manages to pick up stocks < $0.50 every now and then.

I would be interested to hear your thoughts on slippage and its actual impact on mechanical systems.



Wysiwyg said:


> Yes smells like a buy open and sell close same day or sell next day at such frequency or no signal delay. Not one mc random pass was negative and the brokerage would be at $40 (20 in/out) per trade * 1750 = 70k. Top it off with unlimited funds available to take each trade.




The settings used is buy close price and sell close price using 1 day delay for both. Brokerage has been included - using $15/trade, this probability isn't very realistic, I will change it to a % as this will have a huge impact as the account gets larger. Surprisingly enough, the system doesn't generate many buy signals and is also very short term. I've noticed that on average, trades are only held for a few days. The risk adjusted return is generally much higher but it isn't shown in any of the monte carlo results so I try not to pay too much attention to it.

I don't usually focus too much on the backtest result, only the monte carlo results. Reason for this is because the monte carlo results will randomise the actual trades if there are too many buy signals and it'll show me how robust the system is. My understanding is that it'll give every permutation that could occur and then compile the results in those monte carlo charts. I think that the results can then be interpreted in a probabilistic sense as well (i.e. if 10% of results are negative, you can be 90% confident that your trading results will breakeven or generate profit).

I've tested momentum and swing trading type systems before but have never had results similar to what I'm seeing now. What's even scarier is that out of sample testing yields similar results. To be honest, I'm skeptical that it works in reality, that's why I'm putting it through rigorous paper testing. I have a feeling there's a hiccup somewhere in the data, a setting somewhere or the code itself but am unable to pinpoint it.


----------



## rnr (7 April 2016)

Wysiwyg said:


> Yes smells like a buy open and sell close same day or sell next day at such frequency or no signal delay. Not one mc random pass was negative and the brokerage would be at $40 (20 in/out) per trade * 1750 = 70k. Top it off with unlimited funds available to take each trade.




You have misinterpreted my comments as the thoughts you have expressed are not in line with my conclusions.

Mean reversion systems generally have a high win rate between 60 to 80% and a high trade frequency which is reflected in the equity graph.

The equity graphs of a mean reversion system and a trend following system differ significantly!


----------



## rnr (7 April 2016)

get better said:
			
		

> The settings used is buy close price and sell close price using 1 day delay for both.




Just looking at each component of the system one at a time whilst maintaining the integrity of the code.

You receive a signal today to ENTER a long trade (assumption) on the *next bar* - does your system require the price to drop before buying the equity at CLOSE?


----------



## Wysiwyg (7 April 2016)

I want to help you and others with the settings in Amibroker and how they must be used if you want to test closer to realistic. If you're not interested then I won't post on this thread anymore.    


get better said:


> The settings used is buy close price and sell close price using 1 day delay for both.



This is the big setting issue because the program will sell and buy the same day/price  that you set. That is you get a signal the prior day to sell a stock in your portfolio and buy another stock that has met your criteria. So come the following afternoon close, the program sells one stock and buys another stock. This is obviously impossible on that setting but as poster Trash pointed out this can be overcome with programming if you know how. Otherwise change the buy/sell time (next day sell open, buy close) so the funds are available to buy at the close *This is because your funds will be fully invested most of the time and all available funds could be tied up at buy time.* 


> Brokerage has been included - using $15/trade, this probability isn't very realistic, I will change it to a % as this will have a huge impact as the account gets larger.



Exactly. Commission has to be what you would pay in reality at all stages. 







> Surprisingly enough, the system doesn't generate many buy signals and is also very short term.



Over 1750 trades in 5 years works out to about 30 trades per month average which will add significantly to your commission as the bank grows in the backtest. 


> To be honest, I'm skeptical that it works in reality, that's why I'm putting it through rigorous paper testing. I have a feeling there's a hiccup somewhere in the data, a setting somewhere or the code itself but am unable to pinpoint it.



That is true.


----------



## AlterEgo (8 April 2016)

Yes, I have noticed this before. As Howard Bandy, and others have stated before - "stops hurt performance". I believe this is more relevant to mean reversion type trading than trend following though. And I presume that what your system is doing is basically mean reversion - buying at bottom of channel and selling at top of channel type of thing?

Remove the stop altogether and you should see the % return increase even more. If you must use a stop, use a number of bars stop, or something else, not a price stop. No matter how far away you put the stop, it will get hit often enough to reduce the overall performance.


----------



## get better (8 April 2016)

Wysiwyg said:


> This is the big setting issue because the program will sell and buy the same day/price  that you set. That is you get a signal the prior day to sell a stock in your portfolio and buy another stock that has met your criteria. So come the following afternoon close, the program sells one stock and buys another stock. This is obviously impossible on that setting but as poster Trash pointed out this can be overcome with programming if you know how. Otherwise change the buy/sell time (next day sell open, buy close) so the funds are available to buy at the close *This is because your funds will be fully invested most of the time and all available funds could be tied up at buy time.*




Thanks for this gem, I hadn't considered this case. I'll look into the settings and look at aligning this with the case above.


----------



## Wysiwyg (10 May 2016)

I suppose this post could go in the breakout thread but it was a well defined channel so here shall do. Sorry for delay but the channel breakout happened yesterday but what is glaring with this chart is the gap down on the left. No predictions. Not holding (too many stocks to choose from).

OFX


----------

