Skip to content

Commit

Permalink
Slider hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mikakoi committed Aug 29, 2018
1 parent 2bcf548 commit 1143b88
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions dexbot/controllers/strategy_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def elements(self):
class RelativeOrdersController(StrategyController):

def __init__(self, view, configure, worker_controller, worker_data):
# QSlider uses (int) values and manual_offset is stored as (float) with 0.1 precision.
# This reverts it so QSlider can handle the number, when fetching from config.
worker_data['manual_offset'] = worker_data['manual_offset'] * 10

super().__init__(view, configure, worker_controller, worker_data)

self.view = view
Expand All @@ -104,12 +108,6 @@ def __init__(self, view, configure, worker_controller, worker_data):
widget.relative_order_size_input.clicked.connect(self.onchange_relative_order_size_input)
widget.center_price_dynamic_input.clicked.connect(self.onchange_center_price_dynamic_input)
widget.manual_offset_input.valueChanged.connect(self.onchange_manual_offset_input)

# QSlider uses (int) values and manual_offset is stored as (float) with 0.1 precision.
# This reverts it so QSlider can handle the number, when fetching from config.
if worker_data:
worker_data['manual_offset'] = worker_data['manual_offset'] * 10

widget.reset_on_partial_fill_input.clicked.connect(self.onchange_reset_on_partial_fill_input)
widget.reset_on_price_change_input.clicked.connect(self.onchange_reset_on_price_change_input)
widget.custom_expiration_input.clicked.connect(self.onchange_custom_expiration_input)
Expand All @@ -120,6 +118,7 @@ def __init__(self, view, configure, worker_controller, worker_data):
self.onchange_reset_on_partial_fill_input(widget.reset_on_partial_fill_input.isChecked())
self.onchange_reset_on_price_change_input(widget.reset_on_price_change_input.isChecked())
self.onchange_custom_expiration_input(widget.custom_expiration_input.isChecked())
self.onchange_manual_offset_input()

@property
def values(self):
Expand Down

0 comments on commit 1143b88

Please sign in to comment.