getMarketHistory

Provides the trading history for the designated market through this method:

import { Nectar, KLineInterval } from "@wasd3rplay/nectar-sdk";

const nectar = new Nectar();

const now = new Date();
const minAgo = new Date(now.getTime() - 60 * 1000);

const histories = await nectar.getMarketHistory({
    symbol: "ETH_ETH:USDT_ETH",
    startTime: minAgo,
    endTime: now,
    interval: KLineInterval.SECOND_1
});

Properties

  • symbol

    • The market symbol

    • The symbol expression is a combination of base_ticker, a colon (':'), and quote_ticker.

  • startTime

    • The staring point of the data to be retrieved

  • endTime

    • The end point of the data to be retrieved

  • interval

    • The time interval for summarizing trading history item in the data to be retrieved

Interval Choices

Result

The result of this method is a list of trade histories:

e.g.

  • start_ts

    • The staring point of the history item as a timestamp

  • end_ts

    • The staring point of the history item as a timestamp

  • opening_price

    • The price at the starting point

  • closing_price

    • The price at the end point

  • highest_price

    • The highest price in the term

  • lowest_price

    • The lowest price in the term

  • volume

    • Total trade volume in the term