Stock Prediction using Decision Tree: Risk Management

This post is the last one of a series on using decision tree for stock prediction. Here are the first, second, third and fourth posts. This final post is dedicated to the risk management part of the system.

At this step, we have as input a list of transactions containing the ticker name (e.g. “MSFT US Equity” for Microsoft, etc.), the date of transaction and the quantity. As the system is “long only”, the quantity is always positive (+1 means buy one stock).

The risk management is informally defined here as a way of managing a portfolio by closing it in certain specific situations. In this system, a simple take-profit/stop-loss at the portfolio level is used. Every day, a number of transactions are carried out. All transactions in the same day are gathered in one portfolio. At any time, the portfolio return is calculated to check for both the take-profit and stop-loss limits. If the portfolio return reaches the take-profit (e.g. +5%) or the stop-loss (-20%), it is closed.

In addition, each portfolio is subject to a maximum number of days of conservation. When this number of days is reached, the portfolio is closed. To find the best values for the take-profit, stop-loss and number of days of conservation, a three-dimensional grid search is performed. Note that there is nothing to prevent the system from overfitting at this step of the methodology (unlike the decision tree step that uses cross-validation). This could of course be improved.


Recommended Reading

Comments Icon5 comments found on “Stock Prediction using Decision Tree: Risk Management

  1. hi,
    I’m new to data mining.can any one help me to work with stock prediction.i don’t have a clear idea about the stock prediction algorithm.provide me some useful links or methodologies.mail me is id is

  2. Can I get a list of articles related to this topic as well?
    Also, what tool(s) are you using for this task?
    Do you have any suggestions for which learners are best suited to this task?
    Are you using any feature selection to ascertain the value of the indicators you have chosen?


  3. @mark: I had these articles when I was working in finance. I think the easiest is that you try to get a copy of “data mining in finance” (the book contains many article references).

    Regarding the tools I was using R (rmetrics library). I had only tried decision tree. But I think, you should try to work with time series techniques. Using decision tree, the features where implicitly selected by the tree, so no, I wasn’t using any other feature selection technique.

    Hope this helps.

  4. Good Stuff ! I really like your post and i definitely bookmark your

    post and will give links to my friends as we all are a great lovers of

    blogs and always ready to read interesting and informative blogs. So

    Thanks ! for sharing your post.
    Stock Tips

Comments are closed.