fix: Correct entry_price property usage in DynamicStrategy stop loss

This commit is contained in:
Bobby (aider) 2025-02-13 23:39:00 -08:00
parent 3249acd33c
commit 17e9024a3f

View File

@ -98,7 +98,7 @@ class DynamicStrategy(Strategy):
# Check stop loss for existing position # Check stop loss for existing position
if self.position: if self.position:
# Calculate the percentage loss from entry # Calculate the percentage loss from entry
entry_price = self.position.entry_price() # Changed from entry_price to entry_price() entry_price = self.position.entry_price # Changed from entry_price() to entry_price
current_loss = ((price - entry_price) / entry_price) * 100 current_loss = ((price - entry_price) / entry_price) * 100
# If loss exceeds 7%, close the position # If loss exceeds 7%, close the position