Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. swibby
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Groups 0

    swibby

    @swibby

    0
    Reputation
    174
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    swibby Unfollow Follow

    Latest posts made by swibby

    • RE: OANDA Data - Generating OHLC candles that incorporate bid/ask

      Thanks, I'll take a shot at extending the datafeed

      posted in General Code/Help
      S
      swibby
    • OANDA Data - Generating OHLC candles that incorporate bid/ask

      Hello

      I'm interested in developing a strategy that is correctly penalized by the spread as that is how OANDA incorporates its commission. Of course the spread is dynamic so making a static assumption about the spread size isn't particularly accurate.

      OANDA does allow you to request bid & ask data when making a history request and provides the data in OHLC format (e.g. for the close you get both a bid and ask price). However, as far as I can tell backtrader uses either the bid or the ask price in the data set meaning the one not used gets dropped and for testing purposes the spread is effectively lost.

      Is there anyway to construct the OHLC candles incorporating both the bid and the ask price as separate values?

      It appears I might be able to work around this by replacing the hierarchy as outlined in the escape from ohlc land post but that has the downside of losing access to some of the pre-built indicators.

      I'm new to backtrader and am guessing I could rebuild any indicators I might need, but I figured I'd ask if there's native functionality so I can avoid that extra effort.

      posted in General Code/Help
      S
      swibby