Skip to content

Commit d510022

Browse files
authored
update liquidate rules
1 parent 18ea59b commit d510022

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SMACrossover/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def go_short(self):
4545

4646
def update_position(self):
4747
# If there exist long position, but the signal shows Death Cross, then close the position, and vice versa.
48-
if self.is_long and self.should_short():
48+
if self.is_long and self.fast_sma < self.slow_sma:
4949
self.liquidate()
5050

51-
if self.is_short and self.should_long():
51+
if self.is_short and self.fast_sma > self.slow_sma:
5252
self.liquidate()

0 commit comments

Comments
 (0)