Simulation

Often, you would want to try something out first. Play around, experiment, but preferably without blowing things up or getting dirty! NumPy is perfect for experimentation. We will use NumPy to simulate a trading day, without actually losing money. Many people like to buy on the dip or, in other words, wait for the price of stocks to drop before buying. A variant of this is to wait for the price to drop a small percentage, say 0.1 percent below the opening price of the day.

Get NumPy : Beginner's Guide - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.