목차
개요
DateRule은 리밸런싱 날짜 규칙을 담는 데이터 객체입니다.
직접 생성하는 것이 아니라 IQDate.setDaily(), IQDate.setWeekly(), IQDate.setMonthlyStart() 등의 팩토리 함수가 반환하는 객체입니다. 생성된 DateRule은 IQDate.addRebalSchedule(dateRule)에 전달하여 리밸런싱 스케줄로 등록합니다.
// DateRule은 IQDate의 set* 함수가 반환 → addRebalSchedule에 전달
var rule = IQDate.setMonthlyStart(15); // 매월 15일 규칙의 DateRule 생성
IQDate.addRebalSchedule(rule); // 리밸런싱 스케줄 등록
JavaScript
복사
속성 (Properties)
DateRule 객체는 일반적으로 직접 속성에 접근하기보다 IQDate.addRebalSchedule()에 그대로 전달합니다. 내부 속성은 참고용으로 제공됩니다.
속성 | 타입 | 설명 |
period | Period | 리밸런싱 주기 상수 (Period.daily, Period.weekly, Period.monthlyStart, Period.monthlyEnd, Period.yearly) |
month | number | 리밸런싱 대상 월 (연간 규칙에서 사용) |
day | number | 리밸런싱 대상 일 |
weekday | number | 리밸런싱 대상 요일 (주간 규칙에서 사용. 1 = 월요일) |
Period 상수
상수 | 설명 |
Period.daily | 매일 |
Period.weekly | 매주 특정 요일 |
Period.monthlyStart | 매월 특정 일 (월초 기준) |
Period.monthlyEnd | 매월 말일 기준 offset |
Period.yearly | 매년 특정 월·일 |
DateRule 생성 함수 요약
생성 함수 | 생성되는 규칙 |
IQDate.setDaily() | 매 거래일 |
IQDate.setWeekly(weekday) | 매주 특정 요일 |
IQDate.setMonthlyStart(day) | 매월 day일 |
IQDate.setMonthlyEnd(day_offset) | 매월 말일로부터 day_offset번째 이전 일 |
IQDate.setMonthlyTradingDays(day_offset) | 매월 day_offset번째 거래일 |
IQDate.setMonthlyTradingDaysEnd(day_offset) | 매월 말일로부터 day_offset번째 이전 거래일 |
IQDate.setYearly(month, day) | 매년 특정 월·일 |
관련 API
•
IQDate 객체 — DateRule 생성 함수, 리밸런싱 스케줄 등록·판별
•
Basket 객체 — buildPortfolio() 와 함께 사용하는 포트폴리오 관리
