Volume profile study thinkorswim

broken image
broken image

Profile monkey = monkeyBars(digit, 'startNewProfile' = cond, 'onExpansion' = onExpansion, Input volumeShowStyle = MonkeyVolumeShowStyle.all ĭef day_number = daysFromDate(first(yyyymmdd)) + getDayOfWeek(first(yyyymmdd)) ĭef dow = getDayOfWeek(yyyymmdd - dom + 1) ĭef expthismonth = (if dow > 5 then 27 else 20) - dow ĭef exp_opt = month + (dom > expthismonth) ĭef periodMin = Floor(seconds / 60 + day_number * 24 * 60) ĭef periodHour = Floor(seconds / 3600 + day_number * 24) ĭef periodDay = countTradingDays(Min(first(yyyymmdd), yyyymmdd), yyyymmdd) - 1 ĭef periodQuarter = Ceil(month / 3) - first(Ceil(month / 3)) ĭef count = compoundvalue(1, if period != period then (getValue(count, 1) + period - period) % multiplier else getValue(count, 1), 0) ĭef cond = compoundvalue(1, count < count + period - period, yes) ĭef agg_count = compoundvalue(1, if timeInterval != timeInterval then (getValue(agg_count, 1) + timeInterval - timeInterval) % aggMultiplier else getValue(agg_count, 1), 0) ĭef agg_cond = compoundvalue(1, agg_count < agg_count + timeInterval - timeInterval, yes) ĭef digit = compoundValue(1, if cond then 1 else agg_cond + getValue(digit, 1), 1)

broken image