Socket
Book a DemoInstallSign in
Socket

@bytewaveco/signal

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bytewaveco/signal

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

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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:

ParameterDescription
openKeyThe object key to treat as a candle open. Default open.
closeKeyThe object key to treat as a candle close. Default close.
lowKeyThe object key to treat as a candle low. Default low.
highKeyThe object key to treat as a candle high. Default high.
timestampISO8601KeyThe object key to treat as a candle ISO8601 timestamp. Default timestamp.
emaPeriodNumber of samples to take when generating EMA. Default 30.
emaBuyRatioThe EMA buy filter relative ratio. Default 0.005.
emaSellRatioThe EMA sell filter relative ratio. Default 0.005.
macdFastPeriodNumber of samples to take for the fast parameter in MACD. Default 5.
macdSlowPeriodNumber of samples to take for the slow parameter in MACD. Default 10.
macdSignalPeriodNumber of samples to take for the signal parameter in MACD. Default 7.
williamsRPeriodNumber of samples to take when generating Williams %R. Default 20.

Output

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

PropertyDescription
openThe open price of the candle.
closeThe close price of the candle.
highThe high price of the candle.
lowThe low price of the candle.
timestampThe ISO8601 timestamp of the candle.
emaThe EMA value of the candle.
emaBuyThe EMA buy threshold of the candle.
emaSellThe EMA sell threshold of the candle.
macdThe MACD value of the candle.
macdSignalThe MACD signal value of the candle.
macdHistogramThe MACD histogram value of the candle.
isIntersectingFlag if the MACD line crosses the Signal line.
williamsRThe Williams %R value of the candle.
signalbuy, sell, or hold

Keywords

signal

FAQs

Package last updated on 06 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.