Looking to modify the Volume profile to show 2 days of volume _ Today and Yesterday only
thanks
![]()
Code:#VolumeProfile_xNumberofDays_IncludingToday #UseThinkscript request #20210615 # # TD Ameritrade IP Company, Inc. (c) 2010-2021 # input number_of_days_profiles = 2; def ymd = GetYYYYMMDD(); def ok = !IsNaN(close); def capture = ok and ymd != ymd[1]; def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0); def thisDay = (HighestAll(dayCount) - dayCount) + 1; input pricePerRowHeightMode = {default AUTOMATIC, TICKSIZE, CUSTOM}; input customRowHeight = 1.0; input onExpansion = no; def profiles = number_of_days_profiles; input showPointOfControl = yes; input showValueArea = yes; input valueAreaPercent = 70; input opacity = 50; 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 cond =thisday>number_of_days_profiles; 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();
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
You don't need to touch any code to do this. In the VolumeProfile study's settings, set time per profile to DAY and multiplier to 2. Set profiles to 1 if you only want to see the current profile.
time per profile | Defines time interval to compile the volume data for the histogram. Setting this parameter to "CHART" involves the entire price plot into calculation. Values "BAR", "MINUTE", "HOUR", "DAY", "WEEK", "MONTH", and "OPT EXP" allow you to set aggregation manually, specifying number of these periods within the "multiplier" input. |
I only use the volumeprofile set to day for intraday charts. I look for symbols where the underlying reacts positively to the profiles value areas and poc. I would recommend you use that criteria to determine the best profile settings at daily and higher charts.If doing swings using a daily chart what should i set the colume profile too, WEEK?
how about for a weekly chart, MONTH?
i used a 1Y1D chart and using CHART i think the profile is kinda too wide
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
![]() |
Bubbles not posting on Volume Profile? | Questions | 2 | |
D | Volume Profile Custom Value Area | Questions | 1 | |
R | Daily Volume Profile | Questions | 1 | |
R | Volume Profile Scan | Questions | 1 | |
![]() |
Volume Profile for 1st hour only | Questions | 5 |
Start a new thread and receive assistance from our community.
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.
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.