-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathhistory.py
More file actions
23 lines (16 loc) · 613 Bytes
/
Copy pathhistory.py
File metadata and controls
23 lines (16 loc) · 613 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import time
import pandas as pd
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)
# Candles are returned in the format of a list of dictionaries
candles = api.history("EURUSD_otc", 3600)
print(f"Raw Candles: {candles}")
candles_pd = pd.DataFrame.from_dict(candles)
print(f"Candles: {candles_pd}")
if __name__ == "__main__":
ssid = input("Please enter your ssid: ")
main(ssid)