Skip to content

Commit c0c2277

Browse files
authored
Add files via upload
1 parent dc83c53 commit c0c2277

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

fmz.py

+21-4
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ def __init__(self, lib, ctx, idx, opt, cfg):
642642
self.name = cfg["Id"]
643643
self.label = cfg["Label"]
644644
self.currency = '%s_%s' % (cfg["BaseCurrency"], cfg["QuoteCurrency"])
645+
self.baseCurrency = cfg["BaseCurrency"]
645646
self.quoteCurrency = cfg["QuoteCurrency"]
646647
self.maxBarLen = cfg.get('MaxBarLen', 1000)
647648
self.period = opt['Period']
@@ -660,6 +661,9 @@ def GetLabel(self):
660661
def GetCurrency(self):
661662
return self.currency
662663

664+
def GetBaseCurrency(self):
665+
return self.baseCurrency
666+
663667
def GetQuoteCurrency(self):
664668
return self.quoteCurrency
665669

@@ -1411,7 +1415,7 @@ def __init__(self, task = None, autoRun=False, gApis = None, progressCallback=No
14111415
js = os.path.join(tmpCache, crcFile)
14121416
if os.path.exists(js):
14131417
b = open(js, 'rb').read()
1414-
if os.getenv("BOTVS_TASK_UUID") is None or "c66b75f41bbb1fc64037623df4b1db92" in str(b):
1418+
if os.getenv("BOTVS_TASK_UUID") is None or "13f63ffb9a01910d28fdcc61098e2220" in str(b):
14151419
hdic = json_loads(b)
14161420
loader = os.path.join(tmpCache, soName)
14171421
update = False
@@ -1604,9 +1608,21 @@ def g_EnableLogLocal(self, b):
16041608
def g_Dial(self, *args):
16051609
self.g_LogError("sandbox not support Dial")
16061610

1611+
def g_DBExec(self, *args):
1612+
self.g_LogError("sandbox not support DBExec")
1613+
1614+
def g_Encode(self, *args):
1615+
self.g_LogError("sandbox not support Encode")
1616+
1617+
def g_EventLoop(self, *args):
1618+
self.g_LogError("sandbox not support EventLoop")
1619+
16071620
def g_Mail(self, *args):
16081621
return True
16091622

1623+
def g_Mail_Go(self, *args):
1624+
return True
1625+
16101626
def g_GetCommand(self):
16111627
return ''
16121628

@@ -1871,13 +1887,14 @@ def Join(self, report=False):
18711887
symbols = acc['Symbols']
18721888
if eid == 'Futures_CTP' or eid == 'Futures_XTP':
18731889
balanceName = 'balance'
1890+
available = balance
18741891
if symbols:
18751892
for s in symbols:
18761893
pos = acc['Symbols'][s]
18771894
for t in ['Long', 'Short']:
18781895
if t in pos:
18791896
balance += pos[t]['Margin'] + pos[t]['Profit']
1880-
pnl.append([acc['Balance'] + acc['FrozenBalance'], commission, balance])
1897+
pnl.append([available, commission, balance])
18811898
elif 'Futures_' in eid:
18821899
marginNet = .0
18831900
asset = .0
@@ -2000,9 +2017,9 @@ def shutdown(self, *args):
20002017
pass
20012018

20022019
if __name__ == '__main__':
2003-
uuid = os.getenv("BOTVS_TASK_UUID")
2020+
btUUID = os.getenv("BOTVS_TASK_UUID")
20042021
session = None
2005-
if uuid == 'dummy':
2022+
if btUUID == 'dummy':
20062023
session = gg['s']
20072024
else:
20082025
session = DummySession()

0 commit comments

Comments
 (0)