if (enterForInit === false || now.getDate() == 10) {
var totalEquity = IQAccount.totalEquity();
stock_basket.setBudget(totalEquity * stock_weight);
어떻게 수정해야 돼요?
if (enterForInit === false || now.getDate() == 10) {
var totalEquity = IQAccount.totalEquity();
stock_basket.setBudget(totalEquity * stock_weight);
어떻게 수정해야 돼요?
getMonth()를 사용하시면 됩니다. 다만 주의하실것은 month인 경우 1월이 0이고 12월이 11입니다. 그래서 매월 6월에 하고 싶으시면 아래처럼 하시면 됩니다. var lastYear = 0; function onDayClose(now) { if (lastYear == 0 || (now.getMonth() == 5 && now.getFullYear() != lastYear)) { //'5'라고 쓰면 6월입니다. logger.debug(now.toString()); lastYear = now.getFullYear(); } }