Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions back_tester/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,6 @@ def backtest_strategy(
entry_signal = None
parent_trade_id = None

# Skip the rest
return

# Update trailing stop if enabled
if use_trailing_stop and current_trade and current_price > entry_price:
updated_stop = calculate_trailing_stop(
Expand Down Expand Up @@ -563,18 +560,14 @@ def backtest_strategy(
}
db.insert_trade(trade_data)

# Reset trade tracking since position is fully closed at stop loss
current_trade = None
position = 0
entry_price = None
entry_time = None
entry_index = None
entry_signal = None
current_trade = None
parent_trade_id = None

# Skip the rest
return

# Handle new signal
if signal in ["Bullish", "Bearish"] and position == 0 and trading_signal:
# Market regime filter disabled as it's too restrictive
Expand Down