Download the PHP package baconfy/indicators without Composer

On this page you can find all versions of the php package baconfy/indicators. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package indicators

baconfy/indicators

Technical analysis indicators over exact decimal math. Framework-free, deterministic, no I/O.

Candles in, an index-aligned series out. No exchange knowledge, no HTTP client, no framework — the core runs in a plain PHP script with new.

Requirements

Installation

Quick start

Or resolve by name, the way a bot resolves what its config persists:

The two contracts

Single-series indicators implement Contracts\Indicator:

Multi-series indicators implement Contracts\MultiIndicator — a sibling, not a subtype, so the simple case never pays for the rich one:

make() returns Indicator|MultiIndicator; branch on instanceof (or on array_is_list() of the result).

Built-in indicators

Name Class Parameters (defaults) Output
sma Sma period: 9 series
ema Ema period: 9 series
rsi Rsi period: 14 series
atr Atr period: 14 series
rma Rma period: 14 series
obv Obv none series
vwma Vwma period: 20 series
macd Macd fast: 12, slow: 26, signal: 9 macd, signal, histogram
bollinger-bands BollingerBands period: 20, multiplier: '2.0' basis, upper, lower
stochastic Stochastic kPeriod: 14, kSmooth: 3, dSmooth: 3 k, d
adx Adx period: 14 adx, plus_di, minus_di

Both the names and the series keys are public API, governed by semver — consumers persist them in their config.

multiplier accepts BigDecimal|int|float|string; prefer a string to keep the decimal exact.

Alignment and null

Precision

Every division in every indicator goes through one package-wide policy: scale 12, HALF_UP. Additions and multiplications stay exact — BigDecimal grows the scale as needed — so only divisions round, and two indicators computing the same value can never diverge in the 10th digit. Square roots (Bollinger's standard deviation) go through the same policy.

Each indicator computes its full series in a single O(n) pass — rolling sums, recurrences and monotonic deques, never re-scanning the window per index.

Parameters are identity

An Ema(9) and an Ema(21) are different indicators, not different calls — the parameters live in the constructor, promoted and readonly, validated eagerly:

Every indicator is final readonly, and compute() is pure: same candles + same parameters → same output. No clock reads, no randomness, no state between calls.

Exceptions

All of them implement the Exceptions\IndicatorException marker, so a consumer can catch the whole package in one clause. No raw \Exception, \Error or \TypeError escapes.

Exception Raised when
InvalidParameterException a bad constructor parameter (period < 1), or an unknown parameter name handed to make()
UnknownIndicatorException the manager does not know the requested name
InvalidIndicatorException a registered class implements neither contract

Registering your own

Both paths guard the class against the two contracts and name the offender when it fails.

Laravel

The bridge is a single optional ServiceProvider, auto-discovered, registering IndicatorManager as a container singleton:

It does not bind Indicator::class — indicators are values created per config at runtime, not container services. illuminate/support is a suggest, never a require; delete the bridge and the core is intact.

Testing

Every indicator is validated against golden fixtures — real candles with expected values taken from external references — never formula against formula. The computed BigDecimal is rounded to the reference's precision and compared as strings.

License

MIT. See LICENSE.


All versions of indicators with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
brick/math Version ^0.18
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package baconfy/indicators contains the following files

Loading the files please wait ...