1
00:00:11,700 --> 00:00:17,520
In this lecture we are going to discuss some additional results from my trading but personally I am

2
00:00:17,520 --> 00:00:21,830
always suspicious of anything involving machine learning and trading.

3
00:00:21,870 --> 00:00:25,400
You might think because this agent almost always makes a profit.

4
00:00:25,530 --> 00:00:27,430
It must be a really good agent.

5
00:00:27,480 --> 00:00:29,850
However there are things we have not yet considered

6
00:00:35,060 --> 00:00:38,050
first in order to really evaluate the agent.

7
00:00:38,060 --> 00:00:44,210
We have to have something to compare it to a reasonable benchmark I think is to see how a completely

8
00:00:44,210 --> 00:00:50,870
random agent performs that's equivalent to running a script with Epsilon equals one or to not have an

9
00:00:50,870 --> 00:00:52,360
agent at all.

10
00:00:52,550 --> 00:00:58,940
When we do that we get a histogram like this as you can see most of the weight of the distribution is

11
00:00:58,940 --> 00:01:04,910
above our initial investment which means even with a totally random strategy we would probably make

12
00:01:04,910 --> 00:01:10,530
money but also there are some pretty low values here too where we have lost money.

13
00:01:10,730 --> 00:01:14,330
The probability of that happening is not insignificant.

14
00:01:14,420 --> 00:01:16,850
On average however the profit is still not bad

15
00:01:22,000 --> 00:01:23,650
compared to our trained agent.

16
00:01:23,680 --> 00:01:29,860
Our trained agent performs much better the probability of losing money is much less and the floor is

17
00:01:29,860 --> 00:01:32,740
only just under the initial investment.

18
00:01:32,800 --> 00:01:37,900
Of course this really depends on the hyper parameters you choose and the final values of the weights.

19
00:01:38,110 --> 00:01:48,120
And sometimes if you run the script you can still get results that are not much better than random.

20
00:01:48,250 --> 00:01:54,420
Now you're probably wondering how is it that even if we take purely random actions we can still make

21
00:01:54,420 --> 00:01:56,180
a decent profit.

22
00:01:56,220 --> 00:02:01,320
Well it has to do with our data dataset in general for the three stocks we chose.

23
00:02:01,320 --> 00:02:03,490
The value is increasing.

24
00:02:03,630 --> 00:02:09,510
Therefore it doesn't really matter what we do unless we always unluckily buy when the stock is high

25
00:02:09,900 --> 00:02:12,200
and sell when the stock is low.

26
00:02:12,390 --> 00:02:17,300
But if the stock is mostly going up then there's less of a chance of that happening.

27
00:02:17,370 --> 00:02:23,010
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

28
00:02:23,010 --> 00:02:27,030
up and down a synthetic data set would be a great choice here.

29
00:02:32,240 --> 00:02:35,420
Here's some other ways you could extend this project.

30
00:02:35,420 --> 00:02:41,700
One that you could incorporate metadata also such as the sentiment of news articles or Twitter feeds.

31
00:02:41,780 --> 00:02:46,520
Of course this now becomes somewhat of an engineering problem because you have to gather all this data

32
00:02:46,790 --> 00:02:54,380
for every day in the span of five years to another thing you could do is incorporate past values into

33
00:02:54,380 --> 00:02:55,550
the state.

34
00:02:55,700 --> 00:02:59,960
Currently the model doesn't have any concept of the movement of stock prices.

35
00:03:00,050 --> 00:03:01,820
It only knows the current stock prices.

36
00:03:01,850 --> 00:03:05,190
The number of shares and the UN invested cash.

37
00:03:05,290 --> 00:03:10,090
3 You could try using returns instead of actual prices.

38
00:03:10,310 --> 00:03:15,240
If you recall neural networks are not that great at extrapolating for regression.

39
00:03:15,470 --> 00:03:20,780
We can observe this pattern by creating a synthetic dataset and looking at what a neuron that work does

40
00:03:21,080 --> 00:03:23,210
when it sees an output outside the range.

41
00:03:23,210 --> 00:03:29,470
It was trained on with these stock prices which are always going up that's bound to happen.

42
00:03:29,660 --> 00:03:31,850
Returns however should be more stationary.
