Predicting the Direction of Stock Market Prices using a Random Forest Classifier

In this demo I will show how to predict if the closing price of Apple, General Electric and Samsung Electronics is moving up or down. We do this with the help of a Random Forest Classifier. I tried to replicate the result from a research paper authored by Luckyson Khaidem, Snehanshu Saha, Sudeepa Roy Dey which is describing the following concept: Data Preprocessing exponentially smoothing Features Relative Strength Index Stochastic Oscillator Williams %R Moving Average Convergence Read more…

Investor – Stock Forecasting with LSTM

In this blog we show how to forecast the closing price of AAPL using a LSTM RRN network. We use the open, closing, high and low rates and the volume of the current day as input in order to predict the subsequent closing price. This demo has been implemented in Scala using Jupyter with the BeakerX kernel using the following libraries – Investor – DL4j The details can be found in the following Gist.

Will you get rich by investing in Funds ?

In recent years most banks are pushing their customers to invest in Funds with the argument that this is more profitable than any other option. As always it is valid to question this statement. As a compelling argument an index chart is presented which shows indeed that the stock market was growing! I tried to run some simulations using the data form my Investor framework to validate this statement:  Here is the link to my Gist Read more…

Investor – Validating DL4J LSTM Stock Forecasting (using the HarmonicStockOscillator)

A Long short-term memory (LSTM) network is a special type of a recurrent neural network (RNN). It remembers values over arbitrary time intervals which makes it suited to be used for forecasting of time series. I was struggling with the DL4J implementation of the LSTM to be used to forecast stock data and I was not sure where the issue was: was the data not suited for forecasting ?. did I have a bug in my Iterator which was Read more…

Investor – HarmonicStockOscillator¶

I thought it might be cool to have a stock price generator which is generating a steady sinus output, so that it can be used for the testing of trading strategies. A sinus generator function generally needs the following input amplitude omega phase This is oscillating between -amplitude and +amplitude so we also need to add the following additional parameter to raise the center on the y axis offset These parameter can also be determined Read more…

Investor and Machine Learning (MLlib and DL4J)

In this Blog we demonstrate how Investor can be used together with DL4j and Spark’s MLlib. In general the idea is to use the stock history data in order to predict an increase or decrease of the stock value with the help of Machine Learning. We will demonstrate how we can use Indicators to define the machine learning model and how to evaluate the models and finally to check the result using the Investor framework. Here Read more…

Investor and BeakerX 1.2.0

BeakerX is available with Version 1.2.0 now: So it is time to convert my static resources with the dynamic tables and charts which are made available with the help of Widgets. Heres is the link to my gist which shows the use of these Widgets in Scala with the Investor framework!

Investor – Portfolio Optimization

Portfolio optimization is the process of selecting the best portfolio (asset distribution), out of the set of all portfolios being considered, according to some objective. The objective typically maximizes factors such as expected return, and minimizes costs like financial risk. In this Blog we demonstrate how the Invstor API can be used to determine an optimized ‘Strategy Portfolios’. We use the RandomDistributor to generate randomly distributed porfolios and the KPIValues in order to determine the best combination. Read more…

H2O Sparkling Water – Distributed Random Forrest

H2O is a machine learning framework which has been implemented in Java and provides an API for Scala, Python and R. This framework has the following unique features: – It has a interactive web GUI (Flow) so that you can work w/o any programming – The generated trained models can be deployed easily in a production JVM environment with minimal dependencies. In this document we demonstrate how H2O can be used with Scala & Spark Read more…