# Why isn't everyone rich trading these systems?



## lftrader (11 June 2016)

Another good post from PAL blog about mean reversion strategies. I backtested all three in SPY and returns are high. So my question is: Why isn't everyone rich trading these simple systems?  I guess this is a stupid question because not everyone can be rich but while tarders complain in America that markets are rough some very simple systems are making good money.


----------



## cynic (12 June 2016)

lftrader said:


> Another good post from PAL blog about mean reversion strategies. I backtested all three in SPY and returns are high. So my question is: Why isn't everyone rich trading these simple systems?  I guess this is a stupid question because not everyone can be rich but while tarders complain in America that markets are rough some very simple systems are making good money.



Take a closer look at the comments on that blog regarding the decline in recent performance of the more popular of the three systems. I believe it provides some insight into one of the unavoidable vulnerabilities of trading systems.


----------



## howardbandy (12 June 2016)

Greetings --

I researched many trading systems, written about them, and posted videos on YouTube.

All systems go through periods where profits add to account equity and losses subtract from it.  Most traders agree that the limitation to continuing to trade a system is drawdown in excess of the trader's risk tolerance.  The key to maintaining profitability over a long period of time is being able to recognize when the model portion of the system and the data it is processing are in sync and when they have fallen out of sync, then adjusting position size on a trade-by-trade basis in response to recent performance.

The videos will help clarify.  
http://www.blueowlpress.com/video-presentations
Begin with "The Importance of Being Stationary", then "The Four Faces of Risk."

One of the metrics I have developed is "CAR25."  It is the estimated compound annual rate of return for a trading system when the trade sizes are risk-normalized so that the drawdown does not exceed the trader's tolerance.  CAR25 can be used as a metric to compare any uses of funds, including trading.  

When various trading techniques are evaluated using risk-normalization, systems that trade frequently, trade accurately, hold a short period, and avoid large losing trades are superior.  While all trades are trend-following for the period the trade is held, the entry technique that most often fits the criteria mentioned above is mean reversion, such as RSI2.  (See my book "Mean Reversion Trading Systems" for a discussion of the RSI indicator and methods that relax the requirement that the lookback period be an integer.)

The key to staying profitable is continuing to monitor the recent trades, reducing position size when in a drawdown and increasing position size when the system is working well.

Thanks for listening,
Howard


----------



## Wysiwyg (12 June 2016)

Let me analyse this comment by the author .... 



> Michael Harris says:
> May 24, 2015 at 12:07 PM
> Hello Matt,
> 
> I used $0.01/share as noted in the article. In SPY, from inception to 05/22/2015 I get an average trade of 0.72% and average win to average loss of 0.81 for the RSI(2) system. Note that the performance of this system was basically flat in 2014 and this could mean that its potential gains are being arbitraged out. In comparison, the win rate (2) system returned 10.2% in 2014. I expect both systems to become unprofitable soon if serial correlation returns to the markets. Thanks and best regards to you.




1. "performance of this system was basically flat in 2014" = red flag 
2. "this could mean that its potential gains are being arbitraged out" = say anything but sound professional to fool the Neville No Ideas
3. "In comparison, the win rate (2) system returned 10.2% in 2014" = anything above a flat year performance is obviously better
4.  "I expect both systems to become unprofitable soon if serial correlation returns to the markets" = for the apparent non serial correlated systems -  sound professional but state the obvious. I expect it to rain if water falls from the sky 

Ulterior motives could be to lure more unsuspecting dreamers into the market. Baiting the hooks for the real professionals to reel in profits from.

If we wanted to be rich we would behave exactly like Buffett or Soros or Radge or Tech/A wouldn't we? There is much more to the game than that. It is called game time and as Howard eluded to you have to know when to trim the sails or go motor. Mechanically, I find that difficult because changes in range over time are not absolute in tradable issues.

Maybe I am an under resourced wanna be who hasn't found the magic yet.


----------



## get better (12 June 2016)

lftrader said:


> Another good post from PAL blog about mean reversion strategies. I backtested all three in SPY and returns are high. So my question is: Why isn't everyone rich trading these simple systems?  I guess this is a stupid question because not everyone can be rich but while tarders complain in America that markets are rough some very simple systems are making good money.




I don't think anyone can answer your question (unless they have a crystal ball) but here are a few observations:

The learning curve for understanding and developing trading systems is high for the average investor. Average investors would probably be more inclined towards buying a black box product or following other people's advice (i.e. stock picks) than putting in the hard yards to learn.
Those who are getting rich would most likely not share their work/ideas for fear of losing their edge. This will give everyone a perception that perhaps these systems do not work hence cannot get rich from trading them.

I have also had a few interesting experiences in trying to teach fellow investors about systems trading etc. Initially they are very interested and amazed at what it can achieve - particularly if they have a basic understanding of statistics and probability. However, I find that they all end up reverting back to whatever method they had developed themselves, i.e. stock picking on hot copper, fundamental analysis etc. I think this has more to do with psychology of people gravitating towards things they feel more comfortable with than anything else.


----------



## howardbandy (13 June 2016)

Greetings again --

The issue really is stationarity -- and dynamic position sizing in response to changes in stationarity.

The report quoted -- along with almost all reports of trading system tests -- assume that:

1.  The result posted is "the" result.  It is not.  

The purpose of a trading system's model is to recognize signals that precede profitable trades in the data it is processing.  It is important that the distribution of signal-profit pairs remain stationary over the period of test and following period of trading.  Lost of stationarity results in loss of profits.  Given any distribution of trades, the Best we can hope for is that the distribution is stationary.  If it is, then we can expect that the future trades will resemble the trades discovered during development.  We Cannot assume that the same trades will occur in the same sequence in the future.  Consequently, we cannot rely on metrics, such as maximum system drawdown, that are sequence-dependent.    

2.  The results are typical.  They are not.  

We do not stop adjusting systems until the results are good.  So good that they are well above the mean of the distribution of results.

3.  The distribution is stationary.  It is not.  

Determining the period of stationarity is one of the important tasks of the system developer.  It determines the combined length of the in-sample and out-of-sample periods.  If a system is stationary for, say, four years, then using walk-forward IS and OOS periods of four and two years just about guarantees that the OOS period does not resemble the IS period and the results will not be similar.

4.  That genuine learning took place during model development.  It may not have.

The model will always fit the in-sample data.  We guarantee that by expanding our search for something profitable until it does.  Whether the model learned to recognize a real and persistent profit-anticipating signal or was just fit to the random noise in the data can only be determined by a separate validation process.  That is, testing on data that is both more recent than the data used to set the rules and determine the parameters, and that has not been used or tested before.    

5.  The position size is fixed or is determined within the trading system model.  

It should not be fixed.  It should vary as the performance varies.  

It should not be determined within the trading system model.  It should be determined within the trading system Management model.  

This gives the trader an opportunity to tune position size as performance changes, and to recognize the onset of system failure in time to reduce position size to protect account. 

