Skip to content

Commit c0b24de

Browse files
author
Shlomi Kushchi
authored
fix logic in rerank()
self.shortAmount + self.longAmount should be = equity
1 parent a61bb78 commit c0b24de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/long-short.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def rerank(self):
250250
equity = int(float(self.alpaca.get_account().equity))
251251

252252
self.shortAmount = equity * 0.30
253-
self.longAmount = equity + self.shortAmount
253+
self.longAmount = equity - self.shortAmount
254254

255255
respGetTPLong = []
256256
tGetTPLong = threading.Thread(target=self.getTotalPrice, args=[self.long, respGetTPLong])

0 commit comments

Comments
 (0)