Back to Browse

How To Add A Stop Loss To A Vectorized Backtest

4.1K views
Dec 10, 2021
46:49

‎ This is not for the faint-hearted! Vectorized backtests for analysis of trading strategies are phenomenally fast. However, they can be quite complex to implement. Adding stop-loss and profit-take functions can be even more difficult because of the path dependency of the signals. Here, I show you how this is done and how to think about vectorization in general. We start with a simple MA-crossover backtest and then build the stop and profit and then create early exit signals, which we combine with the original ones. The entire backtest for two stocks starting form 1983 runs in 20 milliseconds! Watch the whole series about algo trading from scratch with python here: https://youtube.com/playlist?list=PLoZCNTbHxGBcyFiTXWPEHHteMFhPVFzgJ Disclaimer: https://www.aaaquants.com/disclaimer/

Download

0 formats

No download links available.

How To Add A Stop Loss To A Vectorized Backtest | NatokHD