Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

Commit bee9487

Browse files
committed
added v2
1 parent 9da91a0 commit bee9487

33 files changed

Lines changed: 2137 additions & 0 deletions

v2/pocketoptionapi-v2/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.py[cod]
2+
build/
3+
dist/
4+
*.egg-info/
5+
.vscode/
6+
/.vs
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
2018/5/7
2+
EURUSD 1
3+
EURGBP 2
4+
GBPJPY 3
5+
EURJPY 4
6+
GBPUSD 5
7+
USDJPY 6
8+
AUDCAD 7
9+
NZDUSD 8
10+
USDRUB 10
11+
AMAZON 31
12+
APPLE 32
13+
BAIDU 33
14+
CISCO 34
15+
FACEBOOK 35
16+
GOOGLE 36
17+
INTEL 37
18+
MSFT 38
19+
YAHOO 40
20+
AIG 41
21+
CITI 45
22+
COKE 46
23+
GE 48
24+
GM 49
25+
GS 50
26+
JPM 51
27+
MCDON 52
28+
MORSTAN 53
29+
NIKE 54
30+
USDCHF 72
31+
XAUUSD 74
32+
EURUSD-OTC 76
33+
EURGBP-OTC 77
34+
USDCHF-OTC 78
35+
NZDUSD-OTC 80
36+
GBPUSD-OTC 81
37+
AUDCAD-OTC 86
38+
ALIBABA 87
39+
YANDEX 95
40+
AUDUSD 99
41+
USDCAD 100
42+
AUDJPY 101
43+
GBPCAD 102
44+
GBPCHF 103
45+
GBPAUD 104
46+
EURCAD 105
47+
CHFJPY 106
48+
CADCHF 107
49+
EURAUD 108
50+
TWITTER 113
51+
FERRARI 133
52+
TESLA 167
53+
USDNOK 168
54+
EURNZD 212
55+
USDSEK 219
56+
USDTRY 220
57+
MMM:US 252
58+
ABT:US 253
59+
ABBV:US 254
60+
ACN:US 255
61+
ATVI:US 256
62+
ADBE:US 258
63+
AAP:US 259
64+
AA:US 269
65+
MO:US 278
66+
AMGN:US 290
67+
T:US 303
68+
BAC:US 313
69+
BBY:US 320
70+
BA:US 324
71+
BMY:US 328
72+
CAT:US 338
73+
CVX:US 349
74+
CL:US 365
75+
CMCSA:US 366
76+
COP:US 370
77+
COST:US 374
78+
CVS:US 379
79+
DHR:US 381
80+
DAL:US 386
81+
EBAY:US 407
82+
XOM:US 429
83+
FDX:US 434
84+
GILD:US 460
85+
HAS:US 471
86+
HON:US 480
87+
IBM:US 491
88+
KHC:US 513
89+
LMT:US 528
90+
MA:US 542
91+
MDT:US 548
92+
MU:US 553
93+
NFLX:US 569
94+
NEE:US 575
95+
NVDA:US 586
96+
PYPL:US 597
97+
PFE:US 603
98+
PM:US 605
99+
PG:US 617
100+
QCOM:US 626
101+
RTN:US 630
102+
CRM:US 645
103+
SLB:US 647
104+
SBUX:US 666
105+
SYK:US 670
106+
TWX:US 692
107+
VZ:US 723
108+
V:US 726
109+
WMT:US 729
110+
WBA:US 730
111+
WFC:US 733
112+
SNAP 756
113+
DUBAI 757
114+
TA25 758
115+
AMD 760
116+
ALGN 761
117+
ANSS 762
118+
DRE 772
119+
IDXX 775
120+
RMD 781
121+
SU 783
122+
TFX 784
123+
TMUS 785
124+
QQQ 796
125+
SPY 808
126+
BTCUSD 816
127+
XRPUSD 817
128+
ETHUSD 818
129+
LTCUSD 819
130+
DSHUSD 821
131+
BCHUSD 824
132+
OMGUSD 825
133+
ZECUSD 826
134+
ETCUSD 829
135+
BTGUSD 837
136+
QTMUSD 845
137+
TRXUSD 858
138+
EOSUSD 864
139+
USDINR 865
140+
USDPLN 866
141+
USDBRL 867
142+
USDZAR 868
143+
DBX 889
144+
SPOT 891
145+
USDSGD 892
146+
USDHKD 893

v2/pocketoptionapi-v2/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Document
2+
3+
## document
4+
5+
https://lu-yi-hsun.github.io/pocketoptionapi/
6+
1.12 KB
Binary file not shown.
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# Get start
2+
3+
## document version
4+
5+
7/5
6+
7+
2.2 fix connect stable
8+
9+
6/13
10+
fix auth
11+
12+
13+
12/5
14+
15+
1.6
16+
fix websocket connect
17+
18+
19+
10/29
20+
1.5
21+
fix updateAssets
22+
23+
7/17
24+
1.1 add get_payment
25+
26+
7/3
27+
28+
add more function
29+
30+
6/23
31+
v0.1
32+
!!!Start New!!
33+
34+
## Debug Mode ON
35+
```python
36+
import logging
37+
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s')
38+
```
39+
## check_win & buy sample
40+
41+
```python
42+
from pocketoptionapi.stable_api import PocketOption
43+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123123\";s:10:\"ip_address\";s:12:\"2.111.11.5\";s:10:\"user_agent\";s:104:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123232;}1232321213","isDemo":0,"uid":"123232132"}]"""
44+
account=PocketOption(ssid)
45+
check_connect,message=account.connect()
46+
if check_connect:
47+
account.change_balance("PRACTICE")#"REAL"
48+
asset="EURUSD"
49+
amount=1
50+
dir="call"#"call"/"put"
51+
duration=30#sec
52+
print("Balance: ",account.get_balance())
53+
buy_info=account.buy(asset,amount,dir,duration)
54+
#need this to close the connect
55+
print("----Trade----")
56+
print("Get: ",account.check_win(buy_info["id"]))
57+
print("----Trade----")
58+
print("Balance: ",account.get_balance())
59+
#need close ping server thread
60+
account.close()
61+
```
62+
63+
## Login
64+
65+
PockOption only support ssid login, because GOOGLE reCAPTCHA
66+
67+
```python
68+
from pocketoptionapi.stable_api import PocketOption
69+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
70+
account=PocketOption(ssid)
71+
check,message=account.connect()
72+
account.close()
73+
```
74+
75+
## Get Balance
76+
77+
78+
```python
79+
from pocketoptionapi.stable_api import PocketOption
80+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
81+
account=PocketOption(ssid)
82+
check,message=account.connect()
83+
account.change_balance("PRACTICE")
84+
balance=account.get_balance()
85+
print(balance)
86+
account.close()
87+
```
88+
89+
90+
91+
## Buy
92+
93+
```python
94+
from pocketoptionapi.stable_api import PocketOption
95+
96+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
97+
account=PocketOption(ssid)
98+
check,message=account.connect()
99+
if check:
100+
account.change_balance("PRACTICE")
101+
asset="EURUSD"
102+
amount=1
103+
dir="call"#"call"/"put"
104+
duration=60#sec
105+
print(account.buy(asset,amount,dir,duration))
106+
account.close()
107+
```
108+
109+
## sell_option
110+
111+
```python
112+
from pocketoptionapi.stable_api import PocketOption
113+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
114+
account=PocketOption(ssid)
115+
check_connect,message=account.connect()
116+
if check_connect:
117+
account.change_balance("PRACTICE")#"REAL"
118+
asset="EURUSD"
119+
amount=1
120+
dir="call"#"call"/"put"
121+
duration=120#sec
122+
print("Balance: ",account.get_balance())
123+
buy_info=account.buy(asset,amount,dir,duration)
124+
#need this to close the connect
125+
account.sell_option(buy_info["id"])
126+
account.close()
127+
```
128+
129+
130+
## get candle
131+
132+
```python
133+
from pocketoptionapi.stable_api import PocketOption
134+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
135+
account=PocketOption(ssid)
136+
check_connect,message=account.connect()
137+
import time
138+
if check_connect:
139+
asset="EURUSD"
140+
_time=int(time.time())#the candle end of time
141+
offset=120#how much sec want to get _time-offset --->your candle <---_time
142+
period=60#candle size in sec
143+
print("You will get the candle from: "+str(_time-offset)+" to: "+str(_time))
144+
print("------\n")
145+
candle=account.get_candle(asset,_time,offset,period)
146+
for c in candle["data"]:
147+
print(c)
148+
account.close()
149+
```
150+
151+
## check_asset_open
152+
153+
```python
154+
from pocketoptionapi.stable_api import PocketOption
155+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
156+
account=PocketOption(ssid)
157+
check_connect,message=account.connect()
158+
import time
159+
if check_connect:
160+
print("Check Asset Open")
161+
for i in account.get_all_asset_name():
162+
print(i,account.check_asset_open(i))
163+
account.close()
164+
```
165+
166+
## GET realtime candle
167+
168+
169+
```python
170+
from pocketoptionapi.stable_api import PocketOption
171+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
172+
account=PocketOption(ssid)
173+
check_connect,message=account.connect()
174+
import time
175+
if check_connect:
176+
asset="NZDUSD_otc"
177+
list_size=10#this is setting how much Quote you want to save
178+
account.start_candles_stream("NZDUSD_otc",list_size)
179+
while True:
180+
if len(account.get_realtime_candles("NZDUSD_otc"))==list_size:
181+
break
182+
print(account.get_realtime_candles("NZDUSD_otc"))
183+
account.close()
184+
```
185+
186+
## get_payment
187+
188+
```python
189+
from pocketoptionapi.stable_api import PocketOption
190+
ssid=r"""42["auth",{"session":"a:4:{s:10:\"session_id\";s:32:\"123123123\";s:10:\"ip_address\";s:12:\"1.2.3.4\";s:10:\"user_agent\";s:123:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36\";s:13:\"last_activity\";i:123;}123","isDemo":1,"uid":"123"}]"""
191+
account=PocketOption(ssid)
192+
check_connect,message=account.connect()
193+
if check_connect:
194+
195+
all_data=account.get_payment()
196+
for asset_name in all_data:
197+
asset_data=all_data[asset_name]
198+
print(asset_name,asset_data["payment"],asset_data["open"])
199+
200+
account.close()
201+
```

v2/pocketoptionapi-v2/docs/javascripts/.Rhistory

Whitespace-only changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
window.MathJax = {
2+
jax: ["input/TeX","input/MathML","input/AsciiMath","output/SVG"],
3+
extensions: ["tex2jax.js","mml2jax.js","asciimath2jax.js","MathMenu.js","MathZoom.js","AssistiveMML.js", "a11y/accessibility-menu.js"],
4+
TeX: {
5+
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
6+
},
7+
tex2jax: {
8+
inlineMath: [ ["\\(","\\)"] ],
9+
displayMath: [ ["\\[","\\]"] ]
10+
},
11+
TeX: {
12+
TagSide: "right",
13+
TagIndent: ".8em",
14+
MultLineWidth: "85%",
15+
equationNumbers: {
16+
autoNumber: "AMS",
17+
},
18+
unicode: {
19+
fonts: "STIXGeneral,'Arial Unicode MS'"
20+
}
21+
},
22+
displayAlign: "left",
23+
showProcessingMessages: false,
24+
messageStyle: "none"
25+
};
26+
27+

0 commit comments

Comments
 (0)