Key Projects Update: AI, Europe, and Request For Feedback

Marco,

I think this is a fine idea but should quickly be expanded.

LSTM is a time-series tool and there is no reason to put it into the small box of pattern recognition. I guess it is fair to say you will probably use if for technical analysis, however.

But that could literally be anything using price and volume (and additional factors you want) to predict the market direction. Common exercises using LSTM include finding seasonality even.

Full disclosure, I have played with LSTM with no practical success. My project was to predict which SPYD Sector ETFs would do best. Maybe spent 5 hours on it. I think if there is something to find in a time-series LSTM will find it. My failure was due to a fairly efficient SP 500 sectors and/or limited time, money and interest in this project.

LSTM is not really that hard, it can be done on a MacBook without that much code. I understand there will be more code for a professional project–but also a professional to do it. Go with chart-patterns as a start but if you get stuck with chart patterns then just expand the project. If you do not get stuck, expand the project.

An example of expansion would be predicting an equity’s direction (relative to a benchmark) over the next week based on price (e.g., relative strength), volume and whatever data P123 has available (and members already use) for time-series.

Keep in mind that there are a lot of stocks out there. As long as what the AI finds works most of the time (has a high predictive value) it does not really have to find that many signals–as long as there are a handful of stocks with that signal each week. With neural-nets it might be frustrating that you may never know what the signal is. But not necessarily bad that a person would have to stay at P123 to keep using them.

Start with a month of data and rebalance weekly. There are CERTAIN to be patterns that the AI will use. Maybe some simple ones like mean-reversion, filling in a gap, a break-out etc. Maybe the AI will just notice a trend (or relative strength). Let the AI find them without telling it which ones to find (once it is expanded).

You can control how complex a pattern the AI will find by simply adjusting the number of layers–going “Deep Learning” if you wish. But I do not think you would have to do that for trends, mean-reversion, breakouts, filling-in-the-gap etc.

Done as a classification problem you could quantitate the probability that a stock would be up (relative to a benchmark) over the week. As a regression problem maybe by how much. I would start with the probability that the stock will be up relative to the benchmark (classification). Classification may be less prone to overfitting and picking a number could cause problems: P123 members do not like confidence intervals or standard deviations.

That would be my recommendation.

Best,

Jim

I would hate to be invested in a system when it breaks down because it encounters market action it has never seen before, wasn’t trained on and doesn’t know what to do, such as the crash of '87.

I like P123 for stock selection. That is an entirely different proposition from investment timing.

Looking forward to the new features, they sound great. I’m eager to use the ML aspect to see what influences future analyst upgrades. I suspect the adage “Nothing changes sentiment like price” might be borne out.

Chris,

Much could be said for a few of my 5-stock ports. And perhaps a few of yours if I read your posts correctly. I hope your new one (that you are paper-trading) does better.

Overfitting is here to stay at P123. It is more a function of the programmer than the method, however.

Given that this is the project P123 has chosen, I think I will go with some positive suggestions–regardless of whether technical analysis is my preferred poison or not.

P123: While too long above, my main usable point is if you are going to end up using LSTM it does not make any sense to put a lot of time and effort into constraining your research to chart-patterns alone. Something that may, or may not, end up getting the “recall” described in the referenced paper.

But more importantly, that you should still be good if the chart-pattern project does not turn out perfectly. Just roll it into the bigger project if that happens.

Or most simply: You do not have to get the chart-pattern right all the time if you get the market direction right most of the time. A simpler project in reality.

Ultimately, P123 would want to give the P123 user access to the inputs (what is used in their time-series) and some of the hyperparamaters. Like with the sims, not have to prove the user’s ideas are necessarily good ones. I would not get away from that model.

Use some logistic regression if the neural-net is too resource intensive.

Jim

You can’t rationalize away the chaotic nature of the markets.

Or you might be better off buying and holding an index fund.

The decision of the P123 gang to pursue AI is not subject to my approval. I’m just saying that I see it as being fraught with problems and I wouldn’t use it. I described the problems elsewhere in this thread. Those problems cannot be glossed over. Like gravity, chaos and randomness will always be there.

I do. People use too much risk.

Ultimately one either believes there are ways to get an edge on the market or not.

If they believe there is an edge, and are serious about their goals they find something beside just index funds.

