Skip to content

Commit

Permalink
fix position_risk:updating position interval
Browse files Browse the repository at this point in the history
  • Loading branch information
51bitquant committed Mar 8, 2023
1 parent 948e565 commit 2c616b0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ if __name__ == "__main__":

```dict
{
"font.family": "",
"font.family": "", # 设置字体,如果显示不正确的话,设置为系统的一个字体
"font.size": 12,
"log.active": True,
Expand All @@ -294,7 +294,7 @@ if __name__ == "__main__":
"email.receiver": "",
"order_update_interval": 600, # securing correct orders' status by synchronizing/updating orders through rest api
"position_update_interval": 1200, #securing correct positions through rest api
"update_server_time_interval": 300, # sync with server time
"passphrase": "howtrader", # tv passphrase
"port": 9999, # tv server port
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ configuration key, you can just config the corresponding values.

```dict
{
"font.family": "",
"font.family": "", # set font family if display error
"font.size": 12,
"log.active": True,
Expand All @@ -266,7 +266,7 @@ configuration key, you can just config the corresponding values.
"email.receiver": "",
"order_update_interval": 600, # securing correct orders' status by synchronizing/updating orders through rest api
"position_update_interval": 1200, #securing correct positions through rest api
"update_server_time_interval": 300, # sync with server time
"passphrase": "howtrader", # tv passphrase
"port": 9999, # tv server port
Expand Down
2 changes: 1 addition & 1 deletion howtrader/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.3.1"
__version__ = "3.3.2"
4 changes: 2 additions & 2 deletions howtrader/gateway/binance/binance_inverse_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ def process_timer_event(self, event: Event) -> None:
self.rest_api.keep_user_stream()
self.get_server_time_interval += 1

if self.get_server_time_interval >= SETTINGS.get('position_update_interval', 600): # get the server time for every five miute
if self.get_server_time_interval >= SETTINGS.get('update_server_time_interval', 300):
self.rest_api.query_time()
self.rest_api.query_position()
# self.rest_api.query_position()
self.get_server_time_interval = 0

def on_order(self, order: OrderData) -> None:
Expand Down
2 changes: 1 addition & 1 deletion howtrader/gateway/binance/binance_spot_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def process_timer_event(self, event: Event) -> None:
self.rest_api.keep_user_stream()
self.get_server_time_interval += 1

if self.get_server_time_interval >= SETTINGS.get('position_update_interval', 600): # get the server time for every five miute
if self.get_server_time_interval >= SETTINGS.get('update_server_time_interval', 300):
self.rest_api.query_time()
self.get_server_time_interval = 0

Expand Down
4 changes: 2 additions & 2 deletions howtrader/gateway/binance/binance_usdt_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def process_timer_event(self, event: Event) -> None:
self.rest_api.keep_user_stream()
self.get_server_time_interval += 1

if self.get_server_time_interval >= SETTINGS.get('position_update_interval', 600): # get the server time for every five miute
if self.get_server_time_interval >= SETTINGS.get('update_server_time_interval', 300):
self.rest_api.query_time()
self.rest_api.query_position()
# self.rest_api.query_position()
self.get_server_time_interval = 0


Expand Down
4 changes: 2 additions & 2 deletions howtrader/trader/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


SETTINGS: Dict[str, Any] = {
"font.family": "",
"font.family": "", # font family, if display error, set to one of your system's font
"font.size": 12,

"log.active": True,
Expand All @@ -26,7 +26,7 @@
"email.receiver": "",

"order_update_interval": 600, # securing correct orders' status by synchronizing/updating orders through rest api
"position_update_interval": 1200, #securing correct positions through rest api
"update_server_time_interval": 300, # sync with server time
"passphrase": "howtrader", # tv passphrase
"port": 9999, # tv server port

Expand Down

0 comments on commit 2c616b0

Please sign in to comment.