Custom Backtest for UK (LSE) Tax when you buy shares

Hi there,

To run a proper backtest for UK Stocks I need to implement on my code a tax duty of 0.5% of trade value when a position is open, but not when is closed.

I'm not a coder so if anyone also trades UK stocks and have a code solution for this situation, I would appreciate if you share it.

Thanks!