This project is read-only.

Predictions for stock market

Feb 6, 2015 at 9:53 AM
Hi, I'm a senior .NET developer with many years of expreriencia. I am currently working on a project predictions of stock market. I want to use BraneCloud to predict the trend of historical price of a symbol for a specific number of days. I've been reviewing the code and I find it difficult to know how to apply BraneCloud to my needs. Please, I need some idea how to solve my problem, I would appreciate it a lot. Thanks.
Feb 6, 2015 at 5:12 PM
Hi bonilmar,

An evolutionary computation framework is not really meant to provide solutions to any particular problem. Rather, it is meant to EXPLORE a solution space that YOU provide.

An easy way to start thinking about "solution space" is to envision a formula with some number of parameters. There are a quite a few ways to adjust the parameters to come up with an approximation of the optimal coefficients. The most obvious technique is a "brute force" test of all combinations of the parameters. This can work fine when the constraints on your parameters are very tight, and the number of parameters is very small. A simple genetic algorithm can converge on an optimal solution for a parametric problem (if care is taken to avoid local maxima/minima). As the number and range of parameters grows large, the standard approaches to optimization can quickly become untenable. But the biggest failure associated with parametric specification of a problem is that too many assumptions are constraining the solution space!

When we are trying to solve very complex problems, it is important to avoid making too many assumptions about the potential solution. In other words, we don't just want to worry about the parameters to a preconceived formula. We need to open ourselves up to thinking about the fundamental TOPOLOGY of the solution space. We need the very STRUCTURE of the solution to evolve. Markets are a sociological phenomena and the solution space is quite daunting.

If this answer seems somewhat vague, I apologize. But let me just say in conclusion that predicting the movements of stock market prices is, to say the least, a non-trivial problem. (Why? Because that's where the money is!!!)

Before anyone puts their money on the line in the markets, it is extremely important to understand just how difficult it is to predict price movement. A huge number of intelligent people are trying to solve the problem, and very few of them will ever succeed.

The best advice I can give (from years of experience) is to say that you need to select a very small niche where there might be some inefficiency, model it to the best of your ability, and exploit your model for as long as it holds up. But keep in mind, your model most certainly will need to change (evolve) over time. Success is possible, but "tail risk" will kill you if you are not extremely vigilant.

Feb 9, 2015 at 10:14 AM
Thanks for your answer Ben, you're very kind. You're right, the forecasts of stock prices is very complex issue and difficult to implement on a genetic algorithm. But my goal is not to have an accuracy of 100%, because if I did, I would be very very rich :)

I just want to experiment with your project what solutions I could have if I apply different inputs.
I mentioned that my desire is applied as different historical price tickets (open, close, high, low) of different symbols, and that the genetic algorithm can predict the trend in the following time periods.

My question is how to apply this concept in the .NET project. I guess you have to apply historical prices in a parameter file (as in the examples) and wait the possible outputs depending on model.

Could you explain me how to apply my problem in the .NET project? I would thank you very much.

Feb 12, 2015 at 8:08 PM
The important thing to understand about an evolutionary framework is that it does not define your problem or the potential solution space for you. It is only meant to explore the solution space that you present to it.

As far as trading systems go, there are so many different ways to define potential solution spaces, it becomes almost impossible to supply a succinct answer.

Normally, practitioners start with a "Context-Free Grammar" that defines how all potential solutions must be structured.

For GP this usually ends up as a set of rules that can be used in constructing a tree (or forest). State will be passed from node to node (depth-first or breadth-first) undergoing various operations associated with each particular type of node. You can think about nodes as "genes" from various pools of genetic material. And you can think of each pool as having a different set of rules (constraints) that define how they can be used in the construction of the trees. You can define "builders" and "pipelines" that properly construct viable candidate solutions to populate each successive generation in the evolutionary process.

The best advice I can give you about getting started with simple experiments is to carefully study the examples that are provided with the framework. Study some of the techniques use to model canonical academic problems such as "Ant" and "Lawnmower". These relatively simple examples are provided with almost all mainstream evolutionary frameworks because they help newbies understand basic principles, and they help experienced practitioners demonstrate and compare alternative techniques.

Since I started out a long time ago experimenting with Neural Networks for use in trading systems, I define my solution space in those terms. In other words, I define the genetic material comprising different types of neurons, synapses, and so on, and the constraints on how those can be connected to form valid networks. Others might approach much the same thing using graph or network theory (directed graphs of nodes and edges). The techniques used to accomplish this are much too complicated and varied to go into here. But if you start off with something very simple to get started, you will inevitably move quickly into more sophisticated realms as your experience grows.

Because of the difficulty of real-world trading, the number of problems that need to be addressed means that one needs to apply more than one technique. So, for example, you may have solutions that will generate "signals" from data feeds, others that may switch between different sets of signals depending on specific market conditions, and still others that will apply rigid risk-assessment and money-management rules. The combinatorial possibilities are limitless. So your success will depend on how well you can focus in on what is important, and omit what is not helpful.

I just hope that everyone who is in the early process of exploring the markets understands the huge amount of research and resources that large algorithmic trading shops are devoting to this field. As I've said previously, the best hope for individuals and small groups is to try and find small pockets of inefficiency that the big players are unable or not interested in exploiting.

PS: I've done some interesting research in the past that has proved (at least to my satisfaction) that the markets are efficient to the typical cost of execution. That is, commissions and other costs are often the limiting factor for small players in the markets. In fact, when I was a floor trader on NYMEX trading the energy markets, a number of us actually calculated our profits and discovered that without the low commissions we paid as members, we would not be making money at all. But because we traded huge volumes we were able to make a very respectable living. These days, the costs have come down for retail customers, so the playing field has been somewhat leveled. But don't discount the advantage held by those who can throw millions into research, analysis, speed of execution, etc. Remember that large players are using evolutionary computation too!