thank you Soo MuCH For your time, highly Appreciated,,, may you have a great and profitable trading day Today!!!!!!The modified addlabel (not addchartbubble as mentioned} is now in your code below
Here is the MonkeyBars indicator in the image;s chart at the top and the Standard Volumeprofile in the chart bekiw,Hi, Is there any custom study/code available in TOS to mimic the Volume Profile indicator in Trading view? I know there is VolumeProfile Indicator in TOS but it is plotting from left to right. I am looking for one which is plotting right to left on right axis. Thanks in advance.
see code below, it is not prompting any syntax error however it seems to not be reading the oversold 30/overbought70 area, so its only changing candles red and green,,, any ssiatnce would eb greatly appreciated, i had retracted previous message thinking i had figured it outHere is the MonkeyBars indicator in the image;s chart at the top and the Standard Volumeprofile in the chart bekiw,
Hi @SleepyZHere are the modifications to the MonkeyBar Indicator that were suggested above by @JT_479. The image shows the normal volumeprofile script on the left and the modified MonkeyBars on the right expansion.
This worked for me, I wanted Volume Profile on the left hand side, to show as other platforms normally have it. added VolumeProfile on study, and had to uncheck the Settings option to not show in expansion area.on expansion = to no
2. I would like to plot a horizontal line for the VAH and VAL like shown in the picture below and i want them to show only on the current day starting from 4AM going forward when used on expansion. Can this be done either on this monkeybar style VP or the regular TOS VP?
Anyone can help me adding the horizontal lines for the VAH & VAL? Thanks in advance
Ruby:# # TD Ameritrade IP Company, Inc. (c) 2010-2022 # # TOS Monkey Bars modified to show it's volumeprofile in the expansion to pointing to the left. A volumeprofile snippet was added to display the valuearea, poc, vah and val in the chart area as the monkeybars needs to remain set to onexpansion. input pricePerRowHeightMode = {AUTOMATIC, default TICKSIZE, CUSTOM}; input customRowHeight = 1.0; input aggregationPeriod = {"1 min", "2 min", "3 min", "4 min", "5 min", "10 min", "15 min", "20 min", "30 min", "1 hour", "2 hours", "4 hours", default "Day", "2 Days", "3 Days", "4 Days", "Week", "Month", "Quarter", "Year"}; input timePerProfile = {CHART, MINUTE, HOUR, default DAY, WEEK, MONTH, "OPT EXP", BAR, YEAR}; input multiplier = 1; input onExpansion = yes; input profiles = 1000; input showMonkeyBar = no; input showThePlayground = no; input thePlaygroundPercent = 70; input opacity = 40; input emphasizeFirstDigit = no; input markOpenPrice = no; input markClosePrice = no; input volumeShowStyle = MonkeyVolumeShowStyle.ALL; input showVolumeVA = no; input showVolumePoc = no; input theVolumePercent = 70; input showInitialBalance = no; input initialBalanceRange = 3; def period; def yyyymmdd = GetYYYYMMDD(); def seconds = SecondsFromTime(0); def year = GetYear(); def month = year * 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 periodMin = Floor(seconds / 60 + day_number * 24 * 60); def periodHour = Floor(seconds / 3600 + day_number * 24); def periodDay = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1; def periodWeek = Floor(day_number / 7); def periodMonth = month - First(month); def periodQuarter = Ceil(month / 3) - First(Ceil(month / 3)); def periodYear = year - First(year); switch (timePerProfile) { case CHART: period = 0; case MINUTE: period = periodMin; case HOUR: period = periodHour; case DAY: period = periodDay; case WEEK: period = periodWeek; case MONTH: period = periodMonth; case "OPT EXP": period = exp_opt - First(exp_opt); case BAR: period = BarNumber() - 1; case YEAR: period = periodYear; } def count = CompoundValue(1, if period != period[1] then (GetValue(count, 1) + period - period[1]) % multiplier else GetValue(count, 1), 0); def cond = CompoundValue(1, count < count[1] + period - period[1], yes); def height; switch (pricePerRowHeightMode) { case AUTOMATIC: height = PricePerRow.AUTOMATIC; case TICKSIZE: height = PricePerRow.TICKSIZE; case CUSTOM: height = customRowHeight; } def timeInterval; def aggMultiplier; switch (aggregationPeriod) { case "1 min": timeInterval = periodMin; aggMultiplier = 1; case "2 min": timeInterval = periodMin; aggMultiplier = 2; case "3 min": timeInterval = periodMin; aggMultiplier = 3; case "4 min": timeInterval = periodMin; aggMultiplier = 4; case "5 min": timeInterval = periodMin; aggMultiplier = 5; case "10 min": timeInterval = periodMin; aggMultiplier = 10; case "15 min": timeInterval = periodMin; aggMultiplier = 15; case "20 min": timeInterval = periodMin; aggMultiplier = 20; case "30 min": timeInterval = periodMin; aggMultiplier = 30; case "1 hour": timeInterval = periodHour; aggMultiplier = 1; case "2 hours": timeInterval = periodHour; aggMultiplier = 2; case "4 hours": timeInterval = periodHour; aggMultiplier = 4; case "Day": timeInterval = periodDay; aggMultiplier = 1; case "2 Days": timeInterval = periodDay; aggMultiplier = 2; case "3 Days": timeInterval = periodDay; aggMultiplier = 3; case "4 Days": timeInterval = periodDay; aggMultiplier = 4; case "Week": timeInterval = periodWeek; aggMultiplier = 1; case "Month": timeInterval = periodMonth; aggMultiplier = 1; case "Quarter": timeInterval = periodQuarter; aggMultiplier = 1; case "Year": timeInterval = periodYear; aggMultiplier = 1; } def agg_count = CompoundValue(1, if timeInterval != timeInterval[1] then (GetValue(agg_count, 1) + timeInterval - timeInterval[1]) % aggMultiplier else GetValue(agg_count, 1), 0); def agg_cond = CompoundValue(1, agg_count < agg_count[1] + timeInterval - timeInterval[1], yes); def digit = CompoundValue(1, if cond then 1 else agg_cond + GetValue(digit, 1), 1); profile monkey = MonkeyBars(digit, "startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "the playground percent" = thePlaygroundPercent, "emphasize first digit" = emphasizeFirstDigit, "volumeProfileShowStyle" = volumeShowStyle, "volumePercentVA" = theVolumePercent, "show initial balance" = showInitialBalance, "initial balance range" = initialBalanceRange); def con = CompoundValue(1, onExpansion, no); def mbar = CompoundValue(1, if IsNaN(monkey.GetPointOfControl()) and con then GetValue(mbar, 1) else monkey.GetPointOfControl(), monkey.GetPointOfControl()); def hPG = CompoundValue(1, if IsNaN(monkey.GetHighestValueArea()) and con then GetValue(hPG, 1) else monkey.GetHighestValueArea(), monkey.GetHighestValueArea()); def lPG = CompoundValue(1, if IsNaN(monkey.GetLowestValueArea()) and con then GetValue(lPG, 1) else monkey.GetLowestValueArea(), monkey.GetLowestValueArea()); def hProfile = CompoundValue(1, if IsNaN(monkey.GetHighest()) and con then GetValue(hProfile, 1) else monkey.GetHighest(), monkey.GetHighest()); def lProfile = CompoundValue(1, if IsNaN(monkey.GetLowest()) and con then GetValue(lProfile, 1) else monkey.GetLowest(), monkey.GetLowest()); def plotsDomain = IsNaN(close) == onExpansion; #plot MB = if plotsDomain then mbar else Double.NaN; plot ProfileHigh = if plotsDomain then hProfile else Double.NaN; plot ProfileLow = if plotsDomain then lProfile else Double.NaN; DefineGlobalColor("Monkey Bar", GetColor(4)); DefineGlobalColor("The Playground", GetColor(3)); DefineGlobalColor("Open Price", GetColor(1)); DefineGlobalColor("Close Price", GetColor(1)); DefineGlobalColor("Volume", Color.CYAN); DefineGlobalColor("Volume Value Area", GetColor(8)); DefineGlobalColor("Volume Point of Control", Color.RED); DefineGlobalColor("Initial Balance", GetColor(7)); monkey.Show(color = Color.CYAN, "poc color" = Color.CURRENT, "va color" = Color.CURRENT, opacity = opacity, "open color" = Color.CURRENT, "close color" = Color.CURRENT, "ib color" =Color.CURRENT, "volume color" = color.cyan, "volume poc color" = Color.CURRENT); ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); ProfileHigh.SetDefaultColor(GetColor(3)); ProfileLow.SetDefaultColor(GetColor(3)); ProfileHigh.Hide(); ProfileLow.Hide(); #VolumeProfile snippet to display profile on last Timeperprofile on chart input show_valuearea_color = yes; profile vol = VolumeProfile(startnewprofile = cond, onExpansion = no, pricePerRow = PricePerRow.TICKSIZE, numberofprofiles = 1, "value area percent" = 70); vol.Show(opacity = opacity, "volume va color" = Color.CURRENT, color = Color.CURRENT, "volume color" = Color.CURRENT, "volume poc color" = Color.DARK_RED, "va color" = if show_valuearea_color == yes then GetColor(8) else Color.CURRENT); 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(); plot poc = pc; plot vah = hVA; plot val = lVA; vah.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); val.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); poc.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); vah.SetDefaultColor(Color.YELLOW); val.SetDefaultColor(Color.YELLOW); poc.SetDefaultColor(Color.RED);
#
# Quant Trading App Volume Profile
# Created: September 15, 2021
#
# Credit: Bryant Littrean, Thinkorswim
# Contact: [email protected]
# Trading Litt Youtube: https://bit.ly/trading-litt-yt
# Quant Trading App Discord: https://quanttradingdiscord.com
#
def multiplier = 1;
def onExpansion = no;
def profiles = 1000;
input showPointOfControl = yes;
input showValueArea = yes;
input valueAreaPercent = 68;
input opacity = 60; 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);
period = countTradingDays(min(first(yyyymmdd), yyyymmdd), yyyymmdd) - 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 = PricePerRow.TICKSIZE;
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", CreateColor(70, 70, 70));
DefineGlobalColor("Point Of Control", CreateColor(255, 215, 0));
DefineGlobalColor("Value Area", CreateColor(95, 140, 230));
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);
POC.SetLineWeight(2);
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.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
O | compare cumulative volume in a measured move | Questions | 1 | |
S | Plot expected move on chart | Questions | 2 | |
T | 20% Daily Move Scan | Questions | 0 | |
S | How do I move chartbubbles to the right side | Questions | 1 | |
J | Candle price move | Questions | 1 |
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.