[Mod] remove test function

This commit is contained in:
vn.py 2019-09-15 23:53:49 +08:00
parent d4cab7bfc2
commit f94144b704
3 changed files with 2 additions and 22 deletions

View File

@ -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
)

View File

@ -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)

View File

@ -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)