[Message] - Backtrader for FX trading
-
As a finance student and growing Python programmer I was looking for a Python library that allow me to backtest my trading strategies and possibly to place my orders in real time. The thing I noted though is that most libraries/platform that make use of Python are focused on equities and US equities in particular. Since I trade on the Forex market mainly, I want to ask you whether or not it is possible to do algorithmic trading or even simple backtesting on currencies as well as on other financial instruments by using your library. I haven't found answer to my question on the docs and this is why I'm asking you directly
-
There are no restrictions as to what you can test with backtrader. And the conditions and requirements of (almost?) any financial instrument can be simulated.
- Account Leverage
- Asset margin requirements
- Asset multiplier
- Nominal value
- Shorting with interest
- Others
In most cases choosing a predefined commission scheme and configuring it is enough:
- Docs - Commissions: Stocks vs Futures
- Docs - Extending Commissions
- Docs - User Defined Commissions
- Docs - Commissions: Credit
What backtrader for sure isn't is a data provider. You say
The thing I noted though is that most libraries/platform that make use of Python are focused on equities and US equities in particular
You may be talking about things like Quantopian (which now offers not only US equities but Futures) in which the online platform automatically provides you with data for US Equities.
In backtrader you need to provide the data yourself. There are many ways os instantiating a data source, including online sources, or you can provide yours. See