Market Value Areas Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
Here are several ThinkorSwim indicators that show value areas based on Market Profile, ShadowTrader's Value Areas study, a scanner to look for Price in value area and volume spike.

The market profile chart is a tool displaying price levels traded during a specific time, to see where the market spends time and forms value.

It reveals price distribution, indicating areas of high and low activity.

Use it to identify support, resistance, and potential breakout areas.
Observe price distribution to recognize key levels, and focus on areas where the market lingers.

knme2F3.png


Value Areas from the previous day

Rich (BB code):
# Archive Name: Volume Profile with Expanded Intraday Period Selections plus the Prior Day's Value Areas
# Archive Section: Volume
# Suggested Tos Name: VolumeProfileIntradayPeriods_Unknown
# Archive Date: 5.05.2018
# Archive Notes: found in stanL's treebase but that crashed.  Mobius found this one.

#VolumeProfile with Expanded Intraday Period Selections plus the Prior Day's Value Areas
input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {CHART, MINUTE, MIN2, MIN3, MIN4, MIN5, MIN10, MIN15, MIN20, default MIN30, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = no;
input profiles = 1000;
input showPointOfControl = yes;
input showValueArea = yes;
input valueAreaPercent = 70;
input opacity = 20; # 5.05.2018 JQ original was 50

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 MIN2:
    period = Floor(seconds / 120 + day_number * 24);
case MIN3:
    period = Floor(seconds / 180 + day_number * 24);
case MIN4:
    period = Floor(seconds / 240 + day_number * 24);
case MIN5:
    period = Floor(seconds / 300 + day_number * 24);
case MIN10:
    period = Floor(seconds / 600 + day_number * 24);
case MIN15:
    period = Floor(seconds / 900 + day_number * 24);
case MIN20:
    period = Floor(seconds / 1200 + day_number * 24);
case MIN30:
    period = Floor(seconds / 1800 + day_number * 24);
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 volcount = if period != period[1] then  volume  else  volcount[1]+volume;
#addlabel(yes,volcount,color.white);
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 vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = CompoundValue(1, onExpansion, no);
def pc = if IsNaN(vol.GetPointOfControl()) and con then pc[1] else vol.GetPointOfControl();
def hVA = if IsNaN(vol.GetHighestValueArea()) and con then hVA[1] else vol.GetHighestValueArea();
def lVA = if IsNaN(vol.GetLowestValueArea()) and con then lVA[1] else vol.GetLowestValueArea();

def hProfile = if IsNaN(vol.GetHighest()) and con then hProfile[1] else vol.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) and con then lProfile[1] else vol.GetLowest();
def plotsDomain = IsNaN(close) == onExpansion;

plot POC = if plotsDomain then pc else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

vol.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(GlobalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(GlobalColor("Value Area"));
VALow.SetDefaultColor(GlobalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.Hide();
ProfileLow.Hide();

#Prior Day Profile - counting formula by functionform
rec count1 = CompoundValue(1, if !(GetDay() != GetDay()[1]) then count1[1] + 1 else 1, 1);
def priorperiod = if IsNaN(count1[1]) then 1 else Max(count1, count1[1]);
profile vol1 = VolumeProfile("startNewProfile" = GetDay() != GetDay()[1], "onExpansion" = no);

def vahprior = vol1.GetHighestValueArea();
def pocprior = vol1.GetPointOfControl();
def valprior = vol1.GetLowestValueArea();

plot vahprev = GetValue(vahprior, priorperiod);
vahprev.SetDefaultColor(Color.MAGENTA);
vahprev.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HORIZONTAL);
vahprev.SetLineWeight(1);
vahprev.HideBubble();

plot pocprev = GetValue(pocprior, priorperiod);
pocprev.SetDefaultColor(Color.MAGENTA);
pocprev.SetPaintingStrategy(PaintingStrategy.POINTS);
pocprev.SetLineWeight(1);
pocprev.HideBubble();

plot valprev = GetValue(valprior, priorperiod);
valprev.SetDefaultColor(Color.MAGENTA);
valprev.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HORIZONTAL);
valprev.SetLineWeight(1);
valprev.HideBubble();

Shareable Link: https://tos.mx/8RYZ99

Value Areas & Pivot Points by ShadowTrader

Code:
#------------------
#ShadowTrader VALUE AREA SCRIPT
#------------------
#http://shadowtrader.net/squawkfaq.pdf
#------------------
input VAHigh = 0.00;

input PointofControl = 0.00;

input VALow = 0.00;

input marketOpenTime = 0930;

input marketCloseTime = 1615;

input showcloud = yes;


def closeByPeriod = close(period = "DAY")[-1];

def openbyperiod = open(period = "DAY")[-1];

def VArea = if close >= VALow and close <= VAHigh then 1 else 0;

def secondsFromOpen = secondsFromTime(marketOpenTime);

def secondsTillClose = secondsTillTime(marketCloseTime);

def marketOpen = if secondsFromOpen >= 0 and secondsTillClose > 0 then yes else no;

def newDay = if !IsNaN(closeByPeriod) then 0 else 1;

 

plot VAH;

plot POC;

plot VAL;

if !IsNaN(close(period = "DAY")[-1])

then {

    VAH = Double.NaN;

    POC = Double.NaN;

    VAL = Double.NaN;

} else {

VAH = if marketOpen and newDay then VAHigh else double.nan;

POC = if marketOpen and newDay then pointofcontrol else double.nan;

VAL = if marketOpen and newDay then VALow else double.nan;

}

VAH.SetPaintingStrategy(paintingStrategy.line);

VAH.SetDefaultColor(color.darK_red);

VAH.SetLineWeight(2);

POC.SetPaintingStrategy(paintingStrategy.line);

POC.SetDefaultColor(color.DARK_ORANGE);

POC.SetLineWeight(2);

VAL.SetPaintingStrategy(paintingStrategy.line);

VAL.SetDefaultColor(color.darK_green);

VAL.SetLineWeight(2);

 

AddChartBubble (!IsNaN(VAH) and IsNaN(VAH[1]), VAH, "VAH", color.white, no);
AddChartBubble (!IsNaN(POC) and IsNaN(POC[1]), poc, "POC", color.white, no);
AddChartBubble (!IsNaN(VAL) and IsNaN(VAL[1]), val, "VAL", color.white, no);

 

plot cloudhigh = if marketOpen and newDay and showcloud then VAHigh else double.nan;

plot cloudlow = if marketOpen and newDay and showcloud then VALow else double.nan;

AddCloud (cloudhigh, cloudlow, color.yellow, color.yellow);

AddLabel(VArea, "In Value Area",  color.white);





#--------------------------------------
#NYSE AND NASDAQ BREADTH BUBBLE SCRIPT
#--------------------------------------

input length = 2;


#NYSE Breath ratio
def NYSEratio =  if (close("$UVOL") >= close("$DVOL")) then (close("$UVOL") / close("$DVOL")) else -( close("$DVOL") / close("$UVOL")) ;
plot NYratio = round(NYSEratio, length);


NYratio.DefineColor("NYSEup", color.UpTICK);
NYratio.DefineColor("NYSEdown", color.DownTICK);
NYratio.AssignValueColor(if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown"));

AddLabel(yes, concat(NYratio, " :1 NYSE"), (if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown")));



#Nasdaq Breath ratio
def NASDratio =  if (close("$UVOL/Q") >= close("$DVOL/Q")) then (close("$UVOL/Q") / close("$DVOL/Q")) else -( close("$DVOL/Q") / close("$UVOL/Q")) ;
plot Qratio = round(NASDratio, length);

Qratio.DefineColor("NASup", color.UpTICK);
Qratio.DefineColor("NASdown", color.DownTICK);
Qratio.AssignValueColor(if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown"));

AddLabel(yes, concat(Qratio, " :1 NASD"), (if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown")));


#ZeroLine

plot zeroline = 0;
zeroline.assignValueColor(if NYSEratio > NYSEratio[1] then color.GREEN else color.RED);
zeroline.setLineWeight(1);
zeroline.hideTitle();
zeroline.hideBubble();
###################################################

Scanner

Rich (BB code):
# Scan for Price in value area and volume spike
# Mobius
# Chat Room Request 04.05.2018
def yyyymmdd = GetYYYYMMDD();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period = Floor(day_number / 7);
def cond = 0 < period - period[1];
profile vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = no);
vol.Show("va color" = Color.YELLOW);
def b = vol.GetHighestValueArea();
def a = vol.GetLowestValueArea();
plot condition = between(close, a, b) and volume > Average(volume, 21);

Pivot Levels

Code:
#######NexusOne code for pivot plus 3 levels of Support & Resistance####################
 #NexusOne: Also use this as a template source for code
#Mobius: the calculations for pivots are based on the prior days open high low and close. Nothing else.
input DynamicHide = {"No", default "Yes"};
input showOnlyToday = YES;
input Market_Open_Time = 0830;
input Market_Close_Time = 1616;


def h = DynamicHide;
def day = getDay();
def lastDay = getLastDay();
def isToday = if(day == lastDay, 1, 0);
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));

def pastOpen = if((secondsTillTime(Market_Open_Time) > 0), 0, 1);
def pastClose = if((secondsTillTime(Market_Close_Time) > 0), 0, 1);
def marketOpen = if(pastOpen and !pastClose, 1, 0);
def firstBar = if (day[1] != day, 1, 0);

def closingBell = if secondsTillTime(Market_Close_Time)[1] > 0 and
secondsTillTime(Market_Close_Time) <= 0 or
(secondsTillTime(Market_Close_Time)[1] < secondsTillTime(Market_Close_Time)
and secondsTillTime(Market_Close_Time)[1] > 0) then 1 else 0;

rec lclose = if IsNaN(close[-1]) then lclose[1] else close;
rec regHoursHigh = if(high > regHoursHigh[1] and marketOpen, high,
if(marketOpen and !firstBar, regHoursHigh[1], high));
rec regHoursLow = if(low < regHoursLow[1] and marketOpen, low,
if(marketOpen and regHoursLow[1] > 0 and !firstBar, regHoursLow[1], low));

rec runningClose = compoundValue(1, if closingbell then close[1] else runningClose[1], close);
rec prevClose = compoundValue(1, if closingBell then runningClose else prevClose[1], close);
rec prevHigh = compoundValue(1, if closingBell then regHoursHigh[1] else prevHigh[1], high);
rec prevLow = compoundValue(1, if closingBell then regHourslow[1] else prevlow[1], low);
rec prevHigh2 = compoundValue(1, if closingBell then prevHigh[1] else prevHigh2[1], high);
rec prevLow2 = compoundValue(1, if closingBell then prevLow[1] else prevlow2[1], low);


plot pivot = if shouldPlot then (prevHigh + prevClose + prevLow) / 3 else double.nan;
pivot.SetStyle(curve.FIRM);
pivot.SetDefaultColor(color.VIOLET);
pivot.HideBubble();


plot s1 = if shouldPlot then (2 * pivot) - prevHigh else double.nan;
s1.SetStyle(curve.FIRM);
s1.SetDefaultColor(color.dark_RED);
s1.HideBubble();

plot r1 = if shouldPlot then (2 * pivot) - prevLow else double.nan;
r1.SetStyle(curve.FIRM);
r1.SetDefaultColor(color.DaRK_GREEN);
r1.HideBubble();

plot r2 = if shouldPlot then pivot + ( r1 - s1) else double.nan;
r2.SetStyle(curve.FIRM);
r2.SetDefaultColor(color.DaRK_GREEN);
r2.HideBubble();

plot s2 = if shouldPlot then pivot - ( r1 - s1) else double.nan;
s2.SetStyle(curve.FIRM);
s2.SetDefaultColor(color.DaRK_RED);
s2.HideBubble();

plot s3 = if shouldPlot then prevLow - 2 * (prevHigh - pivot) else double.nan;
s3.SetStyle(curve.FIRM);
s3.SetDefaultColor(color.DaRK_RED);
s3.HideBubble();

plot r3 = if shouldPlot then prevHigh + 2 * (pivot - prevLow) else double.nan;
r3.SetStyle(curve.FIRM);
r3.SetDefaultColor(color.DaRK_GREEN);
r3.HideBubble();

pivot.setHiding(h and (lclose > r2 or lclose < s2));
r1.setHiding(h and lclose < s1);
r2.setHiding(h and lclose < r1);
r3.setHiding(h and lclose < r2);

s1.setHiding(h and lclose > r1);
s2.setHiding(h and lclose > s1);
s3.setHiding(h and lclose > s2);
#NexusOne: has a hide feature
######## EOC ##########
 

Attachments

  • knme2F3.png
    knme2F3.png
    369 KB · Views: 235
Last edited by a moderator:
Hey Ben, this is a great indicator for those of us who use the volume profile for trading. Can you make a watchlist that can be adjusted to the 5/10/15/30/hr if price is outside the VAH/VAL or inside the value area? This will make it easier to identify Runners in the beginning of RTH.
 
Hi Ben, I am getting an error on the Value Areas & Pivot Points as follows:

Identifier Already Used: Can not add input: Market_Open_Time at 128:7
Identifier Already Used: Can not add input: Market_Close_Time at 129:7
Identifier Already Used: marketOpen at 139:5
Already assigned: marketOpen at 139:5

Can you update it?
 
So my ToS chart plots yesterdays value areas on todays trading day. Personally, I like to see today's plotted value (so actually yesterday value area) to be inside the previous value area (so 2 days ago). I want to set up a scanner like this.

If that's confusing see pic below

valueareasss.png


I want a scan to scan for all stocks that will have an inside value relationship.
 
This is the latest version that I found with an explanation video

Value Areas & Pivot Points by ShadowTrader​

Code:
#ShadowTrader (Copyright ShadowTrader), a division of ShadowTrader Technologies, LLC. 2017. All rights reserved. This ShadowTrader Script is for educational purposes only.  ShadowTrader is not responsible for the use,  functionality or the performance of this Script. This work is copyrighted by ShadowTrader and all rights of this work under the license are reserved. Use of the ShadowTrader licensed code is for private use only and any other use are prohibited. By exercising any of the rights herein, you are accepting the terms of this license. You have a non-exclusive right to use or alter the ShadowTrader code. Use of this ShadowTrader Script other than as provided for in this license is prohibited. Any redistribution is strictly prohibited and will be enforced.

# A big ShadowTrader thank you to Justin Lane Williams for initially creating this script for us.
#08/31/11: Total redesign, added automated Pivot values, proximity plotting, new features.
#09/12/11: Added “ShowLevel4” option due to recent volitility. Will plot S4 & R4.
#12/11/11: Added “AfterHours” option to turn off plot after hours.
#12/21/11: Bug fixes due to TOS upgrades. Removed “AfterHours”, not workin correctly.
#01/25/12: Enter daily inputs as 4 digits and script will interpret.
# -added rounding to make the pivots appear as they do on the show.
#01/26/12: Removed ability to truncate inputs due to it only being accurate 99% of time.
#02/02/12: Small update to make sure "Auto Pivots" menu option functioned properly.
#06/07/12: Added (6)VPOC inputs, should be manually entered/deleted, displays when applicable.
#06/25/12: Removed some code and fixed a few bugs.
#07/09/12: Fixed one small but important bug.
#07/13/12: Added value bubbles, removed proximity plot function.
#08/13/12: Removed a lot of superfluous code plus a few upgrades.
#08/15/12: Fixed a bug that was giving false numbers.
#08/30/12: Fixed a bug that wasn't plotting the NQ profile.
#09/02/12: Reordered inputs and removed "LabelESonly" input.
#12/28/12: Made the plot hide on daily charts and updated code to current standards.
#01/04/13: Fixed a rare bug that hides labels if using tick charts.
#01/28/13: Added ability to hide each individual level.

# Pivot values will be off the day following market holidays and possibly the day after rollover.
# On these days make "AutoPivots=No" and manually draw pivots. Change back to "AutoPivots=Yes" the day after.

#Inputs
input VAH   = 2170.75;#Hint VAH: Must be manually entered daily, tinyurl.com/3lbmu4o
input POC   = 2166.75;#Hint POC: Must be manually entered daily, tinyurl.com/3lbmu4o
input VAL   = 2161.75;#Hint VAL: Must be manually entered daily, tinyurl.com/3lbmu4o
input Pivot = 2164.75;#Hint Pivot: Must be manually entered daily, tinyurl.com/3lbmu4o
input AutoPivots = yes;#Hint AutoPivots: Turns off pivot lines, value area stays on.
input Labels = {default "Proximity", "Off", "All", "ValueAreaOnly"};#Hint Labels: Labels at top of chart.
input ShowPivotPoint = no;#Hint ShowPivotPoint: Hides Pivot Point plot.
input ShowLevel4 = no;#Hint ShowLevel4: Will display S4 and R4 for days with large moves.
input PivotBubbles  = yes;#Hint PivotBubbles: Shows bubbles on pivot plot lines.
input ValueBubbles  = yes;#Hint ValueBubbles: Shows bubbles on value plot lines.
input PlotStartTime = 0530;#Hint PlotStartTime: Move to earlier time to shift bubbles to the left.
input ShowCloud  = yes;#Hint ShowCloud: Shows the value area as a cloud.
input CloudOpenOnly = yes;#Hint CloudOpenOnly: Will only cloud open candles.
input HideAfterHoursLabel = no;#Hint HideAfterHoursLabel: Hides "NoShadowPlotAfterHours" label.
input VpocBubbles  = yes;#Hint VpocBubbles: Shows bubbles on VPOC plot lines.
input Vpoc1 = 0.00;#Hint Vpoc1: Manually enter/delete VPOC here, will display when applicable.
input Vpoc2 = 0.00;#Hint Vpoc2: Manually enter/delete VPOC here, will display when applicable.
input Vpoc3 = 0.00;#Hint Vpoc3: Manually enter/delete VPOC here, will display when applicable.
input Vpoc4 = 0.00;#Hint Vpoc4: Manually enter/delete VPOC here, will display when applicable.
input Vpoc5 = 0.00;#Hint Vpoc5: Manually enter/delete VPOC here, will display when applicable.
input Vpoc6 = 0.00;#Hint Vpoc6: Manually enter/delete VPOC here, will display when applicable.
input ShowS1 = yes;#Hint ShowS1: Hide/Show S1.
input ShowS2 = yes;#Hint ShowS2: Hide/Show S2.
input ShowS3 = yes;#Hint ShowS3: Hide/Show S3.
input ShowR1 = yes;#Hint ShowR1: Hide/Show R1.
input ShowR2 = yes;#Hint ShowR2: Hide/Show R2.
input ShowR3 = yes;#Hint ShowR3: Hide/Show R3.
input ShowORB = No;#Hint ShowORB: Displays 2 small, dashed lines at the top/bottom of opening range.
input OrbTime = 30;#Hint OrbTime: Defines the time range in minutes for the ORB.

def Na = Double.NaN;
declare hide_on_daily;

#Value Area Functions
def PPoint = If(Pivot > 0, Pivot, Na);
def VArea  = Between(close, VAL, VAH);
def VAreaabove  = close > VAH;
def VAreabelow  = close < VAL;

#Previous Day Functions
def Day   = GetDayOfWeek(GetYYYYMMDD());
def CloseTime = SecondsTillTime(1545) >= 0;
def OpenTime = SecondsFromTime(0930) >= 0;
def RegHrs = CloseTime and OpenTime;
def PLow  =  CompoundValue(1, If(Day == Day[1] and RegHrs and low < PLow[1], low, If(SecondsFromTime(0930) <= 0 and RegHrs, low, PLow[1])), low);
def PHigh = CompoundValue(1, If(Day == Day[1] and RegHrs and high > PHigh[1], high, If(SecondsFromTime(0930) <= 0 and RegHrs, high, PHigh[1])), high);
def PrevLow  = If(Day != Day[1], PLow[1], PrevLow[1]);
def PrevHigh = If(Day != Day[1], PHigh[1], PrevHigh[1]);

#Time Functions
def CloseTime2 = SecondsTillTime(1600) >= 0;
def OpenTime2 = SecondsFromTime(PlotStartTime) >= 0;
def MarketOpen = OpenTime2 and CloseTime2;
def NewDay = IsNaN(close(period = “Day”)[-1]);
def Chart  = MarketOpen and NewDay;

#Pivot Functions
def Res1  = (2 * PPoint) - PrevLow;
def Supp1 = (2 * PPoint) - PrevHigh;
def Res2  = PPoint + (Res1 - Supp1);
def Supp2 = PPoint - (Res1 - Supp1);
def Res3  = PrevHigh + 2 * (PPoint - PrevLow);
def Supp3 = PrevLow - 2 * (PrevHigh - PPoint);
def Res4  = PrevHigh + 3 * (PPoint - PrevLow);
def Supp4 = PrevLow - 3 * (PrevHigh - PPoint);

#Rounding Functions
def RI   = RoundDown(Res1, 0) - ((Round(((RoundDown(Res1, 0) - Res1) / 0.25), 0)) * 0.25);
def SI   = RoundDown(Supp1, 0) - ((Round(((RoundDown(Supp1, 0) - Supp1) / 0.25), 0)) * 0.25);
def RII  = RoundDown(Res2, 0) - ((Round(((RoundDown(Res2, 0) - Res2) / 0.25), 0)) * 0.25);
def SII  = RoundDown(Supp2, 0) - ((Round(((RoundDown(Supp2, 0) - Supp2) / 0.25), 0)) * 0.25);
def RIII = RoundDown(Res3, 0) - ((Round(((RoundDown(Res3, 0) - Res3) / 0.25), 0)) * 0.25);
def SIII = RoundDown(Supp3, 0) - ((Round(((RoundDown(Supp3, 0) - Supp3) / 0.25), 0)) * 0.25);
def RIV  = RoundDown(Res4, 0) - ((Round(((RoundDown(Res4, 0) - Res4) / 0.25), 0)) * 0.25);
def SIV  = RoundDown(Supp4, 0) - ((Round(((RoundDown(Supp4, 0) - Supp4) / 0.25), 0)) * 0.25);
def PivP = RoundDown(PPoint, 0) - ((Round(((RoundDown(PPoint, 0) - PPoint) / 0.25), 0)) * 0.25);

#Plots
plot VH  = If(Chart and VAH > 0, VAH, Na);
plot PC  = If(Chart and POC > 0, POC, Na);
plot VL  = If(Chart and VAL > 0, VAL, Na);
plot R4  = If(Chart and AutoPivots and ShowLevel4 and RIV > 0, RIV, Na);
plot R3  = If(Chart and AutoPivots and ShowR3 and RIII > 0, RIII, Na);
plot R2  = If(Chart and AutoPivots and ShowR2 and RII > 0, RII, Na);
plot R1  = If(Chart and AutoPivots and ShowR1 and RI > 0, RI, Na);
plot PP  = If(Chart and AutoPivots and ShowPivotPoint and PPoint > 0, PivP, Na);
plot S1  = If(Chart and AutoPivots and ShowS1 and SI > 0, SI, Na);
plot S2  = If(Chart and AutoPivots and ShowS2 and SII > 0, SII, Na);
plot S3  = If(Chart and AutoPivots and ShowS3 and SIII > 0, SIII, Na);
plot S4  = If(Chart and AutoPivots and ShowLevel4 and SIV > 0, SIV, Na);
plot V1  = If(Chart and Between(Vpoc1, SIV - 10, RIV + 10), Vpoc1, Na);
plot V2  = If(Chart and Between(Vpoc2, SIV - 10, RIV + 10), Vpoc2, Na);
plot V3  = If(Chart and Between(Vpoc3, SIV - 10, RIV + 10), Vpoc3, Na);
plot V4  = If(Chart and Between(Vpoc4, SIV - 10, RIV + 10), Vpoc4, Na);
plot V5  = If(Chart and Between(Vpoc5, SIV - 10, RIV + 10), Vpoc5, Na);
plot V6  = If(Chart and Between(Vpoc6, SIV - 10, RIV + 10), Vpoc6, Na);

#Value Area Cloud
def CloudClose = SecondsTillTime(1615) > 0;
def Cloud      = OpenTime and CloudClose;
def ChartCloud = Cloud and Chart;
def CloudTest  = If(CloudOpenOnly, ChartCloud, Chart);
plot cloudhigh = If(CloudTest and ShowCloud, VAH, Na);
plot cloudlow  = If(CloudTest and ShowCloud, VAL, Na);
AddCloud(cloudhigh, cloudlow, Color.GRAY, Color.GRAY);
def AfterHours = OpenTime2 and CloudClose;

#Chart Labels
def Futures = Between(close, close("/es") - 15, close("/es") + 15) or Between(close, close("/nq") - 15, close("/nq") + 15);
def Label = Chart and Futures;
def ZeroTest = VAH > 0 and VAL > 0;
def PNotZero = PPoint > 0;
def ChartLabels;
switch (Labels) {
case "Proximity":
ChartLabels = 1;
case "Off":
ChartLabels = 0;
case "All":
ChartLabels = 2;
case "ValueAreaOnly":
ChartLabels = 3;
}
AddLabel(ChartLabels == 1 and Label and AutoPivots and VArea and ZeroTest, “InsideValue”, Color.WHITE);
AddLabel(ChartLabels == 1 and Label and AutoPivots and VAreaabove and ZeroTest, “AboveValue”, Color.GREEN);
AddLabel(ChartLabels == 1 and Label and AutoPivots and VAreabelow and ZeroTest, “BelowValue”, Color.RED);
AddLabel(ChartLabels == 1 and Label and !AutoPivots and VArea and ZeroTest, “InsideValueArea”, Color.WHITE);
AddLabel(ChartLabels == 1 and Label and !AutoPivots and VAreaabove and ZeroTest, “AboveValueArea”, Color.GREEN);
AddLabel(ChartLabels == 1 and Label and !AutoPivots and VAreabelow and ZeroTest, “BelowValueArea”, Color.RED);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, VL, (RI + ((RII - RI) / 2))), "VH=" + AsText(VH), Color.RED);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, VL, VH), "POC=" + AsText(PC), Color.YELLOW);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, (SI - ((SI - SII) / 2)), VH), "VL=" + AsText(VL), Color.GREEN);
AddLabel(ChartLabels == 1 and Label and AutoPivots and (close > VH or (Between(RI, VL, VH) and close > VL)), "R1=" + AsText(RI), Color.RED);
AddLabel(ChartLabels == 1 and Label and AutoPivots and close > VH, "R2=" + AsText(RII), Color.RED);
AddLabel(ChartLabels == 1 and Label and AutoPivots and close > (RI + ((RII - RI) / 2)), "R3=" + AsText(RIII), Color.RED);
AddLabel(ChartLabels == 1 and Label and AutoPivots and ShowLevel4 and close > (RII + ((RIII - RII) / 2)), "R4=" + AsText(RIV), Color.RED);
AddLabel(ChartLabels == 1 and Label and AutoPivots and ShowPivotPoint and close > SI and close < RI, "PP=" + AsText(PP), Color.WHITE);
AddLabel(ChartLabels == 1 and Label and AutoPivots and (close < VL or (Between(SI, VL, VH) and close < VH)), "S1=" + AsText(SI), Color.GREEN);
AddLabel(ChartLabels == 1 and Label and AutoPivots and close < VL, "S2=" + AsText(SII), Color.GREEN);
AddLabel(ChartLabels == 1 and Label and AutoPivots and close < (SI - ((SI - SII) / 2)), "S3=" + AsText(SIII), Color.GREEN);
AddLabel(ChartLabels == 1 and Label and AutoPivots and ShowLevel4 and close < (SII - ((SII - SIII) / 2)), "S4=" + AsText(SIV), Color.GREEN);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, (V1 - 5), (V1 + 5)), "VPOC=" + AsText(V1), Color.MAGENTA);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, (V2 - 5), (V2 + 5)), "VPOC=" + AsText(V2), Color.MAGENTA);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, (V3 - 5), (V3 + 5)), "VPOC=" + AsText(V3), Color.MAGENTA);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, (V4 - 5), (V4 + 5)), "VPOC=" + AsText(V4), Color.MAGENTA);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, (V5 - 5), (V5 + 5)), "VPOC=" + AsText(V5), Color.MAGENTA);
AddLabel(ChartLabels == 1 and Label and AutoPivots and Between(close, (V6 - 5), (V6 + 5)), "VPOC=" + AsText(V6), Color.MAGENTA);
AddLabel(ChartLabels == 2 and Label and ZeroTest, "VH=" + AsText(VH), Color.RED);
AddLabel(ChartLabels == 2 and Label and ZeroTest, "POC=" + AsText(PC), Color.YELLOW);
AddLabel(ChartLabels == 2 and Label and ZeroTest, "VL=" + AsText(VL), Color.GREEN);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "R1=" + AsText(RI), Color.RED);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "R2=" + AsText(RII), Color.RED);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "R3=" + AsText(RIII), Color.RED);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero and ShowLevel4, "R4=" + AsText(RIV), Color.RED);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero and ShowPivotPoint, "PP=" + AsText(PP), Color.WHITE);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "S1=" + AsText(SI), Color.GREEN);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "S2=" + AsText(SII), Color.GREEN);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "S3=" + AsText(SIII), Color.GREEN);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero and ShowLevel4, "S4=" + AsText(SIV), Color.GREEN);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "VPOC=" + AsText(V1), Color.MAGENTA);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "VPOC=" + AsText(V2), Color.MAGENTA);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "VPOC=" + AsText(V3), Color.MAGENTA);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "VPOC=" + AsText(V4), Color.MAGENTA);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "VPOC=" + AsText(V5), Color.MAGENTA);
AddLabel(ChartLabels == 2 and Label and AutoPivots and PNotZero, "VPOC=" + AsText(V6), Color.MAGENTA);
AddLabel(ChartLabels == 3 and Label and VArea and ZeroTest, “InsideValueArea”, Color.WHITE);
AddLabel(ChartLabels == 3 and Label and VAreaabove and ZeroTest, “AboveValueArea”, Color.GREEN);
AddLabel(ChartLabels == 3 and Label and VAreabelow and ZeroTest, "BelowValueArea”, Color.RED);
AddLabel(!AfterHours and !Chart and !HideAfterHoursLabel, "NoShadowPlotAfterHours", Color.ORANGE);

#Chart Bubbles
AddChartBubble(IsNaN(VH[1]) and ValueBubbles, VH, VH, Color.RED, no);
AddChartBubble(IsNaN(PC[1]) and ValueBubbles, PC, PC, Color.YELLOW, no);
AddChartBubble(IsNaN(VL[1]) and ValueBubbles, VL, VL, Color.GREEN, no);
AddChartBubble(IsNaN(S1[1]) and PivotBubbles, S1, “S1”, Color.WHITE, no);
AddChartBubble(IsNaN(S2[1]) and PivotBubbles, S2, “S2”, Color.WHITE, no);
AddChartBubble(IsNaN(S3[1]) and PivotBubbles, S3, “S3”, Color.WHITE, no);
AddChartBubble(IsNaN(S4[1]) and PivotBubbles and ShowLevel4, S4, “S4”, Color.WHITE, no);
AddChartBubble(IsNaN(PP[1]) and ShowPivotPoint and PivotBubbles, PP, “PP”, Color.WHITE, no);
AddChartBubble(IsNaN(R1[1]) and PivotBubbles, R1, “R1”, Color.WHITE, no);
AddChartBubble(IsNaN(R2[1]) and PivotBubbles, R2, “R2”, Color.WHITE, no);
AddChartBubble(IsNaN(R3[1]) and PivotBubbles, R3, “R3”, Color.WHITE, no);
AddChartBubble(IsNaN(R4[1]) and PivotBubbles and ShowLevel4, R4, “R4”, Color.WHITE, no);
AddChartBubble(IsNaN(V1[1]) and VpocBubbles, V1, “VPOC”, Color.MAGENTA, no);
AddChartBubble(IsNaN(V2[1]) and VpocBubbles, V2, “VPOC”, Color.MAGENTA, no);
AddChartBubble(IsNaN(V3[1]) and VpocBubbles, V3, “VPOC”, Color.MAGENTA, no);
AddChartBubble(IsNaN(V4[1]) and VpocBubbles, V4, “VPOC”, Color.MAGENTA, no);
AddChartBubble(IsNaN(V5[1]) and VpocBubbles, V5, “VPOC”, Color.MAGENTA, no);
AddChartBubble(IsNaN(V6[1]) and VpocBubbles, V6, “VPOC”, Color.MAGENTA, no);

#Opening Range Breakout Functions
def ORBopen = SecondsTillTime(945) <= 0;
def IsMarketOpen = ORBopen and CloseTime2;
def FirstBar = If(GetDay()[1] != GetDay(), GetDay() - 1, 0);
def OpenRange = SecondsFromTime(945);
def PastOpeningRange = OpenRange >= (OrbTime - 15) * 60;
def DisplayedHigh = If(high > DisplayedHigh[1] and IsMarketOpen and ShowORB, high, If(IsMarketOpen and !FirstBar, DisplayedHigh[1], high));
def DisplayedLow = If(low < DisplayedLow[1] and IsMarketOpen and ShowORB, low, If(IsMarketOpen and !FirstBar, DisplayedLow[1], low));
def ORBHi = If(PastOpeningRange, ORBHi[1], DisplayedHigh);
def ORBLo  = If(PastOpeningRange, ORBLo[1], DisplayedLow);
plot ORBHigh = If(Chart and PastOpeningRange and IsMarketOpen and ShowORB, ORBHi, Na);
plot ORBLow  = If(Chart and PastOpeningRange and IsMarketOpen and ShowORB, ORBLo, Na);

#Plot Criteria
ORBHigh.SetDefaultColor(Color.MAGENTA);
ORBHigh.SetStyle(Curve.SHORT_DASH);
ORBHigh.HideBubble();
ORBLow.SetDefaultColor(Color.MAGENTA);
ORBLow.SetStyle(Curve.SHORT_DASH);
ORBLow.HideBubble();
VH.SetDefaultColor(Color.RED);
PC.SetDefaultColor(Color.YELLOW);
PC.SetStyle(Curve.LONG_DASH);
VL.SetDefaultColor(Color.GREEN);
R4.SetDefaultColor(Color.WHITE);
R3.SetDefaultColor(Color.WHITE);
R2.SetDefaultColor(Color.WHITE);
R1.SetDefaultColor(Color.WHITE);
PP.SetDefaultColor(Color.WHITE);
S4.SetDefaultColor(Color.WHITE);
S3.SetDefaultColor(Color.WHITE);
S2.SetDefaultColor(Color.WHITE);
S1.SetDefaultColor(Color.WHITE);
V1.SetDefaultColor(Color.MAGENTA);
V1.SetStyle(Curve.LONG_DASH);
V2.SetDefaultColor(Color.MAGENTA);
V2.SetStyle(Curve.LONG_DASH);
V3.SetDefaultColor(Color.MAGENTA);
V3.SetStyle(Curve.LONG_DASH);
V4.SetDefaultColor(Color.MAGENTA);
V4.SetStyle(Curve.LONG_DASH);
V5.SetDefaultColor(Color.MAGENTA);
V5.SetStyle(Curve.LONG_DASH);
V6.SetDefaultColor(Color.MAGENTA);
V6.SetStyle(Curve.LONG_DASH);
cloudhigh.SetDefaultColor(Color.RED);
cloudlow.SetDefaultColor(Color.GREEN);

You can go here for more info and the video: https://www.shadowtrader.net/thinkscript_va_pivots/

You can go here for the video:
 
Here are several ThinkorSwim indicators that show value areas based on Market Profile, ShadowTrader's Value Areas study, a scanner to look for Price in value area and volume spike.

knme2F3.png


Value Areas from the previous day

Rich (BB code):
# Archive Name: Volume Profile with Expanded Intraday Period Selections plus the Prior Day's Value Areas
# Archive Section: Volume
# Suggested Tos Name: VolumeProfileIntradayPeriods_Unknown
# Archive Date: 5.05.2018
# Archive Notes: found in stanL's treebase but that crashed.  Mobius found this one.

#VolumeProfile with Expanded Intraday Period Selections plus the Prior Day's Value Areas
input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {CHART, MINUTE, MIN2, MIN3, MIN4, MIN5, MIN10, MIN15, MIN20, default MIN30, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = no;
input profiles = 1000;
input showPointOfControl = yes;
input showValueArea = yes;
input valueAreaPercent = 70;
input opacity = 20; # 5.05.2018 JQ original was 50

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 MIN2:
    period = Floor(seconds / 120 + day_number * 24);
case MIN3:
    period = Floor(seconds / 180 + day_number * 24);
case MIN4:
    period = Floor(seconds / 240 + day_number * 24);
case MIN5:
    period = Floor(seconds / 300 + day_number * 24);
case MIN10:
    period = Floor(seconds / 600 + day_number * 24);
case MIN15:
    period = Floor(seconds / 900 + day_number * 24);
case MIN20:
    period = Floor(seconds / 1200 + day_number * 24);
case MIN30:
    period = Floor(seconds / 1800 + day_number * 24);
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 volcount = if period != period[1] then  volume  else  volcount[1]+volume;
#addlabel(yes,volcount,color.white);
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 vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = CompoundValue(1, onExpansion, no);
def pc = if IsNaN(vol.GetPointOfControl()) and con then pc[1] else vol.GetPointOfControl();
def hVA = if IsNaN(vol.GetHighestValueArea()) and con then hVA[1] else vol.GetHighestValueArea();
def lVA = if IsNaN(vol.GetLowestValueArea()) and con then lVA[1] else vol.GetLowestValueArea();

def hProfile = if IsNaN(vol.GetHighest()) and con then hProfile[1] else vol.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) and con then lProfile[1] else vol.GetLowest();
def plotsDomain = IsNaN(close) == onExpansion;

plot POC = if plotsDomain then pc else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

vol.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(GlobalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(GlobalColor("Value Area"));
VALow.SetDefaultColor(GlobalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.Hide();
ProfileLow.Hide();

#Prior Day Profile - counting formula by functionform
rec count1 = CompoundValue(1, if !(GetDay() != GetDay()[1]) then count1[1] + 1 else 1, 1);
def priorperiod = if IsNaN(count1[1]) then 1 else Max(count1, count1[1]);
profile vol1 = VolumeProfile("startNewProfile" = GetDay() != GetDay()[1], "onExpansion" = no);

def vahprior = vol1.GetHighestValueArea();
def pocprior = vol1.GetPointOfControl();
def valprior = vol1.GetLowestValueArea();

plot vahprev = GetValue(vahprior, priorperiod);
vahprev.SetDefaultColor(Color.MAGENTA);
vahprev.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HORIZONTAL);
vahprev.SetLineWeight(1);
vahprev.HideBubble();

plot pocprev = GetValue(pocprior, priorperiod);
pocprev.SetDefaultColor(Color.MAGENTA);
pocprev.SetPaintingStrategy(PaintingStrategy.POINTS);
pocprev.SetLineWeight(1);
pocprev.HideBubble();

plot valprev = GetValue(valprior, priorperiod);
valprev.SetDefaultColor(Color.MAGENTA);
valprev.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HORIZONTAL);
valprev.SetLineWeight(1);
valprev.HideBubble();

Shareable Link: https://tos.mx/8RYZ99

Value Areas & Pivot Points by ShadowTrader

Code:
#------------------
#ShadowTrader VALUE AREA SCRIPT
#------------------
#http://shadowtrader.net/squawkfaq.pdf
#------------------
input VAHigh = 0.00;

input PointofControl = 0.00;

input VALow = 0.00;

input marketOpenTime = 0930;

input marketCloseTime = 1615;

input showcloud = yes;


def closeByPeriod = close(period = "DAY")[-1];

def openbyperiod = open(period = "DAY")[-1];

def VArea = if close >= VALow and close <= VAHigh then 1 else 0;

def secondsFromOpen = secondsFromTime(marketOpenTime);

def secondsTillClose = secondsTillTime(marketCloseTime);

def marketOpen = if secondsFromOpen >= 0 and secondsTillClose > 0 then yes else no;

def newDay = if !IsNaN(closeByPeriod) then 0 else 1;

 

plot VAH;

plot POC;

plot VAL;

if !IsNaN(close(period = "DAY")[-1])

then {

    VAH = Double.NaN;

    POC = Double.NaN;

    VAL = Double.NaN;

} else {

VAH = if marketOpen and newDay then VAHigh else double.nan;

POC = if marketOpen and newDay then pointofcontrol else double.nan;

VAL = if marketOpen and newDay then VALow else double.nan;

}

VAH.SetPaintingStrategy(paintingStrategy.line);

VAH.SetDefaultColor(color.darK_red);

VAH.SetLineWeight(2);

POC.SetPaintingStrategy(paintingStrategy.line);

POC.SetDefaultColor(color.DARK_ORANGE);

POC.SetLineWeight(2);

VAL.SetPaintingStrategy(paintingStrategy.line);

VAL.SetDefaultColor(color.darK_green);

VAL.SetLineWeight(2);

 

AddChartBubble (!IsNaN(VAH) and IsNaN(VAH[1]), VAH, "VAH", color.white, no);
AddChartBubble (!IsNaN(POC) and IsNaN(POC[1]), poc, "POC", color.white, no);
AddChartBubble (!IsNaN(VAL) and IsNaN(VAL[1]), val, "VAL", color.white, no);

 

plot cloudhigh = if marketOpen and newDay and showcloud then VAHigh else double.nan;

plot cloudlow = if marketOpen and newDay and showcloud then VALow else double.nan;

AddCloud (cloudhigh, cloudlow, color.yellow, color.yellow);

AddLabel(VArea, "In Value Area",  color.white);





#--------------------------------------
#NYSE AND NASDAQ BREADTH BUBBLE SCRIPT
#--------------------------------------

input length = 2;


#NYSE Breath ratio
def NYSEratio =  if (close("$UVOL") >= close("$DVOL")) then (close("$UVOL") / close("$DVOL")) else -( close("$DVOL") / close("$UVOL")) ;
plot NYratio = round(NYSEratio, length);


NYratio.DefineColor("NYSEup", color.UpTICK);
NYratio.DefineColor("NYSEdown", color.DownTICK);
NYratio.AssignValueColor(if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown"));

AddLabel(yes, concat(NYratio, " :1 NYSE"), (if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown")));



#Nasdaq Breath ratio
def NASDratio =  if (close("$UVOL/Q") >= close("$DVOL/Q")) then (close("$UVOL/Q") / close("$DVOL/Q")) else -( close("$DVOL/Q") / close("$UVOL/Q")) ;
plot Qratio = round(NASDratio, length);

Qratio.DefineColor("NASup", color.UpTICK);
Qratio.DefineColor("NASdown", color.DownTICK);
Qratio.AssignValueColor(if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown"));

AddLabel(yes, concat(Qratio, " :1 NASD"), (if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown")));


#ZeroLine

plot zeroline = 0;
zeroline.assignValueColor(if NYSEratio > NYSEratio[1] then color.GREEN else color.RED);
zeroline.setLineWeight(1);
zeroline.hideTitle();
zeroline.hideBubble();
###################################################

Scanner

Rich (BB code):
# Scan for Price in value area and volume spike
# Mobius
# Chat Room Request 04.05.2018
def yyyymmdd = GetYYYYMMDD();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period = Floor(day_number / 7);
def cond = 0 < period - period[1];
profile vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = no);
vol.Show("va color" = Color.YELLOW);
def b = vol.GetHighestValueArea();
def a = vol.GetLowestValueArea();
plot condition = between(close, a, b) and volume > Average(volume, 21);

Pivot Levels

Code:
#######NexusOne code for pivot plus 3 levels of Support & Resistance####################
 #NexusOne: Also use this as a template source for code
#Mobius: the calculations for pivots are based on the prior days open high low and close. Nothing else.
input DynamicHide = {"No", default "Yes"};
input showOnlyToday = YES;
input Market_Open_Time = 0830;
input Market_Close_Time = 1616;


def h = DynamicHide;
def day = getDay();
def lastDay = getLastDay();
def isToday = if(day == lastDay, 1, 0);
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));

def pastOpen = if((secondsTillTime(Market_Open_Time) > 0), 0, 1);
def pastClose = if((secondsTillTime(Market_Close_Time) > 0), 0, 1);
def marketOpen = if(pastOpen and !pastClose, 1, 0);
def firstBar = if (day[1] != day, 1, 0);

def closingBell = if secondsTillTime(Market_Close_Time)[1] > 0 and
secondsTillTime(Market_Close_Time) <= 0 or
(secondsTillTime(Market_Close_Time)[1] < secondsTillTime(Market_Close_Time)
and secondsTillTime(Market_Close_Time)[1] > 0) then 1 else 0;

rec lclose = if IsNaN(close[-1]) then lclose[1] else close;
rec regHoursHigh = if(high > regHoursHigh[1] and marketOpen, high,
if(marketOpen and !firstBar, regHoursHigh[1], high));
rec regHoursLow = if(low < regHoursLow[1] and marketOpen, low,
if(marketOpen and regHoursLow[1] > 0 and !firstBar, regHoursLow[1], low));

rec runningClose = compoundValue(1, if closingbell then close[1] else runningClose[1], close);
rec prevClose = compoundValue(1, if closingBell then runningClose else prevClose[1], close);
rec prevHigh = compoundValue(1, if closingBell then regHoursHigh[1] else prevHigh[1], high);
rec prevLow = compoundValue(1, if closingBell then regHourslow[1] else prevlow[1], low);
rec prevHigh2 = compoundValue(1, if closingBell then prevHigh[1] else prevHigh2[1], high);
rec prevLow2 = compoundValue(1, if closingBell then prevLow[1] else prevlow2[1], low);


plot pivot = if shouldPlot then (prevHigh + prevClose + prevLow) / 3 else double.nan;
pivot.SetStyle(curve.FIRM);
pivot.SetDefaultColor(color.VIOLET);
pivot.HideBubble();


plot s1 = if shouldPlot then (2 * pivot) - prevHigh else double.nan;
s1.SetStyle(curve.FIRM);
s1.SetDefaultColor(color.dark_RED);
s1.HideBubble();

plot r1 = if shouldPlot then (2 * pivot) - prevLow else double.nan;
r1.SetStyle(curve.FIRM);
r1.SetDefaultColor(color.DaRK_GREEN);
r1.HideBubble();

plot r2 = if shouldPlot then pivot + ( r1 - s1) else double.nan;
r2.SetStyle(curve.FIRM);
r2.SetDefaultColor(color.DaRK_GREEN);
r2.HideBubble();

plot s2 = if shouldPlot then pivot - ( r1 - s1) else double.nan;
s2.SetStyle(curve.FIRM);
s2.SetDefaultColor(color.DaRK_RED);
s2.HideBubble();

plot s3 = if shouldPlot then prevLow - 2 * (prevHigh - pivot) else double.nan;
s3.SetStyle(curve.FIRM);
s3.SetDefaultColor(color.DaRK_RED);
s3.HideBubble();

plot r3 = if shouldPlot then prevHigh + 2 * (pivot - prevLow) else double.nan;
r3.SetStyle(curve.FIRM);
r3.SetDefaultColor(color.DaRK_GREEN);
r3.HideBubble();

pivot.setHiding(h and (lclose > r2 or lclose < s2));
r1.setHiding(h and lclose < s1);
r2.setHiding(h and lclose < r1);
r3.setHiding(h and lclose < r2);

s1.setHiding(h and lclose > r1);
s2.setHiding(h and lclose > s1);
s3.setHiding(h and lclose > s2);
#NexusOne: has a hide feature
######## EOC ##########
[QUOTE="BenTen, post: 1338, member: 1"]
Here are several ThinkorSwim indicators that show value areas based on Market Profile, ShadowTrader's Value Areas study, a scanner to look for Price in value area and volume spike.

[ATTACH=full]11574[/ATTACH]

[H3] Value Areas from the previous day[/H3]
[CODE=rich]
# Archive Name: Volume Profile with Expanded Intraday Period Selections plus the Prior Day's Value Areas
# Archive Section: Volume
# Suggested Tos Name: VolumeProfileIntradayPeriods_Unknown
# Archive Date: 5.05.2018
# Archive Notes: found in stanL's treebase but that crashed.  Mobius found this one.

#VolumeProfile with Expanded Intraday Period Selections plus the Prior Day's Value Areas
input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {CHART, MINUTE, MIN2, MIN3, MIN4, MIN5, MIN10, MIN15, MIN20, default MIN30, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = no;
input profiles = 1000;
input showPointOfControl = yes;
input showValueArea = yes;
input valueAreaPercent = 70;
input opacity = 20; # 5.05.2018 JQ original was 50

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 MIN2:
    period = Floor(seconds / 120 + day_number * 24);
case MIN3:
    period = Floor(seconds / 180 + day_number * 24);
case MIN4:
    period = Floor(seconds / 240 + day_number * 24);
case MIN5:
    period = Floor(seconds / 300 + day_number * 24);
case MIN10:
    period = Floor(seconds / 600 + day_number * 24);
case MIN15:
    period = Floor(seconds / 900 + day_number * 24);
case MIN20:
    period = Floor(seconds / 1200 + day_number * 24);
case MIN30:
    period = Floor(seconds / 1800 + day_number * 24);
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 volcount = if period != period[1] then  volume  else  volcount[1]+volume;
#addlabel(yes,volcount,color.white);
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 vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = CompoundValue(1, onExpansion, no);
def pc = if IsNaN(vol.GetPointOfControl()) and con then pc[1] else vol.GetPointOfControl();
def hVA = if IsNaN(vol.GetHighestValueArea()) and con then hVA[1] else vol.GetHighestValueArea();
def lVA = if IsNaN(vol.GetLowestValueArea()) and con then lVA[1] else vol.GetLowestValueArea();

def hProfile = if IsNaN(vol.GetHighest()) and con then hProfile[1] else vol.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) and con then lProfile[1] else vol.GetLowest();
def plotsDomain = IsNaN(close) == onExpansion;

plot POC = if plotsDomain then pc else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

vol.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(GlobalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(GlobalColor("Value Area"));
VALow.SetDefaultColor(GlobalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.Hide();
ProfileLow.Hide();

#Prior Day Profile - counting formula by functionform
rec count1 = CompoundValue(1, if !(GetDay() != GetDay()[1]) then count1[1] + 1 else 1, 1);
def priorperiod = if IsNaN(count1[1]) then 1 else Max(count1, count1[1]);
profile vol1 = VolumeProfile("startNewProfile" = GetDay() != GetDay()[1], "onExpansion" = no);

def vahprior = vol1.GetHighestValueArea();
def pocprior = vol1.GetPointOfControl();
def valprior = vol1.GetLowestValueArea();

plot vahprev = GetValue(vahprior, priorperiod);
vahprev.SetDefaultColor(Color.MAGENTA);
vahprev.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HORIZONTAL);
vahprev.SetLineWeight(1);
vahprev.HideBubble();

plot pocprev = GetValue(pocprior, priorperiod);
pocprev.SetDefaultColor(Color.MAGENTA);
pocprev.SetPaintingStrategy(PaintingStrategy.POINTS);
pocprev.SetLineWeight(1);
pocprev.HideBubble();

plot valprev = GetValue(valprior, priorperiod);
valprev.SetDefaultColor(Color.MAGENTA);
valprev.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HORIZONTAL);
valprev.SetLineWeight(1);
valprev.HideBubble();

Shareable Link: https://tos.mx/8RYZ99

Value Areas & Pivot Points by ShadowTrader

Code:
#------------------
#ShadowTrader VALUE AREA SCRIPT
#------------------
#http://shadowtrader.net/squawkfaq.pdf
#------------------
input VAHigh = 0.00;

input PointofControl = 0.00;

input VALow = 0.00;

input marketOpenTime = 0930;

input marketCloseTime = 1615;

input showcloud = yes;


def closeByPeriod = close(period = "DAY")[-1];

def openbyperiod = open(period = "DAY")[-1];

def VArea = if close >= VALow and close <= VAHigh then 1 else 0;

def secondsFromOpen = secondsFromTime(marketOpenTime);

def secondsTillClose = secondsTillTime(marketCloseTime);

def marketOpen = if secondsFromOpen >= 0 and secondsTillClose > 0 then yes else no;

def newDay = if !IsNaN(closeByPeriod) then 0 else 1;

 

plot VAH;

plot POC;

plot VAL;

if !IsNaN(close(period = "DAY")[-1])

then {

    VAH = Double.NaN;

    POC = Double.NaN;

    VAL = Double.NaN;

} else {

VAH = if marketOpen and newDay then VAHigh else double.nan;

POC = if marketOpen and newDay then pointofcontrol else double.nan;

VAL = if marketOpen and newDay then VALow else double.nan;

}

VAH.SetPaintingStrategy(paintingStrategy.line);

VAH.SetDefaultColor(color.darK_red);

VAH.SetLineWeight(2);

POC.SetPaintingStrategy(paintingStrategy.line);

POC.SetDefaultColor(color.DARK_ORANGE);

POC.SetLineWeight(2);

VAL.SetPaintingStrategy(paintingStrategy.line);

VAL.SetDefaultColor(color.darK_green);

VAL.SetLineWeight(2);

 

AddChartBubble (!IsNaN(VAH) and IsNaN(VAH[1]), VAH, "VAH", color.white, no);
AddChartBubble (!IsNaN(POC) and IsNaN(POC[1]), poc, "POC", color.white, no);
AddChartBubble (!IsNaN(VAL) and IsNaN(VAL[1]), val, "VAL", color.white, no);

 

plot cloudhigh = if marketOpen and newDay and showcloud then VAHigh else double.nan;

plot cloudlow = if marketOpen and newDay and showcloud then VALow else double.nan;

AddCloud (cloudhigh, cloudlow, color.yellow, color.yellow);

AddLabel(VArea, "In Value Area",  color.white);





#--------------------------------------
#NYSE AND NASDAQ BREADTH BUBBLE SCRIPT
#--------------------------------------

input length = 2;


#NYSE Breath ratio
def NYSEratio =  if (close("$UVOL") >= close("$DVOL")) then (close("$UVOL") / close("$DVOL")) else -( close("$DVOL") / close("$UVOL")) ;
plot NYratio = round(NYSEratio, length);


NYratio.DefineColor("NYSEup", color.UpTICK);
NYratio.DefineColor("NYSEdown", color.DownTICK);
NYratio.AssignValueColor(if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown"));

AddLabel(yes, concat(NYratio, " :1 NYSE"), (if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown")));



#Nasdaq Breath ratio
def NASDratio =  if (close("$UVOL/Q") >= close("$DVOL/Q")) then (close("$UVOL/Q") / close("$DVOL/Q")) else -( close("$DVOL/Q") / close("$UVOL/Q")) ;
plot Qratio = round(NASDratio, length);

Qratio.DefineColor("NASup", color.UpTICK);
Qratio.DefineColor("NASdown", color.DownTICK);
Qratio.AssignValueColor(if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown"));

AddLabel(yes, concat(Qratio, " :1 NASD"), (if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown")));


#ZeroLine

plot zeroline = 0;
zeroline.assignValueColor(if NYSEratio > NYSEratio[1] then color.GREEN else color.RED);
zeroline.setLineWeight(1);
zeroline.hideTitle();
zeroline.hideBubble();
###################################################

Scanner

Rich (BB code):
# Scan for Price in value area and volume spike
# Mobius
# Chat Room Request 04.05.2018
def yyyymmdd = GetYYYYMMDD();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period = Floor(day_number / 7);
def cond = 0 < period - period[1];
profile vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = no);
vol.Show("va color" = Color.YELLOW);
def b = vol.GetHighestValueArea();
def a = vol.GetLowestValueArea();
plot condition = between(close, a, b) and volume > Average(volume, 21);

Pivot Levels

Code:
#######NexusOne code for pivot plus 3 levels of Support & Resistance####################
 #NexusOne: Also use this as a template source for code
#Mobius: the calculations for pivots are based on the prior days open high low and close. Nothing else.
input DynamicHide = {"No", default "Yes"};
input showOnlyToday = YES;
input Market_Open_Time = 0830;
input Market_Close_Time = 1616;


def h = DynamicHide;
def day = getDay();
def lastDay = getLastDay();
def isToday = if(day == lastDay, 1, 0);
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));

def pastOpen = if((secondsTillTime(Market_Open_Time) > 0), 0, 1);
def pastClose = if((secondsTillTime(Market_Close_Time) > 0), 0, 1);
def marketOpen = if(pastOpen and !pastClose, 1, 0);
def firstBar = if (day[1] != day, 1, 0);

def closingBell = if secondsTillTime(Market_Close_Time)[1] > 0 and
secondsTillTime(Market_Close_Time) <= 0 or
(secondsTillTime(Market_Close_Time)[1] < secondsTillTime(Market_Close_Time)
and secondsTillTime(Market_Close_Time)[1] > 0) then 1 else 0;

rec lclose = if IsNaN(close[-1]) then lclose[1] else close;
rec regHoursHigh = if(high > regHoursHigh[1] and marketOpen, high,
if(marketOpen and !firstBar, regHoursHigh[1], high));
rec regHoursLow = if(low < regHoursLow[1] and marketOpen, low,
if(marketOpen and regHoursLow[1] > 0 and !firstBar, regHoursLow[1], low));

rec runningClose = compoundValue(1, if closingbell then close[1] else runningClose[1], close);
rec prevClose = compoundValue(1, if closingBell then runningClose else prevClose[1], close);
rec prevHigh = compoundValue(1, if closingBell then regHoursHigh[1] else prevHigh[1], high);
rec prevLow = compoundValue(1, if closingBell then regHourslow[1] else prevlow[1], low);
rec prevHigh2 = compoundValue(1, if closingBell then prevHigh[1] else prevHigh2[1], high);
rec prevLow2 = compoundValue(1, if closingBell then prevLow[1] else prevlow2[1], low);


plot pivot = if shouldPlot then (prevHigh + prevClose + prevLow) / 3 else double.nan;
pivot.SetStyle(curve.FIRM);
pivot.SetDefaultColor(color.VIOLET);
pivot.HideBubble();


plot s1 = if shouldPlot then (2 * pivot) - prevHigh else double.nan;
s1.SetStyle(curve.FIRM);
s1.SetDefaultColor(color.dark_RED);
s1.HideBubble();

plot r1 = if shouldPlot then (2 * pivot) - prevLow else double.nan;
r1.SetStyle(curve.FIRM);
r1.SetDefaultColor(color.DaRK_GREEN);
r1.HideBubble();

plot r2 = if shouldPlot then pivot + ( r1 - s1) else double.nan;
r2.SetStyle(curve.FIRM);
r2.SetDefaultColor(color.DaRK_GREEN);
r2.HideBubble();

plot s2 = if shouldPlot then pivot - ( r1 - s1) else double.nan;
s2.SetStyle(curve.FIRM);
s2.SetDefaultColor(color.DaRK_RED);
s2.HideBubble();

plot s3 = if shouldPlot then prevLow - 2 * (prevHigh - pivot) else double.nan;
s3.SetStyle(curve.FIRM);
s3.SetDefaultColor(color.DaRK_RED);
s3.HideBubble();

plot r3 = if shouldPlot then prevHigh + 2 * (pivot - prevLow) else double.nan;
r3.SetStyle(curve.FIRM);
r3.SetDefaultColor(color.DaRK_GREEN);
r3.HideBubble();

pivot.setHiding(h and (lclose > r2 or lclose < s2));
r1.setHiding(h and lclose < s1);
r2.setHiding(h and lclose < r1);
r3.setHiding(h and lclose < r2);

s1.setHiding(h and lclose > r1);
s2.setHiding(h and lclose > s1);
s3.setHiding(h and lclose > s2);
#NexusOne: has a hide feature
######## EOC ##########
Ben, I have down loaded the Shareable Link: https://tos.mx/8RYZ99 from very top. All I want to appear in My Charts is Value Area HI, Value Area Low & Point of Control. I think that is also what you show on your chart. How should the setting be. I have placed it on a 15 minutes chart & looks Like each bar is getting VAs & POC .
[/QUOTE]
 
@ssmike123 I can't really answer your question because your chart does not look like the indicator. The top purple line is prior high, purple dots is the prior poc and the bottom purple is the prior low. Where are the purple lines on your chart? Try removing all other studies and cutting&pasting the actual code above. To just keep the purple, unplot everything else in settings except vahprior, pocprior, and valprior which are the purple plots.
def vahprior = vol1.GetHighestValueArea();
def pocprior = vol1.GetPointOfControl();
def valprior = vol1.GetLowestValueArea();
a2.png
 
@ssmike123 I can't really answer your question because your chart does not look like the indicator. The top purple line is prior high, purple dots is the prior poc and the bottom purple is the prior low. Where are the purple lines on your chart? Try removing all other studies and cutting&pasting the actual code above. To just keep the purple, unplot everything else in settings except vahprior, pocprior, and valprior which are the purple plots.
def vahprior = vol1.GetHighestValueArea();
def pocprior = vol1.GetPointOfControl();
def valprior = vol1.GetLowestValueArea();
View attachment 764
I was able to Fix the issue, The "Time Per Profile" needed to Be set at "DAY." And also set the "opacity" to "0" . Not sure what the "Value Area Percentage" is for. Turned all lines off except for VAH, VAL, & POC
 
Hi, for the first study, 'Value Areas from the previous day', is there any way to have that study show today only? I tried adding that function into the study but it didn't do anything. What I'm interested in is having the study only display on the current day, showing the previous day values (VAH, VAL, POC).
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
404 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top