npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bytewaveco/signal

v1.1.0

Published

An adjustable combination of technical indicators to be used for financial analysis.

Downloads

9

Readme

CodeQL CI Packages Released

Signal

Signal is a combination of MACD, EMA, and Williams %R. Signal offers a configurable set of financial indicators that can be used to determine whether a stock is overbought or oversold.

Generating signals provides actual determined output of the indicators, which can be used to visualize the performance of the parameters.

Installation

npm install @bytwaveco/signal

Usage

import { signal } from "@bytwave/signal";

// Compatible with any financial source that provides candles
const myFinData = [
  {
    open: 100,
    close: 105,
    low: 95,
    high: 110,
    timestamp: "2022-01-01T12:00:00.000Z",
  },

  // ...

  {
    open: 113,
    close: 115,
    low: 101,
    high: 115,
    timestamp: "2022-01-01T12:30:00.000Z",
  },
];

const signals = signal(myFinData);

// Use calculated signals in your application

Configuration

Signal is configurable using the options argument as shown below:

// ...

const signals = signal(myFinData, {
  emaPeriod: 10,
});

// ...

Available options are:

| Parameter | Description | | --------------------- | --------------------------------------------------------------------------- | | openKey | The object key to treat as a candle open. Default open. | | closeKey | The object key to treat as a candle close. Default close. | | lowKey | The object key to treat as a candle low. Default low. | | highKey | The object key to treat as a candle high. Default high. | | timestampISO8601Key | The object key to treat as a candle ISO8601 timestamp. Default timestamp. | | emaPeriod | Number of samples to take when generating EMA. Default 30. | | emaBuyRatio | The EMA buy filter relative ratio. Default 0.005. | | emaSellRatio | The EMA sell filter relative ratio. Default 0.005. | | macdFastPeriod | Number of samples to take for the fast parameter in MACD. Default 5. | | macdSlowPeriod | Number of samples to take for the slow parameter in MACD. Default 10. | | macdSignalPeriod | Number of samples to take for the signal parameter in MACD. Default 7. | | williamsRPeriod | Number of samples to take when generating Williams %R. Default 20. |

Output

Signal's output is an array of objects with the following common properties:

| Property | Description | | ---------------- | ---------------------------------------------- | | open | The open price of the candle. | | close | The close price of the candle. | | high | The high price of the candle. | | low | The low price of the candle. | | timestamp | The ISO8601 timestamp of the candle. | | ema | The EMA value of the candle. | | emaBuy | The EMA buy threshold of the candle. | | emaSell | The EMA sell threshold of the candle. | | macd | The MACD value of the candle. | | macdSignal | The MACD signal value of the candle. | | macdHistogram | The MACD histogram value of the candle. | | isIntersecting | Flag if the MACD line crosses the Signal line. | | williamsR | The Williams %R value of the candle. | | signal | buy, sell, or hold |