------------------- 

To beat the apparently not dead horse one more time, I recommend watching the two video presentations:
The Importance of Being Stationary  
https://www.youtube.com/watch?v=iBhrZKErJ6A&feature=youtu.be
The Four Faces of Risk
https://www.youtube.com/watch?v=Vw7mseQ_Tmc&feature=youtu.be 

---------------------

My view of individuals managing their accounts by mimicking the investing / trading techniques of Buffett and others who hold long periods is that that is way too risky.  At least for me.  Buffett had a drawdown of over 50% in 2009.  Government bailouts, which have yet to be unwound, gave Buffett his account back in a few years.  If 2009 had turned into 1929, it would have taken 30 years to get back to even.  If the issue held was Enron, there never was a recovery.

Unless the person managing the funds is sitting inside the boardroom of the company being traded, there is no information that is not present in the list of trades and their prices.  There is no way to distinguish a small correction from the beginning of a wealth-destroying crash.  Given that, the rational management procedure is to reduce exposure in response to losses.  I want to be flat, sitting on the sidelines, with most of my account intact, analyzing when to return to trading through monitoring of recent shadow trade performance -- rather than in a steep drawdown hoping for a recovery or bailout before I need to sell something to liquidate funds for some other purpose.

While my systems work focuses on short holding periods, it is primarily because the results of applying those methods can be demonstrated.  That said, I do have a macro view of the financial world ahead, and it is not optimistic.  The Western world experienced an exceptional advantage over the period following World War II up to about 2000.  That has given buy-and-hold and long-holding-period techniques a favorable tailwind.  I doubt that will continue.  Whether I am right or wrong, I expect systems that trade frequently, trade accurately, hold a short period, and avoid serious losing trades to out perform systems that hold longer.

That said, if some technique other than I one I recommend works for you, then ignore me and continue on.

----------------- 

Thanks for listening,
Howard


----------



## CanOz (13 June 2016)

Thanks for stopping by Howard, great post.


----------



## cynic (13 June 2016)

Yes thanks again, Howard. As usual, I cannot help but be impressed by the depth and thoroughness of your analyses of trading system model development.


----------



## lftrader (14 June 2016)

Many good answers. I will have to study this more. It is still a surprise to me that such simple systems have done so well. Is it maybe that most traders do not prefer simple systems but like complexity?


----------



## cynic (14 June 2016)

lftrader said:


> Many good answers. I will have to study this more. It is still a surprise to me that such simple systems have done so well. Is it maybe that most traders do not prefer simple systems but like complexity?




Howard Bandy's offerings are hard to surpass. When watching his presentations and reading his materials, one quickly comes to the realisation that there is a lot more to performance measurement than the arbitrary examination of a few sample periods.


----------



## Wysiwyg (14 June 2016)

lftrader said:


> t is still a surprise to me that such simple systems have done so well.



Could you supply a link to real trading account results where have they done so well?


----------



## tech/a (14 June 2016)

Wysiwyg said:


> Could you supply a link to real trading account results where have they done so well?




Radge has 4 or 5 going and you'll need to be a member to view.
There are a few more I know of and will post when I look them up at home.

I think there are a few things *holding back Joe public*/

(1) Knowledge--We aren't Howard Bandy
(2) Understanding what we should be looking for.

(2a)How we do that
(2b)What to do when we find it.
(2c)How to evaluate that correctly.
(2d)How to implement and monitor.

Howard has completed volume of work I've chewed through most.
They are fantastic books.
While I'm sure all the answers are there I need to have a 12 mth
Howard Bandy course to gain a competency in what most is advanced
systems testing.

You can only do a certain amount from a book/s---with the knowledge you have.
Howards or anyone else's!

There are a few who are *educated enough in enough fields *to really benefit,
But for the majority---

Having said that I know you don't have to be a Howard Bandy to succeed.
Sure would be good though!


----------



## Roller_1 (14 June 2016)

lftrader said:


> Many good answers. I will have to study this more. It is still a surprise to me that such simple systems have done so well. Is it maybe that most traders do not prefer simple systems but like complexity?




Complexity brings with it different issues i believe, how often have you heard the KISS principle attached to a number of things in life? Why should trading be different?

People like to make systems trading sound harder than it needs to be, mind you i am not a multi millionaire. A lot of the top systems traders talk about simple being best 

If a system has a large numbr of inputs or indicators there is a greater chance of one of these breaking down than a simple ROBUST system with fewer inputs.


----------



## CanOz (14 June 2016)

I think the other thing that allot fail to realize is that:

1.) it takes a portfolio of systems to usually make consistent returns, without consistency the comfort level disappears and the pain sets in, stopping the trader from continuing to execute the strategies as they were designed....

2.) allot of people don't have the capital to apply to a group of trading systems. 

3.) allot of developers sell or lease the systems to further augment cash flow. Some developers are selling optimized crap that can't stand up to any test of time, the sales or leases are there only source of real income.

This guy here certainly gives a trader something to think about before trading an algorithm, Dave Walton.

Better System Trader


----------



## smallwolf (14 June 2016)

probably because of this (referring to the IBS indicator referenced in the link)...

