Navigation

    Backtrader Community

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

    Posts made by bebe

    • RE: I use dash and plotly ,plot the backtest result in one page

      @run-out can you share the code that can runing successful.

      posted in General Discussion
      B
      bebe
    • RE: I use dash and plotly ,plot the backtest result in one page

      thanks for your demo code.
      but when i debug the demo, I found the following code is not defined:
      plot_results(results,"/home/yun/index_000300_reverse_strategy_hold_day_90.html")
      trade_dict_1=OrderedDict()

      could you pls give the define.
      thanks.

      posted in General Discussion
      B
      bebe
    • RE: the SharpeRatio is not correct.

      thanks. i will try ...

      posted in Indicators/Strategies/Analyzers
      B
      bebe
    • the SharpeRatio is not correct.

      the SharpeRadio is not correct,how to fix it ?thanks
      out put is:
      test: OrderedDict([('sharperatio', None)])

          cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name = 'SharpeRatio')
          results=cerebro.run()
          strat =results[0]
          print('test:', strat.analyzers.SharpeRatio.get_analysis())
      
        
      
      posted in Indicators/Strategies/Analyzers
      B
      bebe
    • RE: how to test multi data

      @run-out thanks.

      posted in General Discussion
      B
      bebe
    • RE: how to test multi data
      code_text
      if __name__ == '__main__':
          cerebro.adddata(data1)
          cerebro.adddata(data2)
          cerebro.adddata(data3)
      
      def init(self):
          self.sma = bt.indicators.SimpleMovingAverage( self.datas, 30)
      def next(self):
          if self.dataclose > self.sma:
              self.buy()
      
      posted in General Discussion
      B
      bebe
    • how to test multi data

      dear all:
      I am a fresher.
      I want to test multi stock use same strategy.
      how to write the test function?
      the following is framework... anybody can share some code ?thanks.

      main:#add multi data
      cerebro.adddata(data1)
      cerebro.adddata(data2)
      cerebro.adddata(data3)

      def init(self):
      self.sma = bt.indicators.SimpleMovingAverage( self.datas, 30)
      def next(self):
      if self.dataclose > self.sma:
      self.buy()

      posted in General Discussion
      B
      bebe
    • 1 / 1