Plot Volume Profile data in Quarters?


Category:
0
0

Hello, I’m trying to plot volume profile for a “QUARTER” (past 3 months) period, but not sure how to code it. The code below is only to plot the VAH, VAL, and POC.

# =================================
# Volume Profile Definition Section
# =================================

def profiles = 50;
def customRowHeight = 1.0;
def multiplier = 1;
def onExpansion = ShowTodayOnly;
def yyyymmdd = GetYYYYMMDD();
def seconds = SecondsFromTime(0);
def month = GetYear() * 12 + GetMonth();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def dom = GetDayOfMonth(yyyymmdd);
def dow = GetDayOfWeek(yyyymmdd – dom + 1);
def expthismonth = (if dow > 5 then 27 else 20) – dow;
def exp_opt = month + (dom > expthismonth);
def quarter = ;
def period = ;

rec count = CompoundValue(1, if period != period[1] then (count[1] + period – period[1]) % multiplier else count[1], 0);
def cond = count < count[1] + period – period[1];

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on March 29, 2021 9:44 am
89 views
0
Private answer

The simplest solution is to set the "time per profile" to MONTH and change the multiplier to 3. This will give you profile periods that are 3 months long. Screenshot below shows how to set this up.

If you want profile periods that are set to actual quarters you must modify the code to include a new option for "time per profile".

However I am not at liberty to share this in the Q&A Forum because a client has previously paid me for this solution.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4086)
Answered on March 29, 2021 12:27 pm