Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problems when trying to execute --close-all orders #32

Closed
Tim55667757 opened this issue Jul 21, 2022 · 1 comment
Closed

Some problems when trying to execute --close-all orders #32

Tim55667757 opened this issue Jul 21, 2022 · 1 comment
Assignees
Labels
Error It's a BUG! Or just something isn't working...
Milestone

Comments

@Tim55667757
Copy link
Owner

Some problems when trying to --close-all orders:

TKSBrokerAPI.py     L:2665 DEBUG   [2022-07-21 11:17:39,117] Closing all available ['orders']. Currency positions you must closes manually using buy or sell operations! Wait, please...
TKSBrokerAPI.py     L:1063 DEBUG   [2022-07-21 11:17:39,118] Requesting current actual pending orders. Wait, please...
TKSBrokerAPI.py     L:1069 DEBUG   [2022-07-21 11:17:39,249] [0] records about pending orders successfully received
TKSBrokerAPI.py     L:1080 DEBUG   [2022-07-21 11:17:39,250] Requesting current actual stop orders. Wait, please...
TKSBrokerAPI.py     L:1086 DEBUG   [2022-07-21 11:17:39,389] [7] records about stop orders successfully received
TKSBrokerAPI.py     L:2638 INFO    [2022-07-21 11:17:39,389] Found: [0] opened pending and [7] stop orders. Let's trying to cancel it all. Wait, please...
TKSBrokerAPI.py     L:1063 DEBUG   [2022-07-21 11:17:39,390] Requesting current actual pending orders. Wait, please...
TKSBrokerAPI.py     L:1069 DEBUG   [2022-07-21 11:17:39,526] [0] records about pending orders successfully received
TKSBrokerAPI.py     L:2605 DEBUG   [2022-07-21 11:17:39,527] Cancelling stop order with ID: [2b60ac95-743f-4fa9-9ea0-f1e4af222a27]. Wait, please...
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,729] Traceback (most recent call last):
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,729]   File "X:\work\projects\TKSBrokerAPI\tksbrokerapi\TKSBrokerAPI.py", line 3016, in Main
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,730]     server.CloseAll(*args.close_all)
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,730]   File "X:\work\projects\TKSBrokerAPI\tksbrokerapi\TKSBrokerAPI.py", line 2669, in CloseAll
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,731]     self.CloseAllOrders()  # close all pending and stop orders
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,731]   File "X:\work\projects\TKSBrokerAPI\tksbrokerapi\TKSBrokerAPI.py", line 2640, in CloseAllOrders
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,732]     self.CloseOrders(allOrdersIDs + allStopOrdersIDs, allOrdersIDs, allStopOrdersIDs)
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,733]   File "X:\work\projects\TKSBrokerAPI\tksbrokerapi\TKSBrokerAPI.py", line 2615, in CloseOrders
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,733]     datetime.strptime(responseJSON["time"], "%Y-%m-%dT%H:%M:%S.%fZ").replace(tzinfo=tzutc()).astimezone(tzlocal()).strftime("%Y-%m-%d %H:%M:%S"),
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,733]   File "C:\python3\lib\_strptime.py", line 577, in _strptime_datetime
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,734]     tt, fraction, gmtoff_fraction = _strptime(data_string, format)
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,734]   File "C:\python3\lib\_strptime.py", line 359, in _strptime
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,735]     (data_string, format))
TKSBrokerAPI.py     L:3027 DEBUG   [2022-07-21 11:17:39,735] ValueError: time data '2022-07-21T08:17:37.686748041Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'
@Tim55667757 Tim55667757 added the Error It's a BUG! Or just something isn't working... label Jul 21, 2022
@Tim55667757 Tim55667757 self-assigned this Jul 21, 2022
@Tim55667757 Tim55667757 added this to the release-1.1 milestone Jul 21, 2022
@Tim55667757 Tim55667757 changed the title Some problems when trying to --close-all orders Some problems when trying to execute --close-all orders Jul 22, 2022
Tim55667757 added a commit that referenced this issue Jul 22, 2022
@Tim55667757
Copy link
Owner Author

The error was due to incorrect handling of the input string format in one of the debug messages. Extra messages, and with them the formatting error, have been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error It's a BUG! Or just something isn't working...
Projects
None yet
Development

No branches or pull requests

1 participant