Coding a Trading Bot in Python for FXCM Broker
In the previous blog we have coded a bot to trade with Binance. However in Binance you can trade only cryptocurrencies, so today we will use the FXCM broker to test how can we trade cryptocurrencies, stocks, forex and commodities.
The Strategy
For demonstration purposes only I consider the Bollinger bands strategy.
The bands are used to determine overbought and oversold conditions, this indicator focuses on price and volatility.
The Bollinger bands are composed by three bands: up band, middle band and lower band. The upper and lower bands are typically 2 standard deviations +/- from a 20-day simple moving average.
Furthermore taking the up band and the low band respectively the maximum and the minimum it is possible calculate the percent of the price between this range.
I suggest you to check the link below for a more detailed explanation.
The idea is to:
- Buy: when the middle band crosses up the closing price and the…