Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Im looking to take the volume profile study and change it to still show to VAH VAL and the POC but I dont want the volume overlay of the study to show. I have played around with it for a bit but I can seem to get it to work.
Any help would be greatly appreciated.
Can you help answer these questions from other members on NexusFi?
def period;
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);
switch (timePerProfile) {
case CHART:
period = 0;
case MINUTE:
period = floor(seconds / 60 + day_number * 24 * 60);
case HOUR:
period = floor(seconds / 3600 + day_number * 24);
case DAY:
period = countTradingDays(Min(first(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
period = floor(day_number / 7);
case MONTH:
period = floor(month - first(month));
case "OPT EXP":
period = exp_opt - first(exp_opt);
case BAR:
period = barNumber() - 1;
}
def 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];
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
height = PricePerRow.AUTOMATIC;
case TICKSIZE:
height = PricePerRow.TICKSIZE;
case CUSTOM:
height = customRowHeight;
}
profile tpo = timeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = compoundValue(1, onExpansion, no);
def pc = if IsNaN(tpo.getPointOfControl()) and con then pc[1] else tpo.getPointOfControl();
def hVA = if IsNaN(tpo.getHighestValueArea()) and con then hVA[1] else tpo.getHighestValueArea();
def lVA = if IsNaN(tpo.getLowestValueArea()) and con then lVA[1] else tpo.getLowestValueArea();
def hProfile = if IsNaN(tpo.getHighest()) and con then hProfile[1] else tpo.getHighest();
def lProfile = if IsNaN(tpo.getLowest()) and con then lProfile[1] else tpo.getLowest();
def plotsDomain = IsNaN(close) == onExpansion;
plot POC = if plotsDomain then pc[displace] else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile[displace] else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile[displace] else Double.NaN;
plot VAH = if plotsDomain then hVA[displace] else Double.NaN;
plot VAL = if plotsDomain then lVA[displace] else Double.NaN;
DefineGlobalColor("Profile", color.blue);
DefineGlobalColor("Value Area", color.gray);
DefineGlobalColor("Point Of Control", color.yellow);
tpo.show(globalColor("Profile"), if showPointOfControl then globalColor("Point Of Control") else color.current, if showValueArea then globalColor("Value Area") else color.current, opacity);
POC.SetDefaultColor(color.yellow);
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAH.SetDefaultColor(color.green);
VAL.SetDefaultColor(color.red);
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.hide();
ProfileLow.hide();
VAH.setlineweight(3);
VAL.setlineweight(3);
Poc.setlineweight(3);
def VA = VAH - VAL;
addlabel(ShowValueLabel,
if close <= VAH && close >= VAL && close >= POC
then "Inside VA, > POC: " +" (" +VAH +" / " +VAL +") "
else if close <= VAH && close >= VAL && close < POC
then "Inside VA, < POC: " +" (" +VAH +" / " +VAL +") "
else if close < VAL
then "< VA: " +" (" +VAL +") "
else if close > VAH
then "> VA: " +" (" +VAH +") "
else "",
if close <= VAH && close >= VAL && close >= POC
then color.yellow
else if close <= VAH && close >= VAL && close < POC
then color.dark_orange
else if close < VAL
then color.red
else if close > VAH
then color.green
else color.gray);