"The results show that the IBS technical indicator is a strong and consistent predictor of closeto-
close returns for equity ETFs trading in the U.S. Equity ETFs tend to mean revert on daily
timescales; when the closing price is in the top of the day’s range, close-to-close returns are
lower, and vice versa. *These results are generally not present in overseas markets, however*."
(source: http://tinyurl.com/j48nqqp)

not all systems work in all market at all times. A system that works for someone does not necessarily transfer easily elsewhere. the system at some point in time might start to fail. and that is why people tend to develop new systems to handle the market they trade in. interesting to note also the paper the quote is from also raises other issues like "catching a falling knife" (pg 7).


----------



## Gringotts Bank (14 June 2016)

OP, this is trading.....we're talking about free money.  It's obvious with such a situation that you'd have to rank above the 99th percentile to live off your proceeds, pay all your expenses, mortgage, children, holidays, superannuation.  I know only one person who does that here, skc.  There's probably others, but this should give you an idea what you're up against.  

OTOH, making a part time living is a bit easier.  A few here would be in that basket.


----------



## Roller_1 (14 June 2016)

Just because a system was flat one year doesn't mean it's broken or will never work. I would say a fair chunk of pro traders with 20+ years record would have had losing years but still traded th same and stuck with their systems. A lot probably lost cash in 08 or in this sideways market over the last few years doesn't mean their edge is gone


----------



## Gringotts Bank (14 June 2016)

Roller_1 said:


> Just because a system was flat one year doesn't mean it's broken or will never work. I would say a fair chunk of pro traders with 20+ years record would have had losing years but still traded th same and stuck with their systems. A lot probably lost cash in 08 or in this sideways market over the last few years doesn't mean their edge is gone




Pro traders can't have losing years.  To be professional means that even losing _months _must be rare.  Who or what is going to pay for living expenses?


----------



## Roller_1 (14 June 2016)

Gringotts Bank said:


> Pro traders can't have losing years.  To be professional means that even losing _months _must be rare.  Who or what is going to pay for living expenses?




People like Bill Dunn, Jerry Parker have had multiple losing years. They are pro traders. 

Im sure a retail trader that trades for a living doesn't spend every cent they earn in the good times, they have to be prepared for periods when their system or style isn't making money over longer periods  and put money aside


----------



## CanOz (14 June 2016)

Roller_1 said:


> People like Bill Dunn, Jerry Parker have had multiple losing years. They are pro traders.
> 
> Im sure a retail trader that trades for a living doesn't spend every cent they earn in the good times, they have to be prepared for periods when their system or style isn't making money over longer periods  and put money aside




There is a difference between 'fund manager' and 'trader'....it usually means a fund manager gets a salary and a trader gets a P/L....


----------



## Roller_1 (14 June 2016)

CanOz said:


> There is a difference between 'fund manager' and 'trader'....it usually means a fund manager gets a salary and a trader gets a P/L....





Yeah i understand that, but these guys don't just become or stay fund managers. In saying that pro scalpers etc probably wouldn't accept losing years


----------



## tech/a (14 June 2016)

Gringotts Bank said:


> Pro traders can't have losing years.  To be professional means that even losing _months _must be rare.  Who or what is going to pay for living expenses?




A pro Trader "Should" be like any other business and factor in a survival plan for years which are lean or negative.
They would or should also be backed with either enough Capital OR an alternate source.

I think you have this view that 'REAL" Pro traders must be 100% profitable 80-90% of the time.
Frankly if they make $500K (being right 30% of the time ) and lose $100k over the other 70% of time----good business! (Figures are examples only).

Plus they are less of a trader if they supplement income.
A pro trader can make a small fortune teaching others who want to be him/her---so why not.

20Yrs ago I went to see Guppy.
Average presentation but 300 X $150 a head---$45,000
and he was booked 3 nights straight in ADELAIDE---we turn the lights out at 10!

Smart pro trader!!


----------



## Gringotts Bank (14 June 2016)

tech/a said:


> 20Yrs ago I went to see Guppy.
> Average presentation but 300 X $150 a head---$45,000
> and he was booked 3 nights straight in ADELAIDE---we turn the lights out at 10!
> 
> Smart pro trader!!




Lot of work to get 300 people into one room, and paying.  That's a very decent crowd.


----------



## tech/a (14 June 2016)

Gringotts Bank said:


> Lot of work to get 300 people into one room, and paying.  That's a very decent crowd.




The lure of potential road maps to future riches will do it!


----------



## skc (14 June 2016)

Gringotts Bank said:


> Pro traders can't have losing years.  To be professional means that even losing _months _must be rare.  Who or what is going to pay for living expenses?




Depends on trade frequencies and trading style. I was listening to this interview with Peter Brandt who has 40+ years of professional trading experience... and he just went through a 15 month drawdown.

https://chatwithtraders.com/

You don't need a losing year to go backwards, as your expenses are pretty fixed year to year. Hopefully all professional traders (and anyone in any profession really) are wise enough to save up for the lean years. Having a second income in the household (selling seminars, working partner and other passive income etc) will also help.

Even if you buy a new BMW every month then at least you can still sell one for food... or drive UBER.


----------



## Wysiwyg (15 June 2016)

Roller_1 said:


> People like to make systems trading sound harder than it needs to be, mind you i am not a multi millionaire. A lot of the top systems traders talk about simple being best



Simple systems can be trend following systems but because price movement is not simple, the trend following system hits periods of long draw down and several losses in a row which is compensated for by (eventual) large wins. This may be palatable for those with deep pockets and time on their hands. Alternatively, trying to isolate a turning point to enter or exit the market requires more accuracy/timing hence analysis to make the strategy succeed. The nuances of each security are unique. Price movement isn't mechanical so how can it be defined by logic? Thoughts?           



smallwolf said:


> A system that works for someone does not necessarily transfer easily elsewhere.



By definition, a system is a set of rules to follow. If one does not follow the system then the same results that encouraged the system to be tried will not eventuate. Like you said, when the 10th loss in a row or large position loss comes along, most traders pull the pin. That is why I have a cynical view of anyone suggesting a system is exceptional. It is simply not so.


----------



## Wysiwyg (15 June 2016)

tech/a said:


> You can only do a certain amount from a book/s---with the knowledge you have.



Of course and as you have stated countless times it is the application that determines success or failure.  We know it isn't as simple as taking a price breakout that makes a trend following system successful. Parameters in a rough range to tech trader or another trend following system would have done well during the great mining bull run. Not magic but a great eye opener to us that come after.


----------



## tech/a (15 June 2016)

Wysiwyg said:


> Of course and as you have stated countless times it is the application that determines success or failure.  We know it isn't as simple as taking a price breakout that makes a trend following system successful. Parameters in a rough range to tech trader or another trend following system would have done well during the great mining bull run. Not magic but a great eye opener to us that come after.




Luck

I had no idea at the time of trading live T/T that we were in front of a screaming bull run.
The system was designed for exactly those conditions. I agree with your statement.

But strangely many still lose in bull runs or under perform. Maybe it's not so strange.

Today I certainly agree with Howard Bandy's observations in that shorter time frame methods are likely to be
More successful.
But correct monitoring of any method should be a given in maximizing return and mst of all minimizing loss.


----------



## Roller_1 (15 June 2016)

Wysiwyg said:


> Simple systems can be trend following systems but because price movement is not simple, the trend following system hits periods of long draw down and several losses in a row which is compensated for by (eventual) large wins. This may be palatable for those with deep pockets and time on their hands. Alternatively, trying to isolate a turning point to enter or exit the market requires more accuracy/timing hence analysis to make the strategy succeed. The nuances of each security are unique. Price movement isn't mechanical so how can it be defined by logic? Thoughts?




I trade a mean reversion system that is very simple it has minimal inputs, no optimized parameters, it works on different markets so its pretty robust so i don't think that short term systems have to be complex either. Like you said though accuracy is more important with smaller price swings but just a limit order help with this instead of buying on the open. It doesn't need to work perfectly on every security you just need to know if you have an edge over the long term just keep exploiting it.   



> Today I certainly agree with Howard Bandy's observations in that shorter time frame methods are likely to be
> More successful.




I wonder if eeryone will get back on the trend following train when the next bull market kicks off


----------



## tech/a (15 June 2016)

Roller_1 said:


> I wonder if eeryone will get back on the trend following train when the next bull market kicks off




Just be sure to let me know when that is so I can hop on.

There is more 
"Right time, Right place"
in many matters than you think.

Being long before a good take over.
Staying long in an early boom
(SMB as an example)

Getting out before a bust 2008
Going to that New years Eve party and finding my now wife.

Fooled by Randomness or putting your self in it (Anticipation) and getting HIT!


----------



## Wysiwyg (15 June 2016)

tech/a said:


> Going to that New years Eve party and finding my now wife.



Simply irresistible.


----------



## Roller_1 (15 June 2016)

tech/a said:


> Just be sure to let me know when that is so I can hop on.
> 
> There is more
> "Right time, Right place"
> ...




As you say if you system is designed to capture a trending market you have to be in waiting for it, ie sticking around after 2008 to cash in on 09


----------



## tech/a (15 June 2016)

Wysiwyg said:


> Simply irresistible.
> 
> View attachment 67107




Yep---she's cute


----------



## Quant (15 June 2016)

Roller_1 said:


> As you say if you system is designed to capture a trending market you have to be in waiting for it, ie sticking around after 2008 to cash in on 09




It is possible to build a system that trades almost any market conditions , it just needs to be dynamic , like the market .  Volatility filter is a MUST , using static stop losses will screw you , you need to adjust to underlying volatility  . Volatility is the most under utilized tool that traders have at their disposal , not many understand it at all . Patterns exist that are totally exploitable

People like simple systems but trading is complicated , Ive used a top down approach , building my system involved listing what i required from a system first . Then i worked on that list 1 point at a time , not a long list but no easy answers initially . #1 on the list is getting the list  . What is your acheivable end goal from a system ... expectancy , what can you do to improve BOTH sides of expectancy  . What matters and is measurable ? What are the parameters of these measurements that are meaningful ?  It isnt simple , that much is obvious


----------



## Roller_1 (15 June 2016)

Quant said:


> It is possible to build a system that trades almost any market conditions , it just needs to be dynamic , like the market .  Volatility filter is a MUST , using static stop losses will screw you , you need to adjust to underlying volatility  . Volatility is the most under utilized tool that traders have at their disposal , not many understand it at all . Patterns exist that are totally exploitable





When you say volatility filter, what are you using the filter for? positionsizing, market timing, entry/exit levels? or all


----------



## Quant (15 June 2016)

Roller_1 said:


> When you say volatility filter, what are you using the filter for? positionsizing, market timing, entry/exit levels? or all




All of that  . Dynamic position size , dynamic stop loss , Filter for entry itself . Has uses in multiple time frames , volatility is different in varying market phases and gives a headsup (probability wise ) on where price goes after parameters met . Its a very versatile tool

FWIW I am primarily daytrader with a 4-6 week hold my version of investing


----------



## Wysiwyg (15 June 2016)

This Mean Reversion system is simple and the results shown are quite good but I can't get a positive result for Ausralian stocks. I realise the test is done on American stocks but really, the rules are so basic it should be at least up on other stock markets. No stop loss so I used percentage 10. Fills are better assumed to happen at Open or Close price rather than a nominal limit order at 0.5 * ATR() so I left that out.  

http://alvarezquanttrading.com/2014...-a-mean-reversion-strategy-with-good-results/

Any thoughts on what was done to rate this 3 bars lower strategy so high?


```
PositionSize = -100/10; 
PositionScore = mtRandom();

SetTradeDelays(1,1,1,1); 

Turnover = MA(C * V, 10) > 5000000;

BuyRule1 = C > MA(C, 100);
BuyRule2 = C < MA(C, 5);
BuyRule3 = Sum(L < Ref(L, -1), 3) == 3;

SellRule = C > Ref(C, -1);

Buy = BuyRule1 & BuyRule2 & BuyRule3 & Turnover;
Sell = SellRule;

ApplyStop(0, 1, 10, 2);
```


----------



## rnr (15 June 2016)

Wysiwyg said:


> This Mean Reversion system is simple and the results shown are quite good but I can't get a positive result for Ausralian stocks. I realise the test is done on American stocks but really, the rules are so basic it should be at least up on other stock markets. No stop loss so I used percentage 10. Fills are better assumed to happen at Open or Close price rather than a nominal limit order at 0.5 * ATR() so I left that out.
> 
> http://alvarezquanttrading.com/2014...-a-mean-reversion-strategy-with-good-results/
> 
> ...




Why not test it on the ASX100 as per the initial rules (Entry <= Min(O,Ref(C-ATR(10)*0.5,-1)) & No stop-loss) and see how it stacks up.


----------



## Wysiwyg (16 June 2016)

rnr said:


> Why not test it on the ASX100 as per the initial rules (Entry <= Min(O,Ref(C-ATR(10)*0.5,-1)) & No stop-loss) and see how it stacks up.



Tried that and buying the low of the day doesn't produce a positive result.


----------



## howardbandy (16 June 2016)

A mean reversion system tested on Norgate Premium Data's 496 stock list of ASX.  Date range 1/1/1999 through 6/15/2016.  17.5 years (which is way too long to expect the same system to work without adjustment)
The code was recovered from a directory that was left untouched for two years.
Profitable on 407, not profitable on 89, traded individually.
Allowing all trades on all stocks, there are 141675 trades -- a little more than one trade per stock per month.
83% are profitable.
Average gain per trade is 0.40%.
Average holding period is 3 days.





The AmiBroker code

// BuyAfterAnNDaySequenceMultiPosition.afl
//
//	This is a modificatiion of Listing 3.2
//	BuyAfterAnNDaySequenceMultiPosition.afl
//	contained in the book
//	"Mean Reversion Trading Systems"
//	which is copyright  © 2013 Blue Owl Press, Inc
//
//	The author of the book and programmer
//	of the code is Dr. Howard B. Bandy.
//
//	Please read and understand the disclaimer
//	associated with all materials related to the book.
//
//	To obtain a copy of the book,
//	visit the book's website:
//	www.MeanReversionTradingSystems.com
//
//	This code is provided for the convenience of
//	readers of the book.
//	Please respect the copyright.
//	Do not post this listing without
//	the express written consent of Dr. Bandy
//
SetOption( "ExtraColumnsLocation", 1 );
SetOption ( "CommissionMode", 2 ); // $ per trade
SetOption( "CommissionAmount", 0 );
SetOption( "InitialEquity", 1000000 );
SetPositionSize( 10000, spsValue );
MaxPos = 500;
SetOption( "MaxOpenPositions", MaxPos );
//SetBacktestMode( backtestRegularRawMulti );
SetBacktestMode( backtestRegular );
SetTradeDelays( 0, 0, 0, 0 );
BuyPrice = Close;
SellPrice = Close;
// ObFn == K-ratio, CAR/MDD, expectancy

// Define a day as rising based on the closing price
Rising = C > Ref( C, -1 );
Falling = C < Ref( C, -1 );

// The number of days in the sequence
N = Optimize( "N", 2, 1, 7, 1 );

// Direction. 1 == Rising, 0 == Falling
Direction = 0; // Optimize( "Direction", 0, 0, 1, 1 );

// Exit variables
// Maximum holding period
HoldDays = Optimize( "HoldDays", 7, 1, 7, 1 );
// Profit target
ProfitTarget = Optimize( "ProfitTarget", 1.0, 0.2, 4, 0.2 );

// Detect an N day sequence

if ( Direction == 1 )
{
    NDaySequence = Sum( Rising, N ) >= N;
}
else
{
    NDaySequence = Sum( Falling, N ) >= N;
}

Buy = NDaySequence;

Sell = 0;

ApplyStop( stopTypeProfit, stopModePercent, ProfitTarget );
ApplyStop( stopTypeNBar, stopModeBars, HoldDays );

// Plots
Plot( C, "C", colorBlack, styleCandle );
shapes = IIf( Buy, shapeUpArrow, shapeNone );
shapecolors = IIf( Buy, colorGreen, colorWhite );
PlotShapes( shapes, shapecolors );

/////////////// end /////////////////

Best,
Howard


----------



## ThingyMajiggy (16 June 2016)

howardbandy said:


> A mean reversion system tested on Norgate Premium Data's 496 stock list of ASX.  Date range 1/1/1999 through 6/15/2016.  17.5 years (which is way too long to expect the same system to work without adjustment)
> The code was recovered from a directory that was left untouched for two years.
> Profitable on 407, not profitable on 89, traded individually.
> Allowing all trades on all stocks, there are 141675 trades -- a little more than one trade per stock per month.
> ...




Off topic, but thought I'd let you know your website isn't working Howard. Any of them(Blue Owl Press either).


----------



## howardbandy (16 June 2016)

Thanks for the heads up.  I found out a short time ago.  I am working on it as we speak.


----------



## qldfrog (16 June 2016)

And Howard,I have been on this site for a while now: your inputs are always extremely sharp and instructive;
Whether I follow TA or not is irrelevant: I want to convey my gratitude/thanks to you and i suspect I am not the only one to feel that way.
Tech/a, DeepState,Smurf1976 and in the past Julia have influenced part of my thinking.Thanks all
End of the warm feeling post, now i can go back raving against the latest PC views, migration issues, etc


----------



## Roller_1 (16 June 2016)

Wysiwyg said:


> This Mean Reversion system is simple and the results shown are quite good but I can't get a positive result for Ausralian stocks. I realise the test is done on American stocks but really, the rules are so basic it should be at least up on other stock markets. No stop loss so I used percentage 10. Fills are better assumed to happen at Open or Close price rather than a nominal limit order at 0.5 * ATR() so I left that out.
> 
> http://alvarezquanttrading.com/2014...-a-mean-reversion-strategy-with-good-results/
> 
> ...




Radge first wrote about this system.

Using the LMT order will be better to increase the ave win size and you dont need the stop.

When wrote properly it works well in both markets


----------



## Wysiwyg (16 June 2016)

Roller_1 said:


> Radge first wrote about this system.
> 
> Using the LMT order will be better to increase the ave win size and you dont need the stop.
> 
> When wrote properly it works well in both markets



You don't know what proper is?


----------



## Roller_1 (16 June 2016)

Wysiwyg said:


> You don't know what proper is?




If you code it up using the original rules it works well, i should have written.


----------



## Wysiwyg (16 June 2016)

Roller_1 said:


> If you code it up using the original rules it works well, i should have written.



So the original (simple) code that Alvarez posted on that link I provided was not the original code?


----------



## Roller_1 (16 June 2016)

Wysiwyg said:


> So the original (simple) code that Alvarez posted on that link I provided was not the original code?
> 
> View attachment 67115




Yeah thats it, but yours was different too that.. code in the lmt order and it will help and remove the stop


----------



## Roller_1 (16 June 2016)

howardbandy said:


> A mean reversion system tested on Norgate Premium Data's 496 stock list of ASX.  Date range 1/1/1999 through 6/15/2016.  17.5 years (which is way too long to expect the same system to work without adjustment)
> The code was recovered from a directory that was left untouched for two years.
> Profitable on 407, not profitable on 89, traded individually.
> Allowing all trades on all stocks, there are 141675 trades -- a little more than one trade per stock per month.
> ...




Howard this uses 500 positions with a $1,000,000 account, i dont think that is very practical in the real world. Is that right?


----------



## Wysiwyg (16 June 2016)

Roller_1 said:


> Yeah thats it, but yours was different too that.. code in the lmt order and it will help and remove the stop



Done it before my first post. The original code (without the stop loss & including the limit order) results 01/2015 to 01/2016  on XKO ...


----------



## Gringotts Bank (16 June 2016)

I see a couple of issues with the MR code, if anyone is attempting it on ASX.  Howard himself will be well aware of these, but just saying...

1-  commissions for most Aussies will be around .1%
2-  Excess signals (Exrem) not included in the code.
3-  I like to have 'SetStopPrecedence'


----------



## Roller_1 (16 June 2016)

Wysiwyg said:


> Done it before my first post. The original code (without the stop loss & including the limit order) results 01/2015 to 01/2016  on XKO ...
> 
> View attachment 67116




Didn't see that sorry, how about over a longer term?


----------



## Wysiwyg (16 June 2016)

Gringotts Bank said:


> I see a couple of issues with the code above.
> 
> 1-  commissions for most Aussies will be around .1%
> 2-  Excess signals (Exrem) not included in the code.




1) That's it! Just had to trick the thing. Thanks for pointing it out. I lowered brokerage and get a positive result. I always test with higher brokerage to compensate for getting in at the "assumed" price in test phase.  
2) Exrem makes very little difference. Random or rank/score is another discussion worth having.

