O'Reilly logo

Mastering Python for Finance by James Ma Weiming

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Forex trading with OANDA API

In the previous sections, we implemented a trading system by interfacing with Interactive Brokers' Trader WorkStation X through the socket connections over a single port. However, many other brokers offer different choices of hooking up customized trading software over an API. In this section, we will learn how to interface our trading strategy with OANDA's REST API. OANDA is a major player in the foreign exchange (forex) business servicing retail investors. We will use a trend-following strategy to trade forex products.

What is REST?

REST stands for Representational State Transfer. It refers to web service APIs for transferring data over HTTP using the GET, PUT, POST, or DELETE methods.

With the REST API, we can stream ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required