Member-only story
Backtest Entropy Bollinger Band Strategy Using Python with Futures Data Part II
9 min readAug 29, 2023
Getting the Final Trade Log of Entropy Alpha Strategy with Entry and Exit
Let’s jump directly to the discussion from where we had left in the last part. So far We have a fresh trade log and our goal is –
- We will simulate the trades in our trade log and,
- We will check the trade performance and,
- We will analyze those details with various popular trading metrics to get an overview of the strength of our strategy.
Click here to read the First Part
Step 6 — Simulate the Trades
The goal is simple. We will simulate the trades. There will be three new variables –
- square_off_time: It will contain the time when our trade hits the target. If it does not hit the target, then it will be marked as 14:50 PM.
- square_off_price: If the price of the stock reaches the day high, it means the target is hit. It will mark that price. And if the target is not hit, it will close the trade at 14:50 PM and mark that price.
- is_target: A boolean value to check if the target is hit or not.
Triggered at stocks Trigger Date Trigger Time price high square_off_time square_off_price is_target
59 2023-04-03 10:01:00 MARUTI 2023-04-03 10:01:00 8558.15 8634.85 2023-04-03 14:50:00+05:30 8554.20…