Hi Mellstock,
Thanks for sharing your background and questions—it's great to see someone with a solid trading and programming foundation looking to dive into API and algorithmic trading.
Getting started can sometimes feel overwhelming, especially when the documentation feels too focused on indicators or complex strategies. But don’t worry—most APIs have the essential building blocks you’re looking for, like connecting to your account and executing simple trades based on straightforward conditions.
For FXCM, their API documentation is quite comprehensive, and they do provide examples of how to connect your account. Typically, you’ll need to authenticate via their API, which usually involves generating an access token or API key through their platform. Once connected, executing a trade often looks like sending a POST request with parameters specifying the instrument, order type, amount, and conditions.
Here’s a simple conceptual outline to get you started:
1. Connect to FXCM API: Use their authentication method (usually OAuth or API token).
2. Fetch current price data: Use their endpoint to get real-time prices.
3. Set your condition: For example, if price goes up by 10 pips.
4. Place an order: Send a request to buy or sell when your condition is met.
Since you’re familiar with programming, you might want to explore their SDKs or sample code snippets which often help clarify the syntax. For example, in Python, connecting and placing an order might look like:
```python
import fxcmpy
Connect to FXCM
con = fxcmpy.fxcmpy(access_token='YOUR_ACCESS_TOKEN', log_level='error')
Get current price
price = con.get_last_price('EUR/USD')
Check if price has increased by 10 pips
if (price['Bid'] - entry_price) >= 0.0010:
con.open_trade(symbol='EUR/USD', is_buy=True, amount=10)
Remember to close connection when done
con.close()
```
Of course, you'll need to handle authentication, error checking, and account management, but this gives you a rough idea.
For other providers, like Interactive Brokers or OANDA, the process is similar—look for their API documentation on account connection, and find sample code or SDKs.
Lastly, community forums, GitHub repositories, and developer groups can be a treasure trove of practical snippets and advice. Sometimes, even contacting the support teams of these brokers can point you to more developer-friendly resources.
Hope this helps you get started! Feel free to ask if you want more specific code examples or guidance on particular platforms.
Good luck on your trading automation journey!