While I might not use LSTM for technical investing myself, this is just one of many tools available at P123. Some I will use. Some of them will ML/AI in the future.

Jim

Here is a post from someone who did it the way I suggested above. Namely, let the NN find what works and totally automate it: How to Make A.I. That Looks into Trade Charts (And Use It for Trading)

He automated this for his home computer. The code looks hard to me so I might just copy and paste it–I’ll figure it out. Command-V, I think on my Mac.

I am guessing P123 could scale that up a little. But it does not HAVE to be hard. The Black-Box of this is both good and bad, I admit. What secret patterns is this finding? I say exactly–something someone else is not using. Make it as complex as you want by adding layers to your neural-network (and not forgetting to cross-validate and run a test-sample to prevent overfitting).

I would probably do this with LSTM still however.

Jim

The pattern signal is just another “factor” in a multi-factor strategy. I rather invest in stocks that have high rank and a good chart. The combination should be more powerful.

Marco,

I totally agree with this and encourage the chart-pattern study.

I would not go out of my way to filter-out the other information gained from a LSMT neural-net by focusing on only chart-recognition would be my only thought. I will stop harping on that but I do think it broadens your options in the future.

I guess this first is not pertinent if you end up using CNNs, but the referenced paper tried 2 patterns with a recall of 0.73. Hmmm…

If you decide to use CNNs look at the Toward Data Science reference. I see no disadvantage to having your AI/ML expert copy and pasting this code, running it overnight to get a bazillion data samples and running it on a test-sample tomorrow. Be done with it if it does not work.

Dan can do it.

Jim

Just echoing looking forward to these ideas if for no other reason than pure curiosity and desire to know about possible patterns in price series with more advanced toolkit. Also, I look forward to ability to model features that may help anticipate future data besides price (like sales growth, margins, surprise, revisions, etc) is also interesting and desirable. Whether it works or not, this is some creative stuff to attempt. :wink:

edit: I also changed my weekly and monthly charts to Heiken-Ashi as you suggested and will try that for a while.

Yes, I already use just a little technical analysis to supplement my rankings. If I got a 25 stock port with 2 open slots to fill and I run a screen of Rank > 99 and it returns 25 potential candidates to fill those two slots, technical analysis is a good way to winnow it down to the two best candidates rather than just blindly pick the one that has a 99.61 rank over the one that is 99.59 which is just really splitting hairs on the fundamentals.

I check the Zacks rank in situations such as those.

Just wanted to point out that there are some non-visual patterns we might want to recognize.

Marc might like Chaikin Money Flow for example. There is RSI, CCI etc. Bollinger bands have already been mentioned.

Using LSTM would capture those also. CNN could also capture some of those (if you drew a specific picture for the computer).

But you would have a mess if you left it to a human to do the labelling. Starting with the problem that many periods could have multiple labels.

Looking for a few chart-patterns really restricts the information content, I think. I would try for both: a label that a member might like and a computer generated probability of a market direction. But if I had to chose, I would take the latter.

My rants aside. LSTM is looking a lot better than drawing a bunch of pictures (using convolutional neural networks) in part because it would identify some non-visual patterns. Even if non-visual patterns are a future project.

Jrinne, we’ll take a look at LSTM.

We discussed human labelling with the data scientist and I think we came up with a good solution. It will involve the operator to examine a long chart , zoom in the pattern and draw a rectangle. We’re still debating if operator drawing should be free or constrained by the data (like snapping to the smallest rectangle)

I’m pretty excited about this as I’m thinking of use cases. Pattern identification will just be functions and you can use as many as you want. For example identifying a top after a run up could involve two models: one that identifies long term melt-up patterns, and a one that uses a short period to identify top patterns. The presence of both is the top.

Thanks for your inputs

Nice! And thank you.

Excited about the addition of European data.

Marco, Why the focus on NNs vs all the other techniques (regressions learners, decision trees, etc.)?

Is there a timeline for any of this?

Thank you for update.

Question about european stocks - which countries will be available ?
I would love to see some less developed countries such as Albania, Poland, etc.

Also what about EM? Hong Kong, Taiwan, Indonesia, South Korea etc?

An thoughts that can be shared re: pricing plans for European or specific country data? If not, I understand - certainly don’t set expectations if it’s not to that point - but wondering about ballpark expected expense if avail.