Is 100 percent mechanical trading possible?

Source: Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications (New York Institute of Finance)

The major problem is the failure of the system to recognize when the market is not trending and its inability to turn itself off. The measure of a good system is not only its ability to make money in trending markets, but its ability to preserve capital during non-trending periods. It is this inability of the system to monitor itself that is its greatest weakness.

Another drawback is that no allowance is generally made for anticipating market reversals. Mechanical trend-following systems ride with the trend until it turns. They don’t recognize when a market has reached a long term support or resistance level, when oscillator divergences are being given. Most traders would get more defensive at that point, and begin taking some profits. The system, however, will stay with the position until well after the market has changed direction.

The mechanical system signals can be used simply as a mechanical confirmation along with other technical factors which I mentioned previously. Even if the system is not being traded mechanically, and other technical factors are being employed, the signals could be used as a disciplined way to keep the trader on the right side of the major trend.

Furthermore, mechanical system signals can also be used as an excellent screening device to alert the trader to recent trend changes. The trader can simply glance at the trend signals and instantly has several trading candidates. The same information could be found by studying all of the charts. The mechanical system just makes that task quicker, easier, and more authoritative. The ability of the computer to automate system signals and then alert the trader when signals are triggered is an enormous asset, especially when the universe of financial markets has grown so large.
 
  • Like
Reactions: NVP
i wasn't implying anything about your skills. the bugs i mentioned are more trading related, not API/coding/Software related.

examples. the trader guy tells you you have to buy X units of a stock at price Y.

a. what if you get partial fill? you think the trader thought of that?
b. when do you buy? when the last price is Y or maybe when the ask price is Y?
c. what if there isn't enough quantity in the Y price?
d. what if due to lag price changed too fast and you have no fill?
e. do you send market orders or limit orders? you think the trader knows the exact implications of real life unavoidable slippage on his system?

the list goes on and on and traders simply don't think about all possibilities. whereas you as the coder should have answers to all these questions (and more).

that's why it's a process of trial and error.
there couldn't be a simple - "give me the rules and I code it for you",
because traders don't really know all the rules. they only think they do.

(btw - not trying to dis traders - I am one)

not to mention that you completely ignored business side of things.
you're a genius coder i'll give you that - but what about businessman?


main point: it's not that easy and not "very simple". entry bar to this "industry" isn't so low. learn from others mistakes.

This is an excellent post - amnonco clearly knows what he's talking about, unlike one or two others on this thread :)

I call these instances "boundary conditions".. they are all the little things you didn't think of when you designed the system, but will eventually crop up and cause P/L.

My analogy is to making a cup of tea -- easy right? But let's say you had to write down instructions for an alien, you might omit to mention "check the plug is in the socket" or something else that seems patently obvious.
 
Threads been dead for a while...

What are you guys views of a "robust system"? I have coded my system and whilst it gives a good equity curve on some markets, it doesnt on others...For me thats not good enough. IMO the acid test (apart from live trading) for any mechanical system is to produce similar results when backtested on any market in any time frame.

I'm putting new filters and conditions in my methodology in the hope of achieving this...If I don't make it, will most likely put trading away for good (well full time trading anyway)
 
I have finally been able to put together an automated trading system and I have been running my patterns on over 2000 stocks daily to look for trades and continue to backtest and develop better entry and exit patterns when I have time. I only use daily bars and I enter trades during first 15 minutes of trading days and exit trades at same time the day after the EOD data meets my exit criteria. I at first only used candlestick patterns along with prevailing 40 day trend and immediate 5 day trend but this cut down my trades to an average of 2 finds in 3 days and I require at least 1 trade a day. I have ended up using doji stars as an entry point along with support/ resistance lines and the other previously mentioned items. I now find 1.2 entries per day with the stocks I look at. I am always trying to find better ways for entry and exit, it has become a bottomless pit of time consumption and I sometimes take breaks a couple days at a time so I don't become burnt out. I want to take advantage of the price patterns that to me look like perfect waves on the chart and will but from my experience it will probably take me about 500 lines of code to replicate the conditionals. I am always amazed at how much longer this is taking to do than what I thought. So far my program, just all the conditionals, is about 4 Meg of text. Huge. It cycles through over 400 Meg of data when I backtest patterns and about 40 Meg of data daily to look for trades as I use the last 250 daily bars for this. I get a text file out of testing that tells me what stock hit what patterns each day and I paper trade from that and on the day after the exit condition is satisfied I use the worst price on the open of the day as my out price. I am not the most knowledgeable programmer and it has taken me about 300 hours of coding to get to this point but much more than that to dream up and research the pattern sequences I am using.

Best of luck to all!
 
Last edited:
Sounds good numbertea and similar to the system I am currently (trying) to develop. As you said, it is surprising how much time the indicator/signal research and actual coding takes. But, nonetheless, it is interesting.

Wish you success with your system :)
 
I and two of my fellow traders run 100% mechanical trading systems incorporated in a portfolio, so it is possible. The only problem is how to distinguish a prolonged drawdown from the normal ones ie. how to know when your system stopped working?
 
Exactly 4 months since I embarked on my coding adventure. Funnily enough at first I thought learning the programming language could take several months but writing my system just a few weeks, but its worked out exactly the other way round. I learnt tradestations easy language (well enough to get me going) in a few weeks but writing the system seems to take forever!
 
Is 100 percent mechanical trading possible?

- Yes.

We are all mechanical systems. Most people fail at trading. Some people are consistently successful. This may be luck, or may be because a series of rules were followed.
It does not matter here. I think this is known as the intentionality issue in AI.

I have written a system sort of based on a k nearest neibhour algorithm on the FTSE ~2 years ago.
I lost yr 1 and am gaining in yr 2.
The major pain is in actually following the rules.

Without the benefit of any proof, I do think automated rule systems that only use price data work better on indices.
I also know lcchong76's comment on 24/6/11 to be true - the market shifted around may '09 and did behave differently 'in spirit' from that point and my algorithm did not 'spot' that.

I wondered if anyone has looked into the sentiment based tools out there.
 
I spreadbet on the FTSE.

The problem I have is knowing when the tool / model is failing.

You choose whether to buy or sell and if you choose at completely random, I think the chance is ~50% of being correct ( yes, it is more like ~.44-.5 but... ).

I use the binomial test.

If I observe 32 successes in 50 trials then given that the chance of getting the same result or better is about 3.25%.
Hurrah my model is good.

However, if 7 of the last 10 were fails, then there is only a 17.2% probability that this is chance (oops it looks like my model is broken).

Do other people review their results (mechanical or using intuition) and apply some sort of test?
What thresholds do you use?
 
Source: Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications (New York Institute of Finance)

The major problem is the failure of the system to recognize when the market is not trending and its inability to turn itself off. The measure of a good system is not only its ability to make money in trending markets, but its ability to preserve capital during non-trending periods. It is this inability of the system to monitor itself that is its greatest weakness.

Another drawback is that no allowance is generally made for anticipating market reversals. Mechanical trend-following systems ride with the trend until it turns. They don’t recognize when a market has reached a long term support or resistance level, when oscillator divergences are being given. Most traders would get more defensive at that point, and begin taking some profits. The system, however, will stay with the position until well after the market has changed direction.

The mechanical system signals can be used simply as a mechanical confirmation along with other technical factors which I mentioned previously. Even if the system is not being traded mechanically, and other technical factors are being employed, the signals could be used as a disciplined way to keep the trader on the right side of the major trend.

Furthermore, mechanical system signals can also be used as an excellent screening device to alert the trader to recent trend changes. The trader can simply glance at the trend signals and instantly has several trading candidates. The same information could be found by studying all of the charts. The mechanical system just makes that task quicker, easier, and more authoritative. The ability of the computer to automate system signals and then alert the trader when signals are triggered is an enormous asset, especially when the universe of financial markets has grown so large.

this person will not be a rooky for long ......excellent post (y)

N
 
As it has been said before, there exists a (huge) gap between Trading knowledge and Programming knowledge. Not just on paper, but in the way people think as well. Both fields almost require a different personality and way of thinking.

I started 'researching' what the possibilities are for me a year ago, and I have tested a few simple systems to taste what the ammount of work was going to be. I'm a programmer, not the best, but I feel like I posess the programmer's way of thinking. In other words, I'm a problem solver. On top of that I think nothing is difficult once you are on the inside. Everything looks big when you stand at its front door. I believe trading is similar, as I've seen with other fields. And I'm hugely annoyed by people 'on the inside' acting to the outside about how tough it is.

I've set myself a goal, a year ago, and that is to become successful in trading. I leave the definition of successful untouched. And, I intended to do so without any trading knowledge whatsoever. A pure logical way, attempting to beat the game. So I approached this thing as a 'problem to be solved', find a way.

Almost a year later, I figured it couldn't hurt to get some background knowledge. It might make the job easier. However, the thing I refuse to do is translate some existing strategy to a program, or in other words: solve this problem with trader's knowledge. On that subject (in response to what has been said earlier), I do think that "not knowing when a market reverses" can be set in code, just as well as when to open a position. It's an example of that knowledge gap in action.

Literally trying to close that gap has set me back for a short time. The internet is littered with scams and boasts. It's tempting to go looking. Some wheels will have to be reinvented, expect to have to do this yourself.

My plan de campagne, after concluding none of the existing software would suit me (sure, they might fit the workflow of a trader, which I am not), was to code what would be a mirror to the market. It would 'translate' available (free) data to a format which I thought would be useful. I then have something that can be hooked up to anything I want. LUA scripting is one of them, for both indicators and strategies. Allowing for precise enter and exit signals. I want as much of the market to be exposed to these scripts as possible, like an API.

Perhaps to some people's surprise, creating a 'queryable' mirror to the market wasn't hard. I prototyped it in Python and remade it in C#. The Python prototype was 200 lines of code, the C# version is a lot bigger but much easier to maintain (in my humble opinion).

One last thing: my original motivation was partially fed by the idea that I could 'generate' a working strategy, brute force methods to the resque. And I leave you with that thought-seed.
 
I am yearning for a 100 % mechanical trading system that is profitable?. Is this possible?

Well, I've got one. Fully automated as for now and profitable. You may even follow it @ algoprop.com during market time. It may loose of course, there are several periods when a week could be negative but all monthly statements are positive.
 
I spreadbet on the FTSE.

The problem I have is knowing when the tool / model is failing.

///

Do other people review their results (mechanical or using intuition) and apply some sort of test?

What thresholds do you use?

Well, I fought for 6 months. ))) I consulted with hedge fund managers and Managed futures fund manages to get and idea when they stop and close their positions or reverse. The one that helped me to overcome turnovers and successfuly shut down stocks with broken perfomance is combination of tracking deviation and Sharpe ratio for... trading statement of a single equity! That also helps to find potential champ-performers among 800+ US equities. Parts of this idea are still in implementation mode - coding takes a lot of time!. )))
 
Well, I've got one. Fully automated as for now and profitable. You may even follow it @ algoprop.com during market time. It may loose of course, there are several periods when a week could be negative but all monthly statements are positive.

How long have you been trading this algorithm, and what's the Sharpe ratio so far?
 
Since August, with backtests back to June'10. Sharpe ratio with weekly results will be posted some time later on the web.

Can we see the Sharpe for actual results on the website? Sharpe for a backtest is a bit meaningless, I think (a strategy can easily be curve fitted to produce a high Sharpe).
 
Can we see the Sharpe for actual results on the website? Sharpe for a backtest is a bit meaningless, I think (a strategy can easily be curve fitted to produce a high Sharpe).

One of the reasons I decided to post trades online is to eliminate suspicions about fitting curves. )) You will be able to see all updates including Sharpe ratio of the protfolio on the web. Can't wait to finish coding and begin posting all that info real time.
 
But when you mechanize them you discover how much discretion is involved.
Golden words. I'd say the 100% trading is possible, IF you can precisely describe and evaluate each element of the context you normally look at.
 
One of the reasons I decided to post trades online is to eliminate suspicions about fitting curves. )) You will be able to see all updates including Sharpe ratio of the protfolio on the web. Can't wait to finish coding and begin posting all that info real time.

im checking your trades online.

at the moment you have
PFG short 23.87 at 9:38
PRU short 53.74 at 9:40

these stocks never traded at these levels.

PFG opened at 23.72 and has the same high
PRU opened at 53.53 and has a high value of 53.54

please explain.
 
im checking your trades online.

at the moment you have
PFG short 23.87 at 9:38
PRU short 53.74 at 9:40

these stocks never traded at these levels.

PFG opened at 23.72 and has the same high
PRU opened at 53.53 and has a high value of 53.54

please explain.

Please, check your price feed.

PFG: b7acaafc2ad5d89d9446feb9b890507c.png - higher line is, as you may see, today's high. The second line lower: Entry price 5M bar.

PRU: bc95687d36dbc76f2b0324c0e6a4956d.png - higher line was, as you may see, today's high at that moment. The second line lower: Entry price 5M bar.

Prices are from freestockcharts.com.
 
Top