I would like to ask you for an advice of any of you could help me with this information it would be really helpful.

I am trying to build a reinforcement learning trading bot that based on the current and past stock data it will try to predict when its the perfect moment for buying or selling a stock. But my problem is how could I normalize the data in a way that it could help my model to learn faster and also what reward should I use?

At the current stage my normalizing strategy is consist from 2 parts

  1. Converting the price into percentage of how much or less did the price increase or decreased from the previous one
  2. Use MinMax scale

Also in terms of reward I'm using sortino ratio.

Is there any other better alternative for this?


1 Answer 1


If you are asking these kinds of questions, it is very unlikely you will be able to successfully train any kind of ML or AI model on stock data with your current level of skill.

In fact, each of the questions you ask usually involves weeks, months and -- in some cases -- years of experimentation to discover the right mix of potential features. In reinforcement learning, just figuring out the correct reward function is a task that is much, much harder than it seems.

That said, I would encourage you to research widely. Start with a good book like Marcos Lopez de Prado's "Advances in Financial Machine Learning". If you are starting right at the beginning, begin with Andrew Trask's "Grokking Deep Learning" book and then move on to The Deep Learning Book https://www.deeplearningbook.org/

Make sure you know the fundamentals of statistics in depth. Really, really, really in depth. Don't skip over this. Learn and practice foundational statistics skills like your life depends on it. Do Kaggle challenges to cut your teeth with them. You need to know how to not fool yourself and a solid grounding in statistical methods and hypothesis testing will be your only guide on this lonely, long road. Be sharp in linear algebra and matrix math. Have some solid calculus footing.

There are tons of courses and tutorials across the web - particularly on YouTube. Udacity also has good courses on AI in general and even a specific Machine Learning for Trading course.

Naturally, none of these will point you to "the answer". But they will get you to start asking the right questions and, at the end of it all, begin to develop some intuition for how you might build your own form of ML / AI.

Good luck -- it's tremendously difficult; one of the hardest technical challenges on earth. But with the right attitude and work perhaps you will find some good predictive signals and come back here to set someone else on the same journey you went on!

  • $\begingroup$ Even though is not quite answered my question thx for this kind words and for the motivation speach. I will do this and I will start by reading those 2 book that you told me about :D $\endgroup$
    – Mircea
    Mar 27, 2021 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.