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: