forked from juvu/Optionstrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_tradier.py
50 lines (37 loc) · 1 KB
/
test_tradier.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
import pytest
import tradier
@pytest.fixture
def token():
return os.environ['TRADIER_ACCESS_TOKEN']
def test_core(token):
print
print
c = tradier.Tradier(token)
# print c.request('GET', 'markets/quotes', params={'symbols': 'spy'})
# print
# print c.request('GET', 'user/balances')
# print
# c.request(
# 'GET', 'markets/fundamentals/company', params={'symbols': 'spy'})
# print c.watchlists()
# print c.watchlists.get('foo21')
# print c.watchlists.delete('default')
print
print
"""
print c.user.profile()
print
print c.user.balances()
"""
import json
"""
got = c.request(
'GET',
'markets/options/expirations',
params={'symbol': 'AAPL'})
print json.dumps(got, sort_keys=True, indent=4, separators=(',', ': '))
"""
print c.options.expirations('amrs')
got = c.options.chains('amrs', '2015-09-18')
print json.dumps(got, sort_keys=True, indent=4, separators=(',', ': '))