Just for a quick summary, our goal of our ML model is to predict whether or not, using a specific trading strategy, we will make money from the stock market or not. The trading strategy we will focus on initially will be to simply buy a stock at the end of one day and sell it the next. This will drastically limit the scope in which we have to research and refine our model. Additionally, since we can only buy/sell a single stock with our model, we will define a spread of money we are willing to invest across multiple stocks, this will simulate diversifying our portfolio to limit outlier days where either some extraordinary social, political, or economic event happens that greatly affects the stock price.
We will define some terms that we will use for the rest of this project for clarity:
- Purchase Close Event (PCE): This refers to the event of buying stock at close of a particular day.
- Sell Close Event (SCE): This refers to the event of selling a stock at the close of a particular day.
- Trade Window: The amount of time (we'll measure in days, initially) between a purchase event and a sell event.
The metrics for success and failure, are rather quite simple, since unlike other problems such as creating a ML model for the prediction of whether or not someone is sick or not, our will not require much additional research into the penantly for getting the prediction wrong.
The main goal of this project is to simply make more money from the stock market than that of a trading algorithm that randomly selects whether or not initiate a purchase close event on day 1 and a sell close event on day 2. Its Important to note here that our trade window will be static at 1 day, at least initially.
Furthermore, we will define a static amount of money we will invest over different stocks to simulate diversity. Lastly, although not as important, we will define a static amount of total money invested, that will be spread across all stocks. Although static, it would be important to note this as a variable as some algorithmic trading strategies do not work at scale.
We'll define total amount initial amount invested as:
Well define the amount invested in each stock,
Where
Next, we'll want to define an terms and expressions to show the amount of money we made/loss starting at an initial day
Where
The first summation will be all stocks that we chose to invest, while the second summation are the stocks that we chose not to invest (therefore did not lose money or gain money). We'll call these two summations
So for a group of trades, we can define it our ending amount with profits/losses over a time period
We'll also want to consider opportunity cost in the event that our business has a reliable way of making money. In this case, we can define
And to factor in opportunity cost, we'll have to subtract the opportunity that we missed which will give us an adjusted profit/loss,
This can be used for both our model and our random algorithm.
If,
We have shown that our model has increased our profit versus leveraging only our opportunity, or in other words, its better to use our model than some other reliable, albeit lower, means of investing.
In stock trading, a false positive would mean that our trading model advised us to invest but it shouldnt have. This outcome is worst than a false negative, since there is not a floor to how much money we could lose. In theory, when we sell our stock, the stock could have crashed to $0, or lost 100% of its value.
Its pertinent for our model that we air on the side of caution and bias our model to not invest if there is not a strong indication that the stock will go up. By not investing, we guarantee that we keep that money instead of losing it all.
One factor we must also consider is the compounding nature of profit and losses. For each profit we make on a day, we are able to invest even more the following day. However, as stated earlier, there is huge potential for losses if the stock crashes that day. So these two factors must be weighed and considered.
Lastly, we must consider opportunity costs of other potential investments, if we invest within the trading window, we can assume that our capital will be unavailable for other types of investment and will need to be considered. This would rely on the business, however, since there are few ways to make substantial amounts of money in such a short amount of time, and most of them require large amounts of capital.
For our stock trader, a false negative would mean our model advised not to invest, but should have. Although not as volatile as a false positives, we ideally want to ensure that we are choosing to invest on some days, even if they are few. We are comfortable with choosing to invest fewer days rather than more since we want to minimize the amount of false positives that we get. Furthermore, unlike false positives, false negatives would still allow us to trade in the future since the amount of money we have has not been depleted. Conversely, false positives will quickly drain our amount of money we have to invest, and if we get to zero, we are no longer able to invest.
A potential upside to false negatives is leveraging opportunity under certain conditions. If we choose not to invest, we can assume that we have that capital in our broker account and available for investment, if our business had a very reliable way of making money with our capital within the trading window, then we can factor this in and consider it to offset the cost of a false negative, atleast somewhat.
We have demonstrated the mathematical expressions that we will use to as metrics for our ML model, as well as how we plan on using these metrics to determine success/failure, and finally, we have shown the impacts to the business of false negatives and false positives and how we plan on prioritizing both.