Mida
Mida copied to clipboard
Live prices, periods and indicators
Introduction
The idea behind this PR is creating an API that provides ready-to-use LIVE market data, for example a self updating array of candlesticks, a self-updating object with bid/ask price for a symbol, and a self-updating indicator.
Example
import { login, createIndicator, makeLiveIndicator, MidaTimeframe, } from "@reiryoku/mida";
const myAccount = await login(/* ... */);
const rsi = await makeLiveIndicator({
indicator: createIndicator("RSI", { length: 14, }),
tradingAccount: myAccount,
input: {
symbol: "DE40",
timeframe: MidaTimeframe.H1,
},
onUpdate: (event) => {
console.log(rsi.lastValue);
},
});
await endLiveIndicator(rsi);