forked from ChipaDevTeam/BinaryOptionsTools-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_win.py
More file actions
24 lines (18 loc) · 888 Bytes
/
check_win.py
File metadata and controls
24 lines (18 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import time
from BinaryOptionsToolsV2.pocketoption import PocketOption
# Main part of the code
def main(ssid: str):
# The api automatically detects if the 'ssid' is for real or demo account
api = PocketOption(ssid)
time.sleep(5)
(buy_id, _) = api.buy(asset="EURUSD_otc", amount=1.0, time=60, check_win=False)
(sell_id, _) = api.sell(asset="EURUSD_otc", amount=1.0, time=60, check_win=False)
print(buy_id, sell_id)
# This is the same as setting checkw_win to true on the api.buy and api.sell functions
buy_data = api.check_win(buy_id)
sell_data = api.check_win(sell_id)
print(f"Buy trade result: {buy_data['result']}\nBuy trade data: {buy_data}")
print(f"Sell trade result: {sell_data['result']}\nSell trade data: {sell_data}")
if __name__ == "__main__":
ssid = input("Please enter your ssid: ")
main(ssid)