Skip to main content

Volume breakout scanner built on top of the Nubra Python SDK.

Project description

nubra-volume-breakout

nubra-volume-breakout is a small Python library for running a volume breakout scan using the Nubra Python SDK.

It fetches historical OHLCV data through MarketData.historical_data(...), derives candle volume safely for intraday intervals, calculates average lookback volume, computes volume_ratio = current_volume / average_volume, and returns a ranked pandas DataFrame.

Installation

From the project folder:

pip install .

For editable development installs:

pip install -e .

Quickstart

See example/quickstart.py.

Example usage:

from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_volume_breakout import run_volume_breakout

nubra = InitNubraSdk(NubraEnv.PROD, env_creds=True)
market_data = MarketData(nubra)

stocks = ["ABB", "ADANIENSOL", "ADANIENT", "ADANIGREEN", "ADANIPORTS"]

volume_breakout = run_volume_breakout(
    market_data=market_data,
    stocks=stocks,
    lookback_days=10,
    interval="1d",
    rank=10,
)

print(volume_breakout.head(10))

Returned DataFrame

The scanner returns only these columns:

  • symbol
  • candle_time
  • current_volume
  • average_volume
  • volume_ratio

The results are sorted by:

  1. volume_ratio descending
  2. current_volume descending
  3. symbol ascending

Function Signature

run_volume_breakout(
    market_data,
    stocks,
    lookback_days,
    interval,
    rank,
    *,
    exchange="NSE",
    instrument_type="STOCK",
    baseline_mode="same_slot",
    lookback_candles=None,
    timezone_name="Asia/Kolkata",
    convert_prices=True,
    request_volume_delta=False,
    request_pause_seconds=0.0,
)

Notes

  • Nubra historical requests are rate-limited.
  • Nubra historical requests support small symbol batches, so the scanner automatically batches requests.
  • For intraday intervals, the scanner falls back to diff(cumulative_volume) if cumulative_volume_delta is unavailable or unstable.
  • Prices are typically returned by Nubra in paise for NSE instruments; this library converts OHLC prices for internal comparisons where needed.

Build The Package

Install build tools:

pip install build twine

Build source and wheel distributions:

python -m build

This creates artifacts under dist/.

Publish To PyPI

  1. Create accounts on PyPI and optionally TestPyPI.

  2. Make sure the package name nubra-volume-breakout is available. If it is already taken, change the name field in pyproject.toml.

  3. Build the package:

    python -m build
    
  4. Upload to TestPyPI first:

    python -m twine upload --repository testpypi dist/*
    
  5. Upload to PyPI:

    python -m twine upload dist/*
    
  6. Test installation:

    pip install nubra-volume-breakout
    

Recommended Before Public Release

  • Add a license file that matches how you want to distribute the package.
  • Add unit tests for volume derivation and ranking behavior.
  • Consider adding CI to build and validate the package automatically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nubra_volume_breakout-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nubra_volume_breakout-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file nubra_volume_breakout-0.1.0.tar.gz.

File metadata

  • Download URL: nubra_volume_breakout-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for nubra_volume_breakout-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7b67d2388c69d6da63e124ddee974ba666d5f3a20f8b435c73f2b206c790bae
MD5 19d855796761586dc3d7b79a35cf0cbc
BLAKE2b-256 856de8e5ac99c018a3f6f4e2ebd45a4c1e8be3e539bbe6e29837ea366ba1bdc0

See more details on using hashes here.

File details

Details for the file nubra_volume_breakout-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nubra_volume_breakout-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4673bcde21c39fcb8cbebb24be5c591108bd762b160b72d80536efe12da4a4f
MD5 d4373a9fa727dafb27b594e6151ac8fe
BLAKE2b-256 14449fca7c5ca19e0aeae500b79b6bfd2f961e8adef7b6d61cce7470846e649d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page