From 162b4cc7b698a0b23ef4cf21bc448d8f38373c96 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 21 Mar 2018 12:39:27 +0800 Subject: [PATCH] =?UTF-8?q?[Add]=E5=A2=9E=E5=8A=A0VnTrader=E5=B0=8F?= =?UTF-8?q?=E6=95=B0=E7=82=B9=E6=98=BE=E7=A4=BA=E9=85=8D=E7=BD=AE=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/VnTrader/VT_setting.json | 6 ++++-- vnpy/trader/VT_setting.json | 4 +++- vnpy/trader/uiBasicWidget.py | 2 +- vnpy/trader/vtFunction.py | 11 +++++++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/examples/VnTrader/VT_setting.json b/examples/VnTrader/VT_setting.json index 62f5903e..473017fb 100644 --- a/examples/VnTrader/VT_setting.json +++ b/examples/VnTrader/VT_setting.json @@ -11,8 +11,10 @@ "logActive": true, "logLevel": "debug", - "logConsole": false, + "logConsole": true, "logFile": true, - "tdPenalty": ["IF", "IH", "IC"] + "tdPenalty": ["IF", "IH", "IC"], + + "maxDecimal": 4 } \ No newline at end of file diff --git a/vnpy/trader/VT_setting.json b/vnpy/trader/VT_setting.json index a00ff35e..473017fb 100644 --- a/vnpy/trader/VT_setting.json +++ b/vnpy/trader/VT_setting.json @@ -14,5 +14,7 @@ "logConsole": true, "logFile": true, - "tdPenalty": ["IF", "IH", "IC"] + "tdPenalty": ["IF", "IH", "IC"], + + "maxDecimal": 4 } \ No newline at end of file diff --git a/vnpy/trader/uiBasicWidget.py b/vnpy/trader/uiBasicWidget.py index 4140be24..62c0c65a 100644 --- a/vnpy/trader/uiBasicWidget.py +++ b/vnpy/trader/uiBasicWidget.py @@ -755,7 +755,7 @@ class TradingWidget(QtWidgets.QFrame): self.comboOffset.addItems(self.offsetList) self.spinPrice = QtWidgets.QDoubleSpinBox() - self.spinPrice.setDecimals(4) + self.spinPrice.setDecimals(globalSetting.get('maxDecimal', 4)) self.spinPrice.setMinimum(0) self.spinPrice.setMaximum(100000) diff --git a/vnpy/trader/vtFunction.py b/vnpy/trader/vtFunction.py index dafee913..e5b4eb71 100644 --- a/vnpy/trader/vtFunction.py +++ b/vnpy/trader/vtFunction.py @@ -10,9 +10,10 @@ import json from datetime import datetime from math import isnan +from vtGlobal import globalSetting MAX_NUMBER = 10000000000000 -MAX_DECIMAL = 4 +MAX_DECIMAL = globalSetting.get('maxDecimal', 4) #---------------------------------------------------------------------- def safeUnicode(value): @@ -40,7 +41,13 @@ def todayDate(): # 图标路径 iconPathDict = {} -path = os.path.abspath(os.path.dirname(__file__)) +path = os.path.abspath(os.path.dirname(__file__)) # 遍历vnpy安装目录 +for root, subdirs, files in os.walk(path): + for fileName in files: + if '.ico' in fileName: + iconPathDict[fileName] = os.path.join(root, fileName) + +path = os.getcwd() # 遍历工作目录 for root, subdirs, files in os.walk(path): for fileName in files: if '.ico' in fileName: