Backtrader Community

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

    Gil Keren

    @Gil Keren

    0
    Reputation
    286
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Gil Keren Unfollow Follow

    Latest posts made by Gil Keren

    • RE: csv with custom columns

      Thanks!

      I tend to change my csv format quite often, so is there a way to automatically detect all the extra columns in the csv and add them as lines?
      Accessing 'self.lines' in the derived class' init method does not seem to be the way to do it.

      Thanks!

      posted in General Code/Help
      G
      Gil Keren
    • csv with custom columns

      Hello,

      I have a csv with additional custom columns, other than the usual open, low, high, close, volume, openinterest. I would like to load this csv as a data feed, such that I have the additional columns as additional lines that I can use in the 'next()' function.

      Is there a way to do that? I failed to do so using the 'GenericCSVData' class.

      Thanks!

      posted in General Code/Help
      G
      Gil Keren
    • RE: Setting a commision changes buy size to be in monetary units?

      Works like a charm, thanks for the detailed answer!

      posted in Indicators/Strategies/Analyzers
      G
      Gil Keren
    • RE: Setting a commision changes buy size to be in monetary units?

      Thanks.
      I read the link you attached for the documentation.
      Note that the size parameter in buy() is interpreted as face value even I set a percentage commission:

      cerebro.broker.setcommission(commission=0.005, commtype=bt.comminfo.CommInfoBase.COMM_PERC)
      self.buy(data=self.data0, size=1)

      Then in notify_order:
      order.executed.price
      1.8768
      order.executed.comm
      0.009384 # This is 0.5% of 1.8768, makes sense so far
      cerebro.broker.getvalue(self.datas)
      1.0 # size parameter in buy() was interpreted as face value, not as amount of shares t buy.

      But my question is the following:
      How do I set the commission to be in in fixed monetary units, but still have the 'size' parameter in 'buy()' interpreted as the amount of shares to buy?

      posted in Indicators/Strategies/Analyzers
      G
      Gil Keren
    • Setting a commision changes buy size to be in monetary units?

      Hi,

      When I use:
      cerebro.broker.setcommission(commission=0.005)

      and place a buy order:
      self.buy(data=self.data0, size=1)

      I see in 'notify_order' when the order status is order.completed:
      order.executed.price = 1.8768
      cerebro.broker.getvalue(self.datas) = 1.9732
      self.data0[0] = 1.9732

      which indicates that 1 unit of the stock was bought.
      However, when I set
      cerebro.broker.setcommission(commission=0.005, commtype=bt.comminfo.CommInfoBase.COMM_FIXED)
      and use the same buy order I get when the order is completed

      order.executed.price = 1.8768
      cerebro.broker.getvalue(self.datas) = 1.0
      self.data0[0] = 1.9732

      which indicates that the order was places to buy as many units as possible for 1 monetary unit.

      Is this a bug or a feature?
      How can I set a fixed commision in monetary units and still place buy orders where the size parameter indicates units of the stock to buy?

      Thanks!

      posted in Indicators/Strategies/Analyzers
      G
      Gil Keren
    • RE: Text color in documentation

      Thanks!

      I managed to overcome this with the chrome extension "High Contrast":
      https://chrome.google.com/webstore/detail/high-contrast/djcfdncoelnlbldjfhinnjlhdjlikmph/related?utm_source=chrome-ntp-icon

      posted in General Discussion
      G
      Gil Keren
    • RE: Text color in documentation

      In my firefox it looks the same as in my chrome. Weird!

      posted in General Discussion
      G
      Gil Keren
    • Text color in documentation

      Hi,

      Platform is really awesome, just one problem:
      The online docs looks like that:

      0_1506551844592_Screenshot from 2017-09-28 00:37:01.png

      With my chrome and Ubuntu 14.04. It's very hard to read with these colors. Is this normal? Any hack to overcome this?

      Thanks!

      posted in General Discussion
      G
      Gil Keren