Finance (Trading, Investing, Fintech, etc.)


#1

Calling all quants, traders, fintech enthusiasts, and all others who wish to use Deep Learning to transform the financial industry here!

I’m gonna pose some questions here, particularly for graduates of the Fastai course, but feel free to interject your own questions or thoughts here as long as they’re related to DL in Finance.

I’ve built a few predictive models using Keras/Tensorflow, Scikit-learn (mostly SVMs) and Q-learning in the past with limited success (frequently running into problems with overfitting to various degrees.) I’m hoping to add Fast.ai to my toolkit to revisit these past models and modernize them with the latest DL techniques. Right now, I’m curious if what’s taught in this course will be of use here.

Financial data tends to come in Time Series form and this requires the use of RNNs (which I see is a topic later in the course.) As of right now, I’m only on lesson 2 of part 1, so i’m wondering if any concepts or theories will be covered later in the course which will hopefully answer my following questions:

  1. Financial data is often updated every single weekday. Ideally, I’d like to do some update training on my model every single day after the market closes and prints out a new datapoint for every stock I’m watching. This would be analogous to the Dogs & Cats model receiving one new picture of a dog or cat everyday and having to update the model to reflect having trained on that new picture everyday. Is it efficient and practical (not just possible) to train an existing model on a single new datapoint every single day without retraining it from scratch each time and have it continue to work reliably? Or would it be more effective to gather together several new datapoints (say every week or month) and add them to the model in batches?

  2. I can easily formulate a trading or investing model as a binary classification problem, just like CATS or DOGS:

  • Is the market going UP or DOWN tomorrow (or in a week, month, year, etc.)?
  • Are we in a HIGH or LOW risk market environment?
    However, I’d also like to build a model that’ll estimate how much the investment will return, say, after a week or a month (give outputs like 5.2% or -1.3% rather than a simple UP or DOWN.) Is this also possible using the Fast.ai stack?

(Dennis Sakva) #2

You can try online-learning by feeding your model additional samples of data as they arrive. Among other things, you’ll need to play with optimizer parameters like momentum.


(Andrea de Luca) #3

While trading financial assets is not my primary occupation, I’m an independent trader since the late 2000s. I never tried to employ ML/DL in trading, but it’s interesting, and I encourage you in pursuing that line of research.

For online deep learning, you could take a look to this: https://arxiv.org/pdf/1711.03705.pdf

I think that the biggest problem could be (other than online feeding) that you’ll seldom have enough data to make your model perform good.

However, it would be interesting to run some experiments about mixing DL-powered sentiment analysis over news, pure time series prediction (other than RNNs, take a look at FB prophet), and automatic fundamental/technical analysis.

Keep us posted :slight_smile:


(Chase ) #4

Financial data tends to come in Time Series form and this requires the use of RNNs

Time series data doesn’t require RNNs (they are worth trying though). You can use any method from your supervised learning toolbox with a little feature engineering. The Rossman competition from Lesson 3 is a good example of this.

Is it efficient and practical (not just possible) to train an existing model on a single new datapoint every single day without retraining it from scratch each time and have it continue to work reliably?

Training models like the Rossman competition model in this course is very fast – less than 10 minutes. If you are still concerned, you can take your existing model and tune it using the methods in this course. For example, you can re-train the last layer or two of your model to save time. I suspect adding a single additional sample won’t have a large effect on your weights.

However, I’d also like to build a model that’ll estimate how much the investment will return, say, after a week or a month (give outputs like 5.2% or -1.3% rather than a simple UP or DOWN.) Is this also possible using the Fast.ai stack?

Sure! Turn the problem into a regression by changing the final softmax layer to a linear layer with a single output. Add a metric like mean average error (MAE) or root-mean square error (RMSE) to evaluate performance.