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
symbolThe market symbol
The symbol expression is a combination of
base_ticker, a colon (':'), andquote_ticker.
startTimeThe staring point of the data to be retrieved
endTimeThe end point of the data to be retrieved
intervalThe 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_tsThe staring point of the history item as a timestamp
end_tsThe staring point of the history item as a timestamp
opening_priceThe price at the starting point
closing_priceThe price at the end point
highest_priceThe highest price in the term
lowest_priceThe lowest price in the term
volumeTotal trade volume in the term