Backtrader Community

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

    Topics created by KT

    • K

      Broker with different multiplier for different dataset
      General Discussion • • KT

      3
      0
      Votes
      3
      Posts
      937
      Views

      P

      @KT said in Broker with different multiplier for different dataset:

      I would like to check how to set broker with unique multiplier for each datasets.

      Use different CommissionInfo customized (with the desired multiplier and settings) instances for each asset.

    • K

      Commission
      Indicators/Strategies/Analyzers • • KT

      4
      0
      Votes
      4
      Posts
      1158
      Views

      B

      It's in the docs, hence the link. The commissions have no names.

      Read the reference for setcommission and addcommissioninfo

    • K

      Closing All Orders
      General Discussion • • KT

      2
      0
      Votes
      2
      Posts
      1708
      Views

      B

      See Docs - Strategy for the close method

      There aren't multiple ways.

    • K

      Order Validity
      General Discussion • • KT

      3
      0
      Votes
      3
      Posts
      1199
      Views

      B

      @fivo said in Order Validity:

      If you want to make it dependent on your data, pass timeframe_in_m to your strategy.

      Data feeds have a parameter named timeframe which carries the original value when the data feed was created. Using it (rather than an extra parameter) together with the chosen compression, you can get it ...

      auto_timer = dict( bt.TimeFrame.Seconds=lambda x: datetime.timedelta(seconds=x), bt.TimeFrame.Minutes=lambda x: datetime.timedelta(minutes=x), bt.TimeFrame.Days=lambda x: datetime.timedelta(days=x), ) nextbar = self.data.num2date() + auto_timer[self.data.p.timeframe](self.data.p.compression)

      Notice self.data.num2date() which

      If no numeric value is given uses the current value from the datetime line (i.e.: self.lines.datetime[0])
    • K

      Order
      General Discussion • • KT

      9
      0
      Votes
      9
      Posts
      4450
      Views

      K

      @Curtis-Miller Thanks!! I will check the PyFolio

    • K

      Feeding Multiple Data Feeds in Indicators
      General Discussion • • KT

      20
      0
      Votes
      20
      Posts
      8433
      Views

      S

      @backtrader Here is the link to the new post: link text

    • K

      Modify Order
      General Discussion • • KT

      3
      1
      Votes
      3
      Posts
      1524
      Views

      H

      @backtrader said in Modify Order:

      It's not available. Cancel it and resend it (this is actually what happens in real life)

      Wouldn't that depend on the exchange and broker? I am not very sure about how it works at the exchange level, but at the broker level, my broker sends me an itemized bill at the end of the day, and when I modify an order, it doesn't show multiple items in the bill.

      Further, at a programmatic level, it would be convenient to have a modify API even if it just recreates the order under the hood.

    • K

      Strategy with Signals
      Indicators/Strategies/Analyzers • • KT

      3
      0
      Votes
      3
      Posts
      3134
      Views

      K

      Thanks @backtrader

    • K

      Plot Indicator on Master Data
      Indicators/Strategies/Analyzers • • KT

      3
      0
      Votes
      3
      Posts
      1756
      Views

      K

      Thanks @backtrader

    • K

      Cancel Order
      General Code/Help • • KT

      11
      0
      Votes
      11
      Posts
      7151
      Views

      B

      @suresh_trader said in Cancel Order:

      How to cancel all the pending stop and limit order by end of the day which is not executed due to the market price not reaching the order price level

      By keeping the references when created or notified as "Accepted" and then canceling them if the system has not notified completion or cancellation.

    • K

      Hourly Data
      General Discussion • • KT

      3
      0
      Votes
      3
      Posts
      3292
      Views

      K

      Thanks @backtrader !!

    • K

      Buying and Selling with Signals
      Indicators/Strategies/Analyzers • • KT

      7
      0
      Votes
      7
      Posts
      3321
      Views

      B

      There is no such thing as a sample implementation.

      You send an order to the market: self.buy(price=myprice, exectype=bt.Order.MyPreferredExecutionType) The order is completed and notified to notify_order(order) order.executed.price contains the actual execution price A new order is sent to act as a stop-loss order: self.sell(price=% of order.executed.price, exectype=probably Stop)
    • K

      Order Execution Price
      General Discussion • • KT

      4
      0
      Votes
      4
      Posts
      1400
      Views

      K

      Thanks @backtrader and @ab_trader for the suggestion.

    • K

      Donchian Channel
      Indicators/Strategies/Analyzers • • KT

      13
      0
      Votes
      13
      Posts
      4459
      Views

      Ariel Iván Ruiz Mateos

      Hi @KT ! Could you paste the full source code with all the modifications?

      thanks a lot! and good work!

    • 1 / 1