Package Search Help

You can use boolean logic (e.g. AND/OR/NOT) for complex search queries. For more help and examples, see the search documentation.

Search by package name:
my-package (implicit)
name:my-package (explicit)

Search by package filename:
filename:my-package.ext 

Search by package tag:
tag:latest 

Search by package version:
version:1.0.0  prerelease:true (prereleases)
prerelease:false (no prereleases)

Search by package architecture:
architecture:x86_64 

Search by package distribution:
distribution:el 

Search by package license:
license:MIT 

Search by package format:
format:deb 

Search by package status:
status:in_progress 

Search by package file checksum:
checksum:5afba 

Search by package security status:
severity:critical 

Search by package vulnerabilities:
vulnerabilities:>1 
vulnerabilities:<1000 

Search by # of package downloads:
downloads:>8 
downloads:<100 

Search by package type:
type:binary 
type:source 

Search by package size (bytes):
size:>50000 
size:<10000 

Search by dependency name/version:
dependency:log4j 
dependency:log4j=1.0.0 
dependency:log4j>1.0.0 

Search by uploaded date:
uploaded:>"1 day ago" 
uploaded:<"August 14, 2022 EST" 

Search by entitlement token (identifier):
entitlement:3lKPVJPosCsY 

Search by policy violation:
policy_violated:true
deny_policy_violated:true
license_policy_violated:true
vulnerability_policy_violated:true

Search by repository:
repository:repo-name

Search by last download date:
last_downloaded:<"30 days ago" 
last_downloaded:>"August 14, 2022 EST" 

Search queries for all Debian-specific (and related) package types

Search by component:
deb_component:unstable

Search queries for all Maven-specific (and related) package types

Search by group ID:
maven_group_id:org.apache

Search queries for all Docker-specific (and related) package types

Search by image digest:
docker_image_digest:sha256:7c5..6d4
(full hashref only)

Search by layer digest:
docker_layer_digest:sha256:4c4..ae4
(full hashref only)

Search queries for all Generic-specific package types

Search by file path:
generic_filepath:path/to/file.txt

Search by directory:
generic_directory:path/to

Field type modifiers (depending on the type, you can influence behaviour)

For all queries, you can use:
~foo for negation

For string queries, you can use:
^foo to anchor to start of term
foo$ to anchor to end of term
foo*bar for fuzzy matching

For number/date or version queries, you can use:
>foo for values greater than
>=foo for values greater / equal
<foo for values less than
<=foo for values less / equal

Need a secure and centralised artifact repository to deliver Alpine, Cargo, CocoaPods, Composer, Conan, Conda, CRAN, Dart, Debian, Docker, Generic, Go, Helm, Hex, HuggingFace, LuaRocks, Maven, npm, NuGet, P2, Python, RedHat, Ruby, Swift, Terraform, Vagrant, VSX, Raw & More packages?

Cloudsmith is the new standard in Package / Artifact Management and Software Distribution.

With support for all major package formats, you can trust us to manage your software supply chain.

Start My Free Trial

Python logo bybit-backtest  0.1.4

One-liner (summary)

bybit-backtest is a python library for backtest with bybit fx trade on Python 3.6 and above.

Description

# bybit-backtest

[![PyPI](https://img.shields.io/pypi/v/bybit-backtest)](https://pypi.org/project/bybit-backtest/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![codecov](https://codecov.io/gh/10mohi6/bybit-backtest-python/branch/main/graph/badge.svg?token=ZFgiyy2cc2)](undefined) [![Build Status](https://travis-ci.com/10mohi6/bybit-backtest-python.svg?branch=main)](https://travis-ci.com/10mohi6/bybit-backtest-python) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/bybit-backtest)](https://pypi.org/project/bybit-backtest/) [![Downloads](https://pepy.tech/badge/bybit-backtest)](https://pepy.tech/project/bybit-backtest)

bybit-backtest is a python library for backtest with bybit fx trade on Python 3.6 and above.

backtest data from [here](https://public.bybit.com/trading/)

## Installation

$ pip install bybit-backtest

## Usage

### basic run ```python from bybit_backtest import Backtest

class MyBacktest(Backtest):
def strategy(self):

fast_ma = self.sma(period=5) slow_ma = self.sma(period=25) # golden cross self.sell_exit = self.buy_entry = (fast_ma > slow_ma) & (

fast_ma.shift() <= slow_ma.shift()

) # dead cross self.buy_exit = self.sell_entry = (fast_ma < slow_ma) & (

fast_ma.shift() >= slow_ma.shift()

)

MyBacktest().run() ```

### advanced run ```python from bybit_backtest import Backtest

class MyBacktest(Backtest):
def strategy(self):
rsi = self.rsi(period=10) ema = self.ema(period=20) lower = ema - (ema * 0.001) upper = ema + (ema * 0.001) self.buy_entry = (rsi < 30) & (self.df.C < lower) self.sell_entry = (rsi > 70) & (self.df.C > upper) self.sell_exit = ema > self.df.C self.buy_exit = ema < self.df.C self.qty = 0.1 # order quantity (default=0.001) self.stop_loss = 50 # stop loss (default=0 stop loss none) self.take_profit = 100 # take profit (default=0 take profit none)
MyBacktest(
symbol="BTCUSD", # default=BTCUSD sqlite_file_name="backtest.sqlite3", # (default=backtest.sqlite3) from_date="2020-04-01", # (default="") to_date="2020-10-25", # (default="") interval="1T", # 5-60S(second), 1-60T(minute), 1-24H(hour) (default=1T) download_data_dir="data", # download data directory (default=data)

).run("backtest.png") ` ```python total profit          491.800 total trades        10309.000 win rate               65.700 profit factor           1.047 maximum drawdown      135.500 recovery factor         3.630 riskreward ratio        0.551 sharpe ratio            0.020 average return          0.001 stop loss            1779.000 take profit            93.000 ` ![backtest.png](https://raw.githubusercontent.com/10mohi6/bybit-backtest-python/main/tests/backtest.png)

## Supported indicators - Simple Moving Average 'sma' - Exponential Moving Average 'ema' - Moving Average Convergence Divergence 'macd' - Relative Strenght Index 'rsi' - Bollinger Bands 'bbands' - Stochastic Oscillator 'stoch'

## Getting started For help getting started with Bybit APIs and Websocket, view our online [documentation](https://bybit-exchange.github.io/docs/inverse/#t-introduction).

Size

6.8 KB

Downloads

4

Status  Completed
Checksum (MD5) 46b26bc91ac6479ca008d460a3f0e115
Checksum (SHA-1) 443fa8cc7c753d00eb0cc3a399954bf637a799f6
Checksum (SHA-256) 27c0b247e970a3251dd4b343da1abf8213a55463fc74eeb87c9167c6d304011d
Checksum (SHA-512) 0e14637dbb91dbaa71b212fc42483a24091be33437d1d6e9f11cc096e2da32e2df…
GPG Signature
GPG Fingerprint 6811684bac0b8895434e97bdd4391b8fb999e537
Storage Region  Dublin, Ireland
Type  Binary (contains binaries and binary artifacts)
Uploaded At 4 months, 3 weeks ago
Uploaded By Fetched by Cloudsmith
Slug Id bybit_backtest-014-py3-none-anywhl-pp66
Unique Id 59mg3BQebI3DfWjQ
Version (Raw) 0.1.4
Version (Parsed)
  • Major: 0
  • Minor: 1
  • Patch: 4
  • Type: SemVer (Compat)
  extended metadata
Author 10mohi6 <10.mohi.6.y@gmail.com>
Classifiers Development Status :: 4 - Beta | Intended Audience :: Developers | Intended Audience :: Financial and Insurance Industry | License :: OSI Approved :: MIT License | Operating System :: OS Independent | Programming Language :: Python | Programming Language :: Python :: 3 | Programming Language :: Python :: 3.6 | Programming Language :: Python :: 3.7 | Programming Language :: Python :: 3.8 | Programming Language :: Python :: 3.9 | Topic :: Office/Business :: Financial :: Investment
Homepage URL https://github.com/10mohi6/bybit-backtest-python
Keywords bybit trade python backtest fx usdt usd btc
Metadata Version 2.1
Py Filetype bdist_wheel
Py Version py3
Requires Dist SQLAlchemy | beautifulsoup4 | lxml | matplotlib | numpy | pandas | requests
Requires Python >=3.6.0
pkg bybit_backtest-0.1.4-py3-none-a… 4
6.8 KB
md5 sha1 sha256 sha512
Package Contents (bybit_backtest-0.1.4-py3-none-any.whl)
Loading...

This package has 10 files/directories.

Last scanned

4 months, 3 weeks ago

Scan result

Clean

Vulnerability count

0

Max. severity

Unknown

You can embed a badge in another website that shows this or the latest version of this package.

To embed the badge for this specific package version, use the following:

[![This version of 'bybit-backtest' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/)
|This version of 'bybit-backtest' @ Cloudsmith|
.. |This version of 'bybit-backtest' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/",title="This version of 'bybit-backtest' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/0.1.4/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true" alt="This version of 'bybit-backtest' @ Cloudsmith" /></a>

rendered as: This version of 'bybit-backtest' @ Cloudsmith

To embed the badge for the latest package version, use the following:

[![Latest version of 'bybit-backtest' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true&show_latest=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/)
|Latest version of 'bybit-backtest' @ Cloudsmith|
.. |Latest version of 'bybit-backtest' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true&show_latest=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true&show_latest=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/",title="Latest version of 'bybit-backtest' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bybit-backtest/latest/a=noarch;xf=bdist_wheel;xn=bybit-backtest;xv=py3/?render=true&show_latest=true" alt="Latest version of 'bybit-backtest' @ Cloudsmith" /></a>

rendered as: Latest version of 'bybit-backtest' @ Cloudsmith

These instructions assume you have setup the repository first (or read it).

To install/use bybit-backtest @ version 0.1.4 ...

pip install 'bybit-backtest==0.1.4'

You can also install the latest version of this package:

pip install --upgrade 'bybit-backtest'

If necessary, you can specify the repository directly:

pip install \
  --index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/ \
  bybit-backtest==0.1.4

If you've got a project requirements.txt file, you can specify this as a dependency:

--index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
bybit-backtest==0.1.4

In addition, you can use this repository as an extra index url. However, please read our documentation on this parameter before using it. For example in a requirements.txt file:

--extra-index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
bybit-backtest==0.1.4
Warning: We highly recommend using pip (or similar) rather than installing directly.
Top