April 2019
Intermediate to advanced
426 pages
11h 13m
English
With the methods of broker now defined, we can test the connection that is set up between our broker by reading the current market prices. The Broker class may be instantiated using the following Python codes:
# Replace these 2 values with your own! ACCOUNT_ID = '101-001-1374173-001' API_TOKEN = '6ecf6b053262c590b78bb8199b85aa2f-d99c54aecb2d5b4583a9f707636e8009' broker = OandaBroker(ACCOUNT_ID, API_TOKEN)
Replace the two constant variables, ACCOUNT_ID and API_TOKEN, with your own credentials given by your broker, which identifies your own trading account. The broker variable is an instance of OandaBroker, which we can use to perform various broker-specific calls.
Suppose that we are interested in finding out the current ...
Read now
Unlock full access