함수
종목 · 주기 · 시간
이 묶음의 이름 11개예요.
형식과 예를 함께 적었어요.
bar
봉 정보. count 봉 수, index 봉 번호(0부터, 시리즈), last 마지막 봉 번호, confirmed 마지막 봉이 끝났는지(진행 중이면 false)
const bar: { count: number; index: Series; last: number; confirmed: boolean }map((i) => (i === bar.last && !bar.confirmed ? NaN : close[i]))syminfo
종목 정보. symbol 'BINANCEF:BTCUSDT', ticker 'BTCUSDT', exchange 'BINANCEF', market 현물·선물(perp)·주식, currency 'USDT'·'KRW', tick 지금 가격의 호가 단위(모르면 NaN), timezone 거래소 시간대(코인 'UTC', 국내주식 'Asia/Seoul'). 모르면 빈 글자
const syminfo: { symbol: string; ticker: string; exchange: string; name: string; market: 'spot' | 'perp' | 'stock' | 'index' | 'other' | 'unknown'; currency: string; base: string; tick: number; timezone: string }const step = Number.isNaN(syminfo.tick) ? 0.01 : syminfo.ticktimeframe
차트 주기. period '60'·'1D'·'1W', minutes 한 봉의 분, isIntraday 일봉보다 짧은지
const timeframe: { period: string; minutes: number; seconds: number; isIntraday: boolean; isDaily: boolean; isWeekly: boolean; isMonthly: boolean }const len = timeframe.isIntraday ? 50 : 20date.hour
봉 시작의 시 (0~23). 시간대 기본은 거래소 시간대(syminfo.timezone), 한국 시간은 date.hour('Asia/Seoul')
hour(tz?: string): Seriesdate.hour('Asia/Seoul')date.minute
봉 시작의 분 (0~59)
minute(tz?: string): Seriesdate.dayofweek
요일: 0 일요일 ~ 6 토요일 (자바스크립트와 같음, 파인과 다름)
dayofweek(tz?: string): Seriesdate.day
날짜 (1~31)
day(tz?: string): Seriesdate.month
월 (1~12)
month(tz?: string): Seriesdate.year
연도
year(tz?: string): Seriesdate.isNew
새 하루('D', 기본) · 주('W', 월요일 시작) · 달('M') · 해('Y')의 첫 봉에서 참
isNew(period?: Period, tz?: string): Condbgcolor(date.isNew('W'), { color: color.alpha(color.gray, 0.15) })date.session
봉 시작이 'HHMM-HHMM' 시간 안이면 참 (끝이 더 이르면 자정을 넘김: '2200-0200')
session(spec: string, tz?: string): Conddate.session('0900-1530', 'Asia/Seoul')