Take a look near the "simulation parameters" in Backtester and you'll notice a new button that says "advanced."
Click it and you'll see a few of the internal cogs of Backtester revealed!
These are the default parameters that have always been set in Backtester, but now we're exposing them for investors who want more control over how the simulation works. You can safely leave these defaults if you like - we put a lot of thought and care into choosing them when we originally designed Backtester - but let's dive into what you can do with these new features.
Buy Execute Price
This is the simulated price you will purchase shares at on each day of the simulation. The options are open
, high
, low
, close
and the default average
. If you choose open
this tells the Backtester to purchase shares assuming you'll get the open price for the day. Of course, it's difficult to get the absolute open, but this is a simulation, and should be a good approximation of stock price at the beginning of the day. The default is average
and is simply the average of the open, high, low, and closing prices for the day, which approximates what the average trader would have been able to buy the stock for.
Sell Execute Price
Similarly, you can set which price through the day the simulation will sell shares at. The same options apply as in "buy execute price." Between these two options, you can get a great idea how acting at different points in the day affects your performance.
I'll personally be using these options to get a sense for the upper and lower bounds on strategy performance. Let's say I always buy at the high and sell at the low, or always happen to buy at the low and sell at the high. It's really hard to pick the day's high or low point when trading, so doing this in Backtester will give me a lower and upper bound on how sensitive my strategy is to intraday movements depending on what time I execute my trades.
Principle
This one is pretty self explanatory. You might have noticed that the amount of cash the simulation starts with is always $100,000. Well, now you can customize that! Your principle will mostly just affect the number of shares you can purchase, since Backtester only purchases whole shares. The more cash you start with, the more evenly divided each position will be. Also, if you're only trading $100, it will prevent you from buying ridiculously expensive stocks like AMZN which is currently trading at over $1900 a share.
Minimum Hold Time
This option specifies how long to wait before ever evaluating any sell rules. In other words, a "min hold time" of 3 will always hold a new position for at least 3 trading days, no matter what sell rules you have (this includes dayslive()
). Let's say you have a really aggressive sell rule like adjclose(1) < highestprice() * 0.98
which will sell after the stock has fallen 2% from its high. I've seen strategies bail on otherwise good stocks because a 2% fluctuation is practically within the noise a stock price may experience during the day. Setting a minimum hold time allows you to hold a stock long enough for it to potentially enter a price run up, then you can sell as soon as the run shows any weakness without getting triggered by noise before the run has even started. This option can also be seen in Watchlist which got a new "advanced" button too, just for this feature.
Summing up
We hope you like these new options in Backtester, and that you come up with ever more clever, resilient, and profitable strategies with them! Many of these features were driven by user feedback, so please keep sending us your awesome suggestions for what you'd like to see in the tool next.