diff --git a/vnpy/app/spread_trading/algo.py b/vnpy/app/spread_trading/algo.py index 39ca2ecf..9e0066ed 100644 --- a/vnpy/app/spread_trading/algo.py +++ b/vnpy/app/spread_trading/algo.py @@ -87,7 +87,7 @@ class SpreadTakerAlgo(SpreadAlgoTemplate): spread_order_volume = max(spread_order_volume, spread_volume_left) # Calculate active leg order volume - leg_order_volume = self.spread.caculate_leg_volume( + leg_order_volume = self.spread.calculate_leg_volume( self.spread.active_leg.vt_symbol, spread_order_volume ) @@ -114,7 +114,7 @@ class SpreadTakerAlgo(SpreadAlgoTemplate): # Calculate passive leg target volume and do hedge for leg in self.spread.passive_legs: passive_traded = self.leg_orders[leg.vt_symbol] - passive_target = self.spread.caculate_leg_volume( + passive_target = self.spread.calculate_leg_volume( leg.vt_symbol, hedge_volume ) diff --git a/vnpy/app/spread_trading/engine.py b/vnpy/app/spread_trading/engine.py index 8bcfb831..42690280 100644 --- a/vnpy/app/spread_trading/engine.py +++ b/vnpy/app/spread_trading/engine.py @@ -84,28 +84,9 @@ class SpreadDataEngine: """""" self.load_setting() self.register_event() - self.test() self.write_log("价差数据引擎启动成功") - def test(self): - """""" - name = "test" - leg_settings = [ - { - "vt_symbol": "XBTUSD.BITMEX", - "price_multiplier": 1, - "trading_multiplier": 1 - }, - { - "vt_symbol": "XBTZ19.BITMEX", - "price_multiplier": -1, - "trading_multiplier": -1 - } - ] - active_symbol = "XBTUSD.BITMEX" - self.add_spread(name, leg_settings, active_symbol, True) - def load_setting(self) -> None: """""" setting = load_json(self.setting_filename) diff --git a/vnpy/app/spread_trading/ui/widget.py b/vnpy/app/spread_trading/ui/widget.py index ebfe8977..062e6221 100644 --- a/vnpy/app/spread_trading/ui/widget.py +++ b/vnpy/app/spread_trading/ui/widget.py @@ -209,7 +209,6 @@ class SpreadAlgoDialog(QtWidgets.QDialog): ) float_validator = QtGui.QDoubleValidator() - float_validator.setBottom(0) self.price_line = QtWidgets.QLineEdit() self.price_line.setValidator(float_validator)