Skip to main content

What is Noba

Noba means not only backtrader :)

You can visit noba documentation for more information: EN(coming soon) | 中文

The core of Noba is an ioc container, through which you can create BB service, which based on Backtrader(one quantitative backtest system) and Bokeh (use bokeh as the backend, Backtrader can get richer plot effects) * BB service would like to thank backtrader_plotting and btplotting for providing the main code for using bokeh as the backend for the backtrader

from noba import core
bt =  core.make('bb')

Of course, you can also create your own services based container. Combined with Pipeline System and Event System (which can be created directly through containers), noba can enable your quantitative projects to work in a more engineering methods

from noba import core
pipline =  core.make('pipeline')
cleaned_data = pipline.via("handle").send(raw_data).through([ChangeDataType, RepeatRowData, ExceptionData, MissingData]).then(lambda raw_data:raw_data)
from noba import core
event = core.make('event')
db_event = event.hub(['read_database_complete'])
db_event.watch('read_database_complete', lambda data:..., always=True)
...
db_event.fire('read_database_complete')

More importantly, Noba can create database service objects (dber) through containers. This is a Database Abstraction Layer. Through configuration files(one json file) and unified one set of APIs, you can operate the most common databases

from noba import core
dber =  core.make('db')
stocks = db.table('daily').where('Open==3578.73').or_where('High==3652.46').set_index('Date').get_except('OpenInterest')

Getting Started

  • Python >= 3.6 is required.
  • Suggest using conda to manage virtual environments

Installation

pip install noba
# or
pip install git+https://github.com/iniself/noba

Init noba project

mkdir your_noba_project
cd your_noba_project
noba init

Preparation

Here you can do some project configuration and write your own service provider, and so on. Please refer to the NOBA documentation for details

Write strategy

vim main.py

Only give Live Mode example, about Normal Mode and Optstrategy Mode pls refer to NOBA documentation

  • Add to cerebro as an analyzer (Live Mode):

    from noba import core
      ...
      ...
    bt = core.make('bb')
    cerebro = bt.Cerebro()
    cerebro.addstrategy(MyStrategy)
    cerebro.adddata(LiveDataStream()) # Note! Data is must Live Data
    cerebro.addanalyzer(bt.analyzers.Live, force_plot_legend=True, autostart=True)
    cerebro.run()
    # cerebro.plot() # do not run this line unless your data is not real-time
    
  • If you need to change the default port or share the plotting to public:

    cerebro.addanalyzer(bt.analyzers.Live, address="localhost", port=8889)
    
  • Note! In Jupyter you can plut to a single browser tab with iplot=False:

    cerebro.plot(plot, iplot=False)
    

Demos

https://iniself.github.io/noba/

Contact us

Telegram Channel: Aui_Say Discord Server: Aui and Friends

Sponsoring

If you want to support the development of noba, consider to support this project.

  • ETH: 0x0275779f70179748C6fCe1Fe5D7638DfA7e3F986

Metadata

Release files for noba 1.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for noba 1.1.7
File Size Uploaded
noba-1.1.7.tar.gz 434.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for noba 1.1.7
File Interpreter ABI Platform
noba-1.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 948.0 kB

Release files / noba-1.1.7.tar.gz

Download URL noba-1.1.7.tar.gz
Size 434.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4e4d5d5339b8f93133a8f76dc6108b443a63f4bed0502296b11f0f2f43bda9f3
BLAKE2b-256 checksum
How to use checksums
bb45171bdfaa1fae3cf40b4038884f4551d5c3aaef8ad05732b3b735f2413cab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release files / noba-1.1.7-py3-none-any.whl

Download URL noba-1.1.7-py3-none-any.whl
Size 513.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e8a469d6c6bc43a683029be149244d79c88ee63ed6e56abedf27c15aeba360c
BLAKE2b-256 checksum
How to use checksums
0aff16f5431ea67525728c0a94871da0f825305a9796ccc1f439fd1125c8f658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release history Release notifications | RSS feed

This release

1.1.7 This release

2 release files

1.1.6

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page