forked from ChipaDevTeam/BinaryOptionsTools-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrade.py
More file actions
22 lines (17 loc) · 738 Bytes
/
trade.py
File metadata and controls
22 lines (17 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import asyncio
from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync
# Main part of the code
async def main(ssid: str):
# Use context manager for automatic connection and cleanup
async with PocketOptionAsync(ssid) as api:
(buy_id, buy) = await api.buy(
asset="EURUSD_otc", amount=1.0, time=60, check_win=False
)
print(f"Buy trade id: {buy_id}\nBuy trade data: {buy}")
(sell_id, sell) = await api.sell(
asset="EURUSD_otc", amount=1.0, time=60, check_win=False
)
print(f"Sell trade id: {sell_id}\nSell trade data: {sell}")
if __name__ == "__main__":
ssid = input("Please enter your ssid: ")
asyncio.run(main(ssid))