Member-only story

Backtest Entropy Bollinger Band Strategy Using Python with Futures Data Part II

Amit Kumar Ghosh
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 –

  1. We will simulate the trades in our trade log and,
  2. We will check the trade performance and,
  3. 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 –

  1. 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.
  2. 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.
  3. 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…

--

--

Amit Kumar Ghosh
Amit Kumar Ghosh

Written by Amit Kumar Ghosh

Aloha, I’m Amit Ghosh, a web entrepreneur and avid blogger. Bitten by entrepreneurial bug, I got kicked out from college and ended up being millionaire!

No responses yet