forked from xeroc/stakemachine
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add base for staggered orders strategy
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from dexbot.basestrategy import BaseStrategy | ||
from dexbot.queue.idle_queue import idle_add | ||
|
||
from bitshares.amount import Amount | ||
|
||
|
||
class Strategy(BaseStrategy): | ||
""" Staggered Orders strategy | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
||
# Define Callbacks | ||
self.onMarketUpdate += self.check_orders | ||
self.onAccount += self.check_orders | ||
|
||
self.error_ontick = self.error | ||
self.error_onMarketUpdate = self.error | ||
self.error_onAccount = self.error | ||
|
||
self.worker_name = kwargs.get('name') | ||
self.view = kwargs.get('view') | ||
|
||
self.check_orders() | ||
|
||
def error(self, *args, **kwargs): | ||
self.cancel_all() | ||
self.disabled = True | ||
self.log.info(self.execute()) | ||
|
||
def update_orders(self): | ||
self.log.info('Change detected, updating orders') | ||
# Todo: implement logic | ||
|
||
def check_orders(self, *args, **kwargs): | ||
""" Tests if the orders need updating | ||
""" | ||
pass | ||
# Todo: implement logic | ||
|
||
# GUI updaters | ||
def update_gui_profit(self): | ||
pass | ||
|
||
def update_gui_slider(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters