Skip to content

Commit

Permalink
Add delay to avoid continuous requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
breadum committed Dec 11, 2023
1 parent 7ef19e9 commit 0c22c43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tutorials/6. Trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import sys

from PyQt5.QtWidgets import QApplication
from PyQt5.QtTest import QTest

from kiwoom import Bot, Server
from kiwoom.data.preps import prep
Expand Down Expand Up @@ -44,7 +45,8 @@ def balance(self, prev_next='0'):
}
for key, val in inputs.items():
self.api.set_input_value(key, val)

if prev_next != '0':
QTest.qWait(500)
return_code = self.api.comm_rq_data('balance', tr_code, prev_next, '0000')
if return_code == 0:
self.api.loop()
Expand Down

0 comments on commit 0c22c43

Please sign in to comment.