In this lecture we are going to discuss some additional results from my trading but personally I am
always suspicious of anything involving machine learning and trading.
You might think because this agent almost always makes a profit.
It must be a really good agent.
However there are things we have not yet considered
first in order to really evaluate the agent.
We have to have something to compare it to a reasonable benchmark I think is to see how a completely
random agent performs that's equivalent to running a script with Epsilon equals one or to not have an
agent at all.
When we do that we get a histogram like this as you can see most of the weight of the distribution is
above our initial investment which means even with a totally random strategy we would probably make
money but also there are some pretty low values here too where we have lost money.
The probability of that happening is not insignificant.
On average however the profit is still not bad
compared to our trained agent.
Our trained agent performs much better the probability of losing money is much less and the floor is
only just under the initial investment.
Of course this really depends on the hyper parameters you choose and the final values of the weights.
And sometimes if you run the script you can still get results that are not much better than random.
Now you're probably wondering how is it that even if we take purely random actions we can still make
a decent profit.
Well it has to do with our data dataset in general for the three stocks we chose.
The value is increasing.
Therefore it doesn't really matter what we do unless we always unluckily buy when the stock is high
and sell when the stock is low.
But if the stock is mostly going up then there's less of a chance of that happening.
So one thing you can do if you really want to test this out is to test it on a set of stocks which go
up and down a synthetic data set would be a great choice here.
Here's some other ways you could extend this project.
One that you could incorporate metadata also such as the sentiment of news articles or Twitter feeds.
Of course this now becomes somewhat of an engineering problem because you have to gather all this data
for every day in the span of five years to another thing you could do is incorporate past values into
the state.
Currently the model doesn't have any concept of the movement of stock prices.
It only knows the current stock prices.
The number of shares and the UN invested cash.
3 You could try using returns instead of actual prices.
If you recall neural networks are not that great at extrapolating for regression.
We can observe this pattern by creating a synthetic dataset and looking at what a neuron that work does
when it sees an output outside the range.
It was trained on with these stock prices which are always going up that's bound to happen.
Returns however should be more stationary.