Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    [Message] - Backtrader for FX trading

    General Discussion
    1
    2
    2126
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      backtrader administrators last edited by

      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

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        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

        • Docs - Data Feeds Reference
        • Docs - CSV Data Feed Development
        • Docs - Binary Datafeed Development
        • Docs - Extending a Datafeed
        • Docs - Pandas DataFeed Example
        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors