The simulator
Here, we'll provide a brief explanation of how the simulator works. It is implemented as a function that accepts our standard Pandas DataFrame data and the model's predictions as inputs. First, we'll define the buying threshold and the stake size (how much money we invest in each buy), as well as placeholder variables. The variables will be used to store the true and predicted time series, as well as the profits of our model (balances). Furthermore, we define the buy_price variable, which stores the price at which we bought the Bitcoins. If the price is 0, we assume that we do not hold any Bitcoins. The buy_points and sell_points lists indicate the points in time when we bought or sold the Bitcoins and are used only for plotting. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access