As Alvarez noted, one would have to be on screen or alerted when price went to 0.5 * atr below yesty close. *It is the limit order that doesn't back test true in my opinion as it buys the low often and we know that isn't possible.*


----------



## Wysiwyg (16 June 2016)

Roller_1 said:


> Didn't see that sorry, how about over a longer term?



I don't have a delisted stock list so as is I am testing on stocks that were not in present day XKO back in Jan. 2015. The further back the start date the greater the survivorship bias.


----------



## Roller_1 (16 June 2016)

Wysiwyg said:


> 1) That's it! Just had to trick the thing. Thanks for pointing it out. I lowered brokerage and get a positive result. I always test with higher brokerage to compensate for getting in at the "assumed" price in test phase.
> 2) Exrem makes very little difference. Random or rank/score is another discussion worth having.
> 
> As Alvarez noted, one would have to be on screen or alerted when price went to 0.5 * atr below yesty close. *It is the limit order that doesn't back test true in my opinion.*




It can be coded accurately and correctly. I trade a similar system and Limit orders are accurate when comparing backtests to trades. 

If you have high brokerage it will kill a system like this too. A problem in aus


----------



## Wysiwyg (16 June 2016)

Okay so this needs to be forward tested under present time trading conditions to see if the actual price and quantity desired is achievable.  


