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/

    CommInfoBase getcommision Advice

    General Code/Help
    1
    1
    86
    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.
    • H
      harperx last edited by

      Hi,

      Is it possible from within CommInfoBase's getcommission method to determine the timestamp/prices of the trade that commission request is being applied to? Or would I need to that externally, e.g maybe I could assume that getcommission is always called after next() if I log the timestamp there? I don't know if that call flow is always like that though which might break that approach?

      For some context, I'm attempting to use this approach to account for the BID/ASK spread for Forex which I understand Backtrader isn't really designed for. My plan is to use the commission request to lookup the Spread for the given trade point from another Pandas dataframe, then merge that spread into the commission. I think this should work ok, it just needs the Time and OHLC that getcommission is being applied to?

      Thanks for any help.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors