
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@bytewaveco/signal
Advanced tools
An adjustable combination of technical indicators to be used for financial analysis.
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.
npm install @bytwaveco/signal
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
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 . |
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 |
FAQs
An adjustable combination of technical indicators to be used for financial analysis.
We found that @bytewaveco/signal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.