kernc / kernc/backtesting.py

Didn't get forced liquidation when the "Low Price" is very low.

Open
#939 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

image

As depicted in the picture, the first trade generated a profit, but during the trade, a bar had a significantly low "Low Price", indicating that in reality, the first trade would have been subject to forced liquidation due to my margin setting of 0.01. Is there a way to fix this issue now?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported first-trade scenario from the screenshot, using a margin setting of 0.01 and a bar with a very low Low Price. Trace the backtest's trade and liquidation handling to determine whether that price should trigger forced liquidation. Done means the behavior is corrected and a regression case covers the scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
fintech-quant
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.