bbstrader 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bbstrader might be problematic. Click here for more details.
- bbstrader/metatrader/trade.py +8 -4
- bbstrader/metatrader/utils.py +1 -1
- {bbstrader-0.1.3.dist-info → bbstrader-0.1.4.dist-info}/METADATA +1 -1
- {bbstrader-0.1.3.dist-info → bbstrader-0.1.4.dist-info}/RECORD +7 -7
- {bbstrader-0.1.3.dist-info → bbstrader-0.1.4.dist-info}/LICENSE +0 -0
- {bbstrader-0.1.3.dist-info → bbstrader-0.1.4.dist-info}/WHEEL +0 -0
- {bbstrader-0.1.3.dist-info → bbstrader-0.1.4.dist-info}/top_level.txt +0 -0
bbstrader/metatrader/trade.py
CHANGED
|
@@ -1250,7 +1250,7 @@ class Trade(RiskManagement):
|
|
|
1250
1250
|
def sleep_time(self, weekend=False):
|
|
1251
1251
|
if weekend:
|
|
1252
1252
|
# claculate number of minute from the friday and to monday start
|
|
1253
|
-
friday_time = datetime.strptime(self.
|
|
1253
|
+
friday_time = datetime.strptime(self.current_time(), '%H:%M')
|
|
1254
1254
|
monday_time = datetime.strptime(self.start, '%H:%M')
|
|
1255
1255
|
intra_day_diff = (monday_time - friday_time).total_seconds() // 60
|
|
1256
1256
|
inter_day_diff = 3 * 24 * 60
|
|
@@ -1259,14 +1259,18 @@ class Trade(RiskManagement):
|
|
|
1259
1259
|
else:
|
|
1260
1260
|
# claculate number of minute from the end to the start
|
|
1261
1261
|
start = datetime.strptime(self.start, '%H:%M')
|
|
1262
|
-
end =
|
|
1262
|
+
end = datetime.strptime(self.current_time(), '%H:%M')
|
|
1263
1263
|
minutes = (end - start).total_seconds() // 60
|
|
1264
1264
|
sleep_time = (24*60) - minutes
|
|
1265
1265
|
return sleep_time
|
|
1266
1266
|
|
|
1267
|
-
def
|
|
1267
|
+
def current_datetime(self):
|
|
1268
1268
|
return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
1269
|
-
|
|
1269
|
+
|
|
1270
|
+
def current_time(self, seconds=False):
|
|
1271
|
+
if seconds:
|
|
1272
|
+
return datetime.now().strftime("%H:%M:%S")
|
|
1273
|
+
return datetime.now().strftime("%H:%M")
|
|
1270
1274
|
|
|
1271
1275
|
def create_trade_instance(
|
|
1272
1276
|
symbols: List[str],
|
bbstrader/metatrader/utils.py
CHANGED
|
@@ -13,16 +13,16 @@ bbstrader/metatrader/__init__.py,sha256=y4JLz05esm3PKerHMgtd3dmRpa7yUvWVuj_xOnlh
|
|
|
13
13
|
bbstrader/metatrader/account.py,sha256=V5VbkUP2OawEuvRSGAAr_L0gXXdiwiACBD5hDXm-cbE,42651
|
|
14
14
|
bbstrader/metatrader/rates.py,sha256=tGcWh2t9Yilik8YDMN2_VBeWV4VNa4zHABmOT98rW8g,8286
|
|
15
15
|
bbstrader/metatrader/risk.py,sha256=tGpmP6pOtbn4iWtX4P6Gl2Z5YuP2jRI5g7Z8pybsO58,25134
|
|
16
|
-
bbstrader/metatrader/trade.py,sha256=
|
|
17
|
-
bbstrader/metatrader/utils.py,sha256=
|
|
16
|
+
bbstrader/metatrader/trade.py,sha256=szLRhWKM7Vh0pxPXNi0mRq0bSoHpETRXOwWGPVdbW28,57296
|
|
17
|
+
bbstrader/metatrader/utils.py,sha256=Tw98T4iBqlMtm9jVnwsf9mjKxZkD_rA0u8xJLqoHl0Q,18922
|
|
18
18
|
bbstrader/models/__init__.py,sha256=6tAj9V9vgwesgPVMKznwRB3k8-Ec8Q73Di5p2UO0qlA,274
|
|
19
19
|
bbstrader/models/risk.py,sha256=2fFBqsY2v8Kd6oU8t8h2h-Sp8joVqetA-t21rjkT9U4,13593
|
|
20
20
|
bbstrader/trading/__init__.py,sha256=yZ85EALV2sSCzCPxaeFYlk1JJhYQq2C-xSd5EEQYvI8,82
|
|
21
21
|
bbstrader/trading/execution.py,sha256=geiIiR9ldTJvM6rapa66Xug-gRcA_YqfA6kCr54lnRw,46708
|
|
22
22
|
bbstrader/trading/run.py,sha256=UA5Sn5nWOqsezZVGCM_kjOPPsu_IxMdSABUBnBAJA-k,3474
|
|
23
23
|
bbstrader/trading/utils.py,sha256=Eu_cBnfPcOGel4Lj6Dc-UCl-h7NqR8Rfv9RZtaxNRos,7711
|
|
24
|
-
bbstrader-0.1.
|
|
25
|
-
bbstrader-0.1.
|
|
26
|
-
bbstrader-0.1.
|
|
27
|
-
bbstrader-0.1.
|
|
28
|
-
bbstrader-0.1.
|
|
24
|
+
bbstrader-0.1.4.dist-info/LICENSE,sha256=1EudjwwP2oTJy8Vh0e-Kzv8VZZU95y-t6c3DYhR51uc,1115
|
|
25
|
+
bbstrader-0.1.4.dist-info/METADATA,sha256=L-rGeXHa2gllmmh4q8OHkmD514Lb6zpwkVn35YTX5NM,9029
|
|
26
|
+
bbstrader-0.1.4.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
|
27
|
+
bbstrader-0.1.4.dist-info/top_level.txt,sha256=Wwj322jZmxGZ6gD_TdaPiPLjED5ReObm5omerwlmZIg,10
|
|
28
|
+
bbstrader-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|