```
// 3 Lower Lows similar to N. Radge rules

SetOption("InitialEquity", 50000);  
SetOption("AllowSameBarExit", 0);   // Sell not on buy bar 
SetOption("UsePrevBarEquityForPosSizing", 1); 
SetOption("AllowPositionShrinking", 1);
SetOption("MinPosValue", 4000);    // 4k minimum trade or no trade taken
SetOption("CommissionMode", 2);    // Dollar amount commission mode
SetOption("CommissionAmount", 20); // Commsec is $19.95 under 10k trade

SetTradeDelays(1,1,1,1); // Buy next bar at buy price set below. Sell next bar

PositionSize = -100/10; 
PositionScore = mtRandom();

Turnover = MA(C * V, 21) > 5000000;

BuyRule1 = C > MA(C, 100);
BuyRule2 = C < MA(C, 5);
BuyRule3 = Sum(L < Ref(L, -1), 3) == 3;

SellRule = C > Ref(C, -1);

Buy = BuyRule1 & BuyRule2 & BuyRule3 & Turnover;
BuyPrice = C - (ATR(10) * 0.5);
Sell = SellRule;

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy); 

Filter = Buy OR Sell;

AddColumn(IIf(Buy, C - (ATR(10) * 0.50), Null), "Buy", 1.3, colorBlue);
AddColumn(IIf(Sell, C, Null), "Sell", 1.3, colorDarkRed);
```


----------



## rnr (16 June 2016)

Wysiwyg said:


> Okay so this needs to be forward tested under present time trading conditions to see if the actual price and quantity desired is achievable.
> 
> 
> ```
> ...




Interesting!

I asked you a question back at post #38 of this thread and your response in post #39 was "Tried that and buying the low of the day doesn't produce a positive result"

Did you even check the Entry code to see whether it differed from yours?

Obviously not as your "BuyPrice" code is still wrong!

If you want to monitor the system going forward at least use the correct code for the "BuyPrice".

Whilst I might not have the correct code for AmiBroker you should be able to work it out from the code below.

Alter the "SetTradeDelays" Buy to 0 (zero) and change the code to reflect the following

BuyPrice = Min(O,Ref(C-ATR(10)*0.5,-1));

Cheers,
Rob


----------



## Wysiwyg (16 June 2016)

rnr said:


> Interesting!
> 
> I asked you a question back at post #38 of this thread and your response in post #39 was "Tried that and buying the low of the day doesn't produce a positive result"
> 
> ...




Here is the quote of the entry rule ...



> Buy
> 
> Set a limit buy order for the next day if price falls another .5 times 10-day average true range.




If price falls *another* .5 * atr(10). It has to be after the signal bar of three lower lows.


----------



## rnr (16 June 2016)

Wysiwyg said:


> Here is the quote of the entry rule ...
> 
> If price falls *another* .5 * atr(10). It has to be after the signal bar of three lower lows.




Correct!

As per your code:-

BuyRule1 = C > MA(C, 100);
BuyRule2 = C < MA(C, 5);
BuyRule3 = Sum(L < Ref(L, -1), 3) == 3;

So Buy on the next bar after the above 3 Buy rules are met on the proviso that
*the price on entry has fallen a further ATR(10) from the previous days closing price*.

Providing "SetTradeDelays" for the Buy is set to zero bars delay then this code reflects the system rule:-

BuyPrice = Min(O,Ref(C-ATR(10)*0.5,-1));

Ask someone else if you don't believe me however, trust me Wysiwyg when I say I'm only trying to help as you are the one that will benefit from the exercise.

Cheers,
Rob


----------



## Wysiwyg (17 June 2016)

I am going to post one buy/sell trade for the following stocks that met the simple system rules. Limit order buy only.

1. TWE = buy price $9.735
2. STO = buy price $4.16
3. PRY = buy price $3.64
4. MIN = buy price $8.135
5. LNK = buy price $8.14
6. CAR = buy price $12.11
7. BPT = buy price $0.62


----------



## peter2 (17 June 2016)

If you're going to journal some buy signals then please consider starting your own thread 
"Wysiwyg's ASX Mean Reversion journal", rather than take this thread way off topic.


----------



## howardbandy (17 June 2016)

Roller_1 said:


> Howard this uses 500 positions with a $1,000,000 account, i dont think that is very practical in the real world. Is that right?




Greetings --

No, it is not practical.    

I hope no one thinks the system as posted was tradable as posted, nor intended to be seen as tradable as posted.  Nor should it be considered investment advice.  I am an independent system developer, educator, writer, and speaker.  I do not manage other people's money, I do not sell systems, I do not give investment advice.  

It is illustrative.  The purpose is to demonstrate that there are systems (or at least there is one system) that trade ASX stocks profitably.

The system settings allow every trade for every issue.  Since there are about 500 issues in the ASX watchlist, setting the limit to allow 500 simultaneous positions allows for the situation when every issue on the list is in a trade.  Setting the initial equity high is to ensure that there will be enough funds to take all trades signaled. 

There are many other considerations that the developer / trader would want to / need to take into account.  

Membership / selection / survivorship bias is a big one.  The list is the current list of ASX constituents.  The test was run beginning 1/1/1999.  Many of the issues now in the ASX list were not in the list for the entire period.  

The test assumed that the system was stationary for the entire 17 year period.  It almost certainly was not.

No position sizing was used.  Each trade is a fixed dollar amount.  Using risk normalization to determine proper position size and trade-by-trade dynamic position sizing as a trade management tool the final equity will be much higher.

Some issues fit well with this model, others poorly.  During development a short list of preferred stocks would be chosen.  

The management of funds has not been addressed.  There might be occasions when there are more signals than fund tracks.  A metric to rank potential trades would be developed.

As I posted it, there are no trend-in-place filters.  Some people prefer to take long positions only when the price is in an upward trend by some definition.  That would be tested.  And validated.  Do not take anyones word for it, or do it just because some book suggested it.  My research and experience shows that the best trading of long/flat systems comes when prices are not in a well defined upward trend.

There are no auxiliary data series or secondary rules.  Perhaps knowing something about currency, interest rates, or a foreign market will help.

The only model being considered is decision tree.  This system can be developed using any traditional trading system development platform -- AmiBroker, Ninja, TradeStation.  The same data could be passed to a machine learning platform and any of 20 or 30 additional models considered.  Results will be better.

The entry is market-on-close of the daily bar that generates the signal.  When you have a system that is accurate in predicting a one-day direction, act as soon as possible.  Waiting until the next open seriously deteriorates performance.  About one-third of the close-to-next-close profit comes in the close-to-next-open period.  Don't miss that.

There are no Sell signals.  The system either takes a profit using a limit order or a maximum holding period.  Adding rules to generate Sell signals might be beneficial. 

Commissions are set to zero.  Since the average trade gains 0.40%, there is plenty of profit to pay commissions.  Set the value to reflect your own broker.

Slippage is set to zero.  The entry is MOC, exit is either a limit order or MOC.  Slippage should be low.  Do some analysis using fills you receive from your own broker.

Etc.


The important takeaway is a demonstration of a system that meets the criteria that are both necessary and sufficient for being profitable:
Trade frequently
Trade profitably
Hold a short period of time

Best,
Howard


----------



## Roller_1 (17 June 2016)

rnr said:


> Correct!
> 
> As per your code:-
> 
> ...





I would add this to your code, it is correct i agree with Rob


----------



## rb250660 (17 June 2016)

I'll offer up my testing of the mean reversion strategy discussed here.
The testing is based on trading the ASX500 using CMC markets as a broker.
I haven't used a delisted database so there is survivorship bias in my results.

I have coded it using the original rules by the author of the system.
I have included the following filters to make it a bit more of a reality:
    250,000 shares a day,
    $250,000 turnover a day
Commissions are CMC markets, $9.90 or 0.8%.

The back tests were run from 1/1/1999 to today.

Below is a summary of ALL possible trades generated by the system (NO position sizing).



Below is a single back test run using the position sizing suggested by the author. $100,000 cut into 10 positions.



Below is a number of results from a Monte Carlo simulation. The data was taken from all possible trades and the simulation run over a 2 year look ahead.

Below is final equity. At the 25th percentile you would have added $20,000 to your initial $100,000.



Below is MaxDD. At the 95th percentile it is 7.5%.



Below is 10 random equity curves.


----------



## rb250660 (17 June 2016)

This certainly isn't a strategy I would trade in it's current form. It generates far too many signals in my opinion. You would spend hours a day placing and managing your limit orders without the use of something like an API.

With a bit of work on the entry mechanism, further filtering of signals and a decent position sizing algorithm you could get quite easily get something more manageable and profitable.


----------



## Wysiwyg (17 June 2016)

Wysiwyg said:


> I am going to post one buy/sell trade for the following stocks that met the simple system rules. Limit order buy only.
> 
> 1. TWE = buy price $9.735
> 2. STO = buy price $4.16
> ...




So today the trades that met the criteria. Will post the exit price (next day open price) of these 4 when their c > ref(c, -1). STO gets sold on Monday open price.

1. TWE = no buy
2. STO = buy at $4.16 
3. PRY = no buy
4. MIN = buy at $8.135
5. LNK = buy at $8.14
6. CAR = no buy
7. BPT = buy at $0.62


----------



## Wysiwyg (17 June 2016)

peter2 said:


> If you're going to journal some buy signals then please consider starting your own thread
> "Wysiwyg's ASX Mean Reversion journal", rather than take this thread way off topic.



Won't be journalising, thank you.


----------



## Roller_1 (17 June 2016)

If you wanted you can buy Radges turnkey code for it on his site too..


----------



## rb250660 (17 June 2016)

Wysiwyg said:


> So today the trades that met the criteria. Will post the exit price (next day open price) of these 4 when their c > ref(c, -1). STO gets sold on Monday open price.
> 
> 1. TWE = no buy
> 2. STO = buy at $4.16
> ...




I think something is wrong here. We entered STO, PRY and MIN yesterday. They all made their 3rd lower low on Wednesday, not yesterday. Check your code (or am I wrong ??). Also, my trade list is much bigger than yours (I have no filters for liquidity turned on though).


----------



## rb250660 (17 June 2016)

Roller_1 said:


> If you wanted you can buy Radges turnkey code for it on his site too..




Or code it yourself for free.


----------



## Wysiwyg (17 June 2016)

rb250660 said:


> I think something is wrong here. We entered STO, PRY and MIN yesterday. They all made their 3rd lower low on Wednesday, not yesterday. Check your code (or am I wrong ??). Also, my trade list is much bigger than yours (I have no filters for liquidity turned on though).



I ran the exploration yesterday after close on XKO. Check the time and date of posting was this morning 1 a.m. ish.


----------



## rb250660 (17 June 2016)

Wysiwyg said:


> I ran the exploration yesterday after close on XKO. Check the time and date of posting was this morning 1 a.m. ish.




This is my STO signal.




Can someone confirm I am right?


----------



## Roller_1 (17 June 2016)

rb250660 said:


> This is my STO signal.
> 
> View attachment 67133
> 
> ...




If the rule is C-0.5*atr how can the buyprice be above or equal yesterdays close?



> Or code it yourself for free.




Just saying, it will be correct and for people who can't code it up, if they were interested

i've got the buy at $4.16

On thursday the price didn't reach the limit order


----------



## Wysiwyg (17 June 2016)

rb250660 said:


> This is my STO signal.
> 
> Can someone confirm I am right?



Yes the next day limit order would be at 4.33 if you ran the exploration on the 15th. See my exploration run on the 15th with the limit order next day 16th at $4.33.


----------



## rb250660 (17 June 2016)

Roller_1 said:


> If the rule is C-0.5*atr how can the buyprice be above or equal yesterdays close?
> 
> Just saying, it will be correct and for people who can't code it up, if they were interested
> 
> ...




On the 15th I have a signal at a close (close=4.430). So the limit order on the 16th is for 4.430 - 0.5*0.18 = 4.330 (rounding for tick size). Not being defensive, what have I done wrong? Maybe I need to fix my code? I seem to be a day early...

So it looks like you agree with me wysiwyg. How come you took the trade a day later than your signal? Also you listed 7 trades in this thread but your scan shows 23 signals?


----------



## Wysiwyg (17 June 2016)

rb250660 said:


> How come you took the trade a day later than your signal? Also you listed 7 trades in this thread but your scan shows 23 signals?



 You replied to my post where I explained that *I ran the exploration yesterday which was the 16th*.



Wysiwyg said:


> I ran the exploration yesterday after close on XKO. Check the time and date of posting was this morning 1 a.m. ish.


----------



## Roller_1 (17 June 2016)

rb250660 said:


> On the 15th I have a signal at a close (close=4.430). So the limit order on the 16th is for 4.430 - 0.5*0.18 = 4.330 (rounding for tick size). Not being defensive, what have I done wrong? Maybe I need to fix my code? I seem to be a day early...
> 
> So it looks like you agree with me wysiwyg. How come you took the trade a day later than your signal? Also you listed 7 trades in this thread but your scan shows 23 signals?




I think you guys are right, my buy price is calculated from the low not the close.. i had L - x not c - x.. have you tested off the low?


----------



## rb250660 (17 June 2016)

Wysiwyg said:


> You replied to my post where I explained that *I ran the exploration yesterday which was the 16th*.




It doesn't matter when you ran the exploration. Your code didn't tell you that you were already in the trade, a mistake in my opinion. Therefore STO, PRY and MIN aren't real trades because you would have taken them a day earlier if you were trading real time...

roller - Changing the buy limit reference price from C to L increases profit per trade and decreases trade frequency.


----------



## Wysiwyg (17 June 2016)

rb250660 said:


> So your code didn't tell you that you were already in the trade. Therefore STO, PRY and MIN aren't real trades because you would have taken them a day earlier if you were trading real time...



Okay I will show the sequence I took.

1. run exploration XKO after close on 16/06/2016 (*note not before this time and no trades before*)  
2. result is a list of stocks that met the *3 lower lows, close above ma(100) and close below ma(5) *(is that bit confusing?) 
3. calculate the limit order price of c - 0.5 * atr(10) to buy today 17/06/2016 
3. posted stock list with their limit orders on forum


----------



## Roller_1 (17 June 2016)

rb250660 said:


> It doesn't matter when you ran the exploration. Your code didn't tell you that you were already in the trade, a mistake in my opinion. Therefore STO, PRY and MIN aren't real trades because you would have taken them a day earlier if you were trading real time...




Agree - otherwise you could keep getting signals while your in a position and double up on a stock


----------



## Roller_1 (17 June 2016)

Wysiwyg said:


> Okay I will show the sequence I took.
> 
> 1. run exploration XKO after close on 16/06/2016 (*note not before this time and no trades before*)
> 2. result is a list of stocks that met the *3 lower lows, close above ma(100) and close below ma(5) *(is that bit confusing?)
> ...





But if you run an exploration today do you get a buy signal for MIN again even though you bought it today?


----------



## elbee (17 June 2016)

Wysiwyg said:


> 1) It is the limit order that doesn't back test true in my opinion as it buys the low often and we know that isn't possible.[/B]




If you are going to backtest this system you will need to include in your code a test to ensure the limit price is achievable on the buy day.

eg
_
SetTradeDelays(0,1,0,0); 
Setup = BuyRule1 & BuyRule2 & BuyRule3  & Turnover;
Buy = Ref(Setup,-1) AND L <= Ref(C-ATR(10)*0.5,-1);
BuyPrice =Min(O,Ref(C-ATR(10)*0.5,-1));_


----------



## rb250660 (17 June 2016)

Wysiwyg said:


> Okay I will show the sequence I took.
> 
> 1. run exploration XKO after close on 16/06/2016 (*note not before this time and no trades before*)
> 2. result is a list of stocks that met the *3 lower lows, close above ma(100) and close below ma(5) *(is that bit confusing?)
> ...




I know what you did and it wasn't achievable in real life. Is that a bit confusing?




Roller_1 said:


> But if you run an exploration today do you get a buy signal for MIN again even though you bought it today?


----------



## Wysiwyg (17 June 2016)

Roller_1 said:


> But if you run an exploration today do you get a buy signal for MIN again even though you bought it today?



Of course because it meets the rules. The exploration will result only the stocks that meet the rules. LNK did too.


----------



## Wysiwyg (17 June 2016)

rb250660 said:


> I know what you did and it wasn't achievable in real life. Is that a bit confusing?



LOL ...  You don't understand but that is okay as I have opened the positions and will close them when their close is above previous bars close. Too simple.


----------



## rnr (17 June 2016)

Wysiwyg said:


> Of course because it meets the rules. The exploration will result only the stocks that meet the rules. LNK did too.
> 
> View attachment 67135




You need to include some code to remove additional buy signals once you have entered a trade that hasn't exited.


----------



## rb250660 (17 June 2016)

My strategies tell me the following in sequence for each trade:

Buy signal (I should buy tomorrow)
Entry (I bought today)
Hold
Sell Signal (I should sell tomorrow)
Sell (I sold today)

Maybe you should code this in too.

As rnr states, you don't keep buying into trades (as you have done) when your strategy already indicated you have an open position (unless you are scaling in, which you aren't).


----------



## Wysiwyg (17 June 2016)

rnr said:


> You need to include some code to remove additional buy signals once you have entered a trade that hasn't exited.



Capital available would limit buying capability but ExRem would remove excess signals in the code. Not sure what the ExRem process is though. Maybe alphabetical elimination.


----------



## Roller_1 (17 June 2016)

Wysiwyg said:


> Capital available would limit buying capability but ExRem would remove excess signals in the code. Not sure what the ExRem process is though. Maybe alphabetical elimination.




you need some code either using a loop or whatever that says - only buy if rules are met and no trade is on.



> My strategies tell me the following in sequence for each trade:
> 
> Buy signal (I should buy tomorrow)
> Entry (I bought today)
> ...




This is good to track trades too


----------



## Wysiwyg (17 June 2016)

elbee said:


> If you are going to backtest this system you will need to include in your code a test to ensure the limit price is achievable on the buy day.
> 
> eg
> _
> ...




Yes that is a better back test procedure. Thank you.


----------



## Roller_1 (21 June 2016)

Wysiwyg said:


> Yes that is a better back test procedure. Thank you.




Where are you at with your test positions Wysiwyg?


----------



## Wysiwyg (21 June 2016)

Roller_1 said:


> Where are you at with your test positions Wysiwyg?






Wysiwyg said:


> So today the trades that met the criteria. Will post the exit price (next day open price) of these 4 when their c > ref(c, -1). STO gets sold on Monday open price.
> 
> 1. TWE = no buy
> *2. STO = buy at $4.16*
> ...




2. STO c > ref(c, -1) = sell at open price next day 20/06  @ $4.43  for *Gain of 6.49%*
4. MIN c > ref(c, -1) = sell at open price next day 21/06  @ $8.60  for *Gain of 5.72%*
5. LNK c > ref(c, -1) = sell at open price next day 21/06  @ $8.22  for *Gain of 0.98%*
7. BPT c > ref(c, -1) = sell at open price next day 21/06  @ $0.67  for *Gain of 8.06%* 

Fantastic results for a short hold but a 1.6% Index rise following entry day made a big difference. 1.6% Index down day and the results would be very different. Looking at it objectively of course.


----------



## Roller_1 (22 June 2016)

Wysiwyg said:


> 2. STO c > ref(c, -1) = sell at open price next day 20/06  @ $4.43  for *Gain of 6.49%*
> 4. MIN c > ref(c, -1) = sell at open price next day 21/06  @ $8.60  for *Gain of 5.72%*
> 5. LNK c > ref(c, -1) = sell at open price next day 21/06  @ $8.22  for *Gain of 0.98%*
> 7. BPT c > ref(c, -1) = sell at open price next day 21/06  @ $0.67  for *Gain of 8.06%*
> ...




Yes it has been a good month for mean reversion really!


----------



## rb250660 (24 June 2016)

How are your positions today? Haha


----------



## Roller_1 (24 June 2016)

Haha i only have 4 out of 20 positions in my system luckily - PLS is down about 18% at the moment...


----------



## rb250660 (24 June 2016)

I sold everything I had at yesterdays close.


----------



## Roller_1 (24 June 2016)

rb250660 said:


> I sold everything I had at yesterdays close.




Yeh i didn't place any new orders just held existing positions.


----------



## Roller_1 (30 June 2016)

Roller_1 said:


> Yeh i didn't place any new orders just held existing positions.




Turned out to be a expensive lesson, i think i would have preferred a loss rather than missing profits!!   follow the system


----------



## lftrader (2 July 2016)

Do these Amibroker exploration generate correctly the signals if they are for the next open?


----------

