Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need help using backtesting #131

Closed
hussanirizvi2 opened this issue Aug 25, 2020 · 1 comment
Closed

need help using backtesting #131

hussanirizvi2 opened this issue Aug 25, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists invalid This is not a (valid) bug report

Comments

@hussanirizvi2
Copy link

Expected Behavior

run the test code on the site

Actual Behavior

C:\Users\hrizvi\AppData\Local\Continuum\anaconda3\envs\python36\lib\site-packages\backtesting_plotting.py:44: UserWarning: Jupyter Notebook detected. Setting Bokeh output to notebook. This may not work in Jupyter clients without JavaScript support (e.g. PyCharm, Spyder IDE). Reset with backtesting.set_bokeh_output(notebook=False).
warnings.warn('Jupyter Notebook detected. '

Steps to Reproduce

run program on spyder

from backtesting import Backtest, Strategy
from backtesting.lib import crossover

from backtesting.test import SMA, GOOG

class SmaCross(Strategy):
def init(self):
price = self.data.Close
self.ma1 = self.I(SMA, price, 10)
self.ma2 = self.I(SMA, price, 20)

def next(self):
    if crossover(self.ma1, self.ma2):
        self.buy()
    elif crossover(self.ma2, self.ma1):
        self.sell()

bt = Backtest(GOOG, SmaCross, commission=.002,
exclusive_orders=True)
stats = bt.run()
bt.plot()

Additional info

  • Backtesting version:
@kernc
Copy link
Owner

kernc commented Aug 26, 2020

Continued in #132.

@kernc kernc added duplicate This issue or pull request already exists invalid This is not a (valid) bug report labels Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists invalid This is not a (valid) bug report
Projects
None yet
Development

No branches or pull requests

2 participants