How to determine a profit or a loss?
Opened this issue · 3 comments
MightyMaxSaviorOfTheUniverse commented
Hello
I can't seem to find any method that shows you whether you have made a profit or a lose from your last trade, or even if that trade has been concluded
Can anyone point me in the right direction with some working code examples?
Thank you in advance
djumpen commented
I was unable to find proper solution for this and that is why I made it in this way:
def make_bid(pair, direction):
threadUpdater = Thread(target=update_reports)
threadUpdater.start()
... (making bid)
def update_reports():
time.sleep(2 * 60)
for k, item in iqoption.portfolio.items():
if item.win == "equal":
continue
... (handle "k" as bid result)
This example ignores cases when result is really "equal", but it is fine for me.
It is not a production solution
MightyMaxSaviorOfTheUniverse commented
I was unable to find proper solution for this and that is why I made it in this way:
def make_bid(pair, direction): threadUpdater = Thread(target=update_reports) threadUpdater.start() ... (making bid)
def update_reports(): time.sleep(2 * 60) for k, item in iqoption.portfolio.items(): if item.win == "equal": continue ... (handle "k" as bid result)
This example ignores cases when result is really "equal", but it is fine for me.
It is not a production solution
MightyMaxSaviorOfTheUniverse commented