Backtrader Community

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

    sobeasy

    @sobeasy

    4
    Reputation
    38
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    sobeasy Unfollow Follow

    Best posts made by sobeasy

    • RE: cerebro.plot() does not work with Anaconda / IPython

      having the same problems here, and no kidding, it was killing me.
      I spent hours and hours to figure the solution and even pycharm can't help. ( Don't know why )
      I tried subclass the "backtrader.plot.Plot" but still not working.

      If you really want to use spyder, here is the trick :

      import backtrader.plot
      import matplotlib
      matplotlib.use('QT5Agg')
      
      # Your running code
      
      cerebro.plot(iplot= False)
      

      Remember to select your Graphic backend to "Qt5" in spyder.
      You should see the windows pop out (It can even be maximizing ! how great...)

      I am using win10 , Anaconda , Spyder 3.3.2 , Py 3.7.1, Ipyhon 7.2.0

      (User from Hong Kong. Thanks for the platform, it's really great.)

      posted in General Code/Help
      sobeasy
      sobeasy
    • RE: Plot doesn't show up when running the code

      I use Spyder and here is my solution (Some hack).

      1. Change the spyder setting : "Preferences" -> "IPython console" -> "Graphics" tab -> "Graphics backend" -> "Backend" -> "Automatic"
      2. Restart the current Console (The one inside spyder)
      3. Import below in sequence
      import matplotlib
      import matplotlib.pyplot as plt
      
      import backtrader as bt
      import backtrader.indicators as btind
      import backtrader.analyzers as btanalyzers
      import backtrader.feeds as btfeeds
      import backtrader.strategies as btstrats
      import backtrader.plot
      
      matplotlib.use('Qt5Agg')
      plt.switch_backend('Qt5Agg')
      
      1. Plot with iplot = false
      cerebro.plot(height= 30, iplot= False)
      
      1. Run your code and you should see a separate windows pop up
      posted in General Code/Help
      sobeasy
      sobeasy

    Latest posts made by sobeasy

    • RE: Plot doesn't show up when running the code

      I use Spyder and here is my solution (Some hack).

      1. Change the spyder setting : "Preferences" -> "IPython console" -> "Graphics" tab -> "Graphics backend" -> "Backend" -> "Automatic"
      2. Restart the current Console (The one inside spyder)
      3. Import below in sequence
      import matplotlib
      import matplotlib.pyplot as plt
      
      import backtrader as bt
      import backtrader.indicators as btind
      import backtrader.analyzers as btanalyzers
      import backtrader.feeds as btfeeds
      import backtrader.strategies as btstrats
      import backtrader.plot
      
      matplotlib.use('Qt5Agg')
      plt.switch_backend('Qt5Agg')
      
      1. Plot with iplot = false
      cerebro.plot(height= 30, iplot= False)
      
      1. Run your code and you should see a separate windows pop up
      posted in General Code/Help
      sobeasy
      sobeasy
    • RE: Intraday strategy with reference to daily Moving Average

      @backtrader thanks for the prompt reply!
      I will work on it later.

      posted in Indicators/Strategies/Analyzers
      sobeasy
      sobeasy
    • Intraday strategy with reference to daily Moving Average

      It is very common to reference the 200-days moving average during trade,
      I am trying to implement an intraday strategy, which will taking account the 200-days moving average.

      However, I can't figure out how to load 200-days bar while I loaded 1-min data into backtrader

      Also, I just wonder how can we start live trade in day-by-day manner, that the strategy can reference 200-days MA immediately in the start of trade?

      Any ideas ? so much thanks.

      posted in Indicators/Strategies/Analyzers
      sobeasy
      sobeasy
    • RE: cerebro.plot() does not work with Anaconda / IPython

      having the same problems here, and no kidding, it was killing me.
      I spent hours and hours to figure the solution and even pycharm can't help. ( Don't know why )
      I tried subclass the "backtrader.plot.Plot" but still not working.

      If you really want to use spyder, here is the trick :

      import backtrader.plot
      import matplotlib
      matplotlib.use('QT5Agg')
      
      # Your running code
      
      cerebro.plot(iplot= False)
      

      Remember to select your Graphic backend to "Qt5" in spyder.
      You should see the windows pop out (It can even be maximizing ! how great...)

      I am using win10 , Anaconda , Spyder 3.3.2 , Py 3.7.1, Ipyhon 7.2.0

      (User from Hong Kong. Thanks for the platform, it's really great.)

      posted in General Code/Help
      sobeasy
      sobeasy