Skip to content

Commit

Permalink
get_step for grid.
Browse files Browse the repository at this point in the history
  • Loading branch information
lin committed Dec 20, 2020
1 parent bd41c6c commit eb9e088
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions howtrader/app/cta_strategy/strategies/binance_spot_grid_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,15 @@ def on_stop_order(self, stop_order: StopOrder):
def get_step(self) -> int:
pos = abs(self.pos)

if pos < 3 * self.trading_size:
return 1

elif pos < 5 * self.trading_size:
return 2

elif pos < 7 * self.trading_size:
return 3

return 4
return 1

# if pos < 3 * self.trading_size:
# return 1
#
# elif pos < 5 * self.trading_size:
# return 2
#
# elif pos < 7 * self.trading_size:
# return 3
#
# return 4

0 comments on commit eb9e088

Please sign in to comment.