Package: quantdom
Quantdom is a simple but powerful backtesting framework written in python, that strives to let you focus on modeling financial strategies, portfolio management, and analyzing backtests. It has been created as a useful and flexible tool to save the systematic trading community from re-inventing the wheel and let them evaluate their trading ideas easier with minimal effort. It’s designed for people who are already comfortable withPythonand who want to create, test and explore their own trading strategies.Quantdom is in an early alpha state at the moment. So please be patient with possible errors and report them.FeaturesFree, open-source and cross-platform backtesting frameworkMultiple data feeds: csv files and online sources such as Google Finance, Yahoo Finance, Quandl and moreInvestment Analysis (performance and risk analysis of financial portfolio)Charting and reporting that help visualize backtest resultsRequirementsPython3.6or higherPyQt5PyQtGraphNumPySeepyproject.tomlfor full details.InstallationUsing the binariesYou can download binary packages for your system (see theGithub Releasespage for available downloads):ForWindowsForMacOSForLinuxRunning from source codeYou can install laststable releasefrom pypi:$pipinstallquantdomAnd latestdevelopment versioncan be installed directly from GitHub:$pipinstall-Ugit+https://github.com/constverum/Quantdom.gitAfter that, to run the application just execute one command:$quantdomUsageRun Quantdom.Choose a market instrument (symbol) for backtesting on theDatatab.Specify a file with your strategies on theQuotestab, and select one of them.Run a backtest. Once this is done, you can analyze the results and optimize parameters of the strategy.Strategy ExamplesThree-bar strategyA simple trading strategy based on the assumption that after three consecutive bullish bars (bar closing occurred higher than its opening) bulls predominate in the market and therefore the price will continue to grow; after 3 consecutive bearish bars (the bar closes lower than its opening), the price will continue to down, since bears predominate in the market.fromquantdomimportAbstractStrategy,Order,PortfolioclassThreeBarStrategy(AbstractStrategy):definit(self,high_bars=3,low_bars=3):Portfolio.initial_balance=100000# default valueself.seq_low_bars=0self.seq_high_bars=0self.signal=Noneself.last_position=Noneself.volume=100# sharesself.high_bars=high_barsself.low_bars=low_barsdefhandle(self,quote):ifself.signal:props={'symbol':self.symbol,# current selected symbol'otype':self.signal,'price':quote.open,'volume':self.volume,'time':quote.time,}ifnotself.last_position:self.last_position=Order.open(**props)elifself.last_position.type!=self.signal:Order.close(self.last_position,price=quote.open,time=quote.time)self.last_position=Order.open(**props)self.signal=Falseself.seq_high_bars=self.seq_low_bars=0ifquote.close>quote.open:self.seq_high_bars+=1self.seq_low_bars=0else:self.seq_high_bars=0self.seq_low_bars+=1ifself.seq_high_bars==self.high_bars:self.signal=Order.BUYelifself.seq_low_bars==self.low_bars:self.signal=Order.SELLDocumentationIn progress ;)TODOAdd integration withTA-LibAdd the ability to use TensorFlow/CatBoost/Scikit-Learn and other ML tools to create incredible algorithms and strategies. Just as one of the first tasks is Elliott Wave Theory(Principle) - to recognize of current wave and on the basis of this predict price movement at confidence intervalsAdd the ability to make a sentiment analysis from different sources (news, tweets, etc)Add ability to create custom screens, ranking functions, reportsContributingFork it:https://github.com/constverum/Quantdom/forkCreate your feature branch: git checkout -b my-new-featureCommit your changes: git commit -am ‘Add some feature’Push to the branch: git push origin my-new-featureSubmit a pull request!DisclaimerThis software should not be used as a financial advisor, it is for educational use only.
Absolutely no warranty is implied with this product. By using this software you release the author(s) from any liability regarding the use of this software. You can lose money because this program probably has some errors in it, so use it at your own risk. And please don’t take risks with money you can’t afford to lose.FeedbackI’m very interested in your experience with Quantdom.
Please feel free to send me any feedback, ideas, enhancement requests or anything else.LicenseLicensed under the Apache License, Version 2.0