@@ -642,6 +642,7 @@ def __init__(self, lib, ctx, idx, opt, cfg):
642
642
self .name = cfg ["Id" ]
643
643
self .label = cfg ["Label" ]
644
644
self .currency = '%s_%s' % (cfg ["BaseCurrency" ], cfg ["QuoteCurrency" ])
645
+ self .baseCurrency = cfg ["BaseCurrency" ]
645
646
self .quoteCurrency = cfg ["QuoteCurrency" ]
646
647
self .maxBarLen = cfg .get ('MaxBarLen' , 1000 )
647
648
self .period = opt ['Period' ]
@@ -660,6 +661,9 @@ def GetLabel(self):
660
661
def GetCurrency (self ):
661
662
return self .currency
662
663
664
+ def GetBaseCurrency (self ):
665
+ return self .baseCurrency
666
+
663
667
def GetQuoteCurrency (self ):
664
668
return self .quoteCurrency
665
669
@@ -1411,7 +1415,7 @@ def __init__(self, task = None, autoRun=False, gApis = None, progressCallback=No
1411
1415
js = os .path .join (tmpCache , crcFile )
1412
1416
if os .path .exists (js ):
1413
1417
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 ):
1415
1419
hdic = json_loads (b )
1416
1420
loader = os .path .join (tmpCache , soName )
1417
1421
update = False
@@ -1604,9 +1608,21 @@ def g_EnableLogLocal(self, b):
1604
1608
def g_Dial (self , * args ):
1605
1609
self .g_LogError ("sandbox not support Dial" )
1606
1610
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
+
1607
1620
def g_Mail (self , * args ):
1608
1621
return True
1609
1622
1623
+ def g_Mail_Go (self , * args ):
1624
+ return True
1625
+
1610
1626
def g_GetCommand (self ):
1611
1627
return ''
1612
1628
@@ -1871,13 +1887,14 @@ def Join(self, report=False):
1871
1887
symbols = acc ['Symbols' ]
1872
1888
if eid == 'Futures_CTP' or eid == 'Futures_XTP' :
1873
1889
balanceName = 'balance'
1890
+ available = balance
1874
1891
if symbols :
1875
1892
for s in symbols :
1876
1893
pos = acc ['Symbols' ][s ]
1877
1894
for t in ['Long' , 'Short' ]:
1878
1895
if t in pos :
1879
1896
balance += pos [t ]['Margin' ] + pos [t ]['Profit' ]
1880
- pnl .append ([acc [ 'Balance' ] + acc [ 'FrozenBalance' ] , commission , balance ])
1897
+ pnl .append ([available , commission , balance ])
1881
1898
elif 'Futures_' in eid :
1882
1899
marginNet = .0
1883
1900
asset = .0
@@ -2000,9 +2017,9 @@ def shutdown(self, *args):
2000
2017
pass
2001
2018
2002
2019
if __name__ == '__main__' :
2003
- uuid = os .getenv ("BOTVS_TASK_UUID" )
2020
+ btUUID = os .getenv ("BOTVS_TASK_UUID" )
2004
2021
session = None
2005
- if uuid == 'dummy' :
2022
+ if btUUID == 'dummy' :
2006
2023
session = gg ['s' ]
2007
2024
else :
2008
2025
session = DummySession ()
0 commit comments