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
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:
symbolcandle_timecurrent_volumeaverage_volumevolume_ratio
The results are sorted by:
volume_ratiodescendingcurrent_volumedescendingsymbolascending
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)ifcumulative_volume_deltais 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
-
Make sure the package name
nubra-volume-breakoutis available. If it is already taken, change thenamefield in pyproject.toml. -
Build the package:
python -m build
-
Upload to TestPyPI first:
python -m twine upload --repository testpypi dist/*
-
Upload to PyPI:
python -m twine upload dist/*
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7b67d2388c69d6da63e124ddee974ba666d5f3a20f8b435c73f2b206c790bae
|
|
| MD5 |
19d855796761586dc3d7b79a35cf0cbc
|
|
| BLAKE2b-256 |
856de8e5ac99c018a3f6f4e2ebd45a4c1e8be3e539bbe6e29837ea366ba1bdc0
|
File details
Details for the file nubra_volume_breakout-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nubra_volume_breakout-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4673bcde21c39fcb8cbebb24be5c591108bd762b160b72d80536efe12da4a4f
|
|
| MD5 |
d4373a9fa727dafb27b594e6151ac8fe
|
|
| BLAKE2b-256 |
14449fca7c5ca19e0aeae500b79b6bfd2f961e8adef7b6d61cce7470846e649d
|