VWAP Aspect Slope Indicator request
Forums › ProRealTime English forum › ProBuilder support › VWAP Aspect Slope Indicator request
- This topic has 21 replies, 2 voices, and was last updated 3 months ago by Bogren.
-
-
03/18/2017 at 2:41 PM #29027
Hi Guys , new to the forum just wanted to ask – do you know if there is an indicator in the works to display the VWAP slope aspect ratio – this would display gradient of the VWAP slope more clearly.
An example attached from TOS charting software Appreciate any feedback Also do you know if volume is to be added to US stocks anytime soon …
03/18/2017 at 3:27 PM #29028I don’t think this indicator is already available here. I’m using VWAP myself, I’m interested in anything related to Volumes. I can help recode this indi for PRT of course but there is no attachment in your post. Please try to upload it again with any codes you could find from other platform. Thanks
03/22/2017 at 6:26 AM #2938803/23/2017 at 11:32 AM #29567Hi Guys ,
Please find attached the code from TOS for the VWAP aspect ratio – this is useful as it displays the slope of the VWAP in a bar graph format.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197#hint: Plots position (distance relative to VWAP, expressed in standard deviations), intensity (VWAP slope), or a comparison of current-vs.-historical-average VWAP deviation width across the (user-defined) chart length.#hint Aspect: Displays either position (distance relative to VWAP, expressed in standard deviations), intensity (VWAP slope), or current-vs.-historical-average VWAP deviation width.#hint Slope_length: The number of bars over which the VWAP slope is calculated. (default = 5, calibrated for a 1min chart basis)#hint Price_Color: [BETA] Displays price colorization in accordance with likely trend signal (or not).#hint Zeroline_Color: Displays yellow highlighting when current deviation width exceeds the chart length's average width.#hint Slope_Style: Choose display style for slope (Segment subdivides brackets of slope intensity, while Gradient calls a dynamic gradient for the current day).#hint Sensitivity: Choose the level of preset sensitivity according to trading product type.#hint Custom_Sensitivity: User-defined coefficient for displaying Slope values in appropriate context for a given product.#hint Slope_Trend: Displays highlighting at the upper and lower extremes of the slope plot to signify consistent directionality of slope (indicative of sustained long or short activity).declare lower;input Aspect = {"Position", default "Slope", "DevWidth"};input Slope_length = 5;input Price_Color = no;input Zeroline_Color = yes;input Slope_Style = {default Segment, Gradient};input Sensitivity = {default Large_Cap, Small_Cap, ETF_or_Index, Futures, Custom};input Custom_Sensitivity = 10;input Slope_Trend = yes;def Equities_Futures = if TickValue() * TickSize() == 0.0001 then 1 else 0;def coefficient;switch (Sensitivity) {case Small_Cap:coefficient = 5;case ETF_or_Index:coefficient = 3;case Futures:coefficient = 2;case Custom:coefficient = Custom_Sensitivity;default:coefficient = 1;};def SecondsFromStart = (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 1000;def time = if SecondsFromStart < 0 then -1 else if Between(SecondsFromStart, 0, 1200) then 0 else if Between(SecondsFromStart, 1200, 1800) then 1 else if SecondsFromStart > 1800 then 2 else Double.NaN;def NewDay = CompoundValue(1, GetYYYYMMDD() != GetYYYYMMDD()[1] and !IsNaN(close), yes);def DayCount = TotalSum(NewDay);def BarNo = if NewDay then 1 else BarNo[1] + 1;def minor = 2;def major = 10;def VW = reference VWAP();def VWone = reference VWAP(-1.0, 1.0)."UpperBand";def deviation = VWone - VW;def current_price = close;def pureslope = (VW - VW[Slope_length]) / Slope_length;def adjustedslope = (pureslope / current_price) * 100000 * coefficient;plot slope = if aspect == aspect."Slope" then if Slope_Style == Slope_Style."Segment" then if adjustedslope > 0 then Min(10, adjustedslope) else Max(-10, adjustedslope) else if adjustedslope > 0 then Min(12, adjustedslope) else Max(-12, adjustedslope) else Double.NaN;slope.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);slope.AssignValueColor(if slope >= major then Color.GREEN elseif Between(slope, minor, major) then Color.GREEN elseif Between(slope, minor/2, minor) then Color.WHITE elseif Between(slope, -minor, -minor/2) then Color.WHITE elseif Between(slope, -major, -minor) then Color.RED elseif slope <= -major then Color.RED else Color.BLACK);slope.SetHiding(Aspect != Aspect."Slope" or (Aspect == Aspect."Slope" and Slope_Style == Slope_Style."Gradient"));plot slope_highlight = if aspect == aspect."Slope" and !Between(adjustedslope,-major,major) then if adjustedslope > 0 then Min(12, adjustedslope) else Max(-12, adjustedslope) else Double.NaN;slope_highlight.SetDefaultColor(color.ORANGE);slope_highlight.SetPaintingStrategy(paintingstrategy.HISTOGRAM);slope_highlight.SetHiding(Slope_Style == Slope_Style."Gradient");def Pos_Slope = if Slope_Style == Slope_Style."Gradient" then if slope > 0 then slope else Double.NaN else Double.NaN;def Neg_Slope = if Slope_Style == Slope_Style."Gradient" then if slope < 0 then slope else Double.NaN else Double.NaN;plot Slope_Pos = Round(Pos_Slope, 2);Slope_Pos.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);Slope_Pos.AssignNormGradientColor(BarNo + 1, Color.WHITE, Color.GREEN);Slope_Pos.SetHiding(Aspect != Aspect."Slope" or (Aspect == Aspect."Slope" and Slope_Style == Slope_Style."Segment"));plot Slope_Neg = Round(Neg_Slope);Slope_Neg.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);Slope_Neg.AssignNormGradientColor(BarNo + 1, Color.RED, Color.WHITE);Slope_Neg.SetHiding(Aspect != Aspect."Slope" or (Aspect == Aspect."Slope" and Slope_Style == Slope_Style."Segment"));def DevRec = if time == 2 then deviation else DevRec[1];def AccumDev = if time == 2 then AccumDev[1] + DevRec else AccumDev[1];def Count = CompoundValue(1, if time == 2 then Count[1] + 1 else Count[1], 0);def Avg_Dev_Width = CompoundValue(1800 / (GetAggregationPeriod() / 1000), AccumDev / Count, 0);plot zeroline = 0;zeroline.SetLineWeight(if Aspect == Aspect."Slope" and Slope_Style == Slope_Style."Segment" then 2 else 1);zeroline.SetPaintingStrategy(if (Aspect == Aspect."Slope" and Slope_Style == Slope_Style."Segment") then PaintingStrategy.POINTS else PaintingStrategy.LINE);zeroline.AssignValueColor(if Aspect == Aspect."Slope" then Color.BLACK else if Aspect == Aspect."DevWidth" then if deviation > Avg_Dev_Width then Color.ORANGE else Color.LIGHT_GRAY else if Aspect == Aspect."Position" then Color.LIGHT_GRAY else Color.BLACK);plot R1 = if Aspect == Aspect."Slope" and slope < minor then minor else Double.NaN;R1.SetPaintingStrategy(PaintingStrategy.DASHES);R1.SetDefaultColor(CreateColor(255, 236, 139));plot S1 = if Aspect == Aspect."Slope" and slope > -minor then -minor else Double.NaN;S1.SetPaintingStrategy(PaintingStrategy.DASHES);S1.SetDefaultColor(CreateColor(255, 236, 139));plot R2 = if Aspect == Aspect."Slope" and slope < major then major else Double.NaN;R2.SetPaintingStrategy(PaintingStrategy.DASHES);R2.SetDefaultColor(Color.ORANGE);plot S2 = if Aspect == Aspect."Slope" and slope > -major then -major else Double.NaN;S2.SetPaintingStrategy(PaintingStrategy.DASHES);S2.SetDefaultColor(Color.ORANGE);def upper = if Slope_Trend and Aspect == Aspect."Slope" and slope > 0 and slope[1] > 0 and slope[10] > 0 then 12.5 else Double.NaN;def lower = if Slope_Trend and Aspect == Aspect."Slope" and slope < 0 and slope[1] < 0 and slope[10] < 0 then -12.5 else Double.NaN;AddCloud(if Aspect == Aspect."Slope" then minor else Double.NaN, if Aspect == Aspect."Slope" then -minor else Double.NaN, Color.LIGHT_GRAY, Color.WHITE);AddCloud(upper, 12, Color.CYAN, Color.WHITE);AddCloud(-12, lower, Color.MAGENTA, Color.WHITE);plot DfV =if Aspect == Aspect."Position" thenif GetYYYYMMDD() == GetYYYYMMDD()[1] thenif time >= 1 thenif ((close - VW) / deviation) <= -3 then -3else if ((close - VW) / deviation) >= 3 then 3else ((close - VW) / deviation)else 0else Double.NaNelse Double.NaN;def z = if Aspect == Aspect."Position" then 0 else Double.NaN;AddCloud(DfV, z, Color.LIGHT_GREEN, Color.LIGHT_RED);DfV.AssignNormGradientColor(14, Color.LIGHT_RED, Color.LIME);plot U2 = if Aspect == Aspect."Position" then 2 else Double.NaN;U2.SetDefaultColor(Color.DARK_GREEN);U2.AssignValueColor(if DfV > U2 then Color.YELLOW else Color.DARK_GREEN);U2.SetLineWeight(2);plot U1 = if Aspect == Aspect."Position" then 1 else Double.NaN;U1.SetDefaultColor(Color.LIGHT_GREEN);U1.AssignValueColor(if DfV > U1 then Color.YELLOW else Color.LIGHT_GREEN);U1.SetStyle(Curve.SHORT_DASH);U1.HideTitle();plot U25 = if Aspect == Aspect."Position" then 2.5 else Double.NaN;U25.SetDefaultColor(Color.DARK_GREEN);U25.AssignValueColor(if DfV > U25 then Color.YELLOW else Color.DARK_GREEN);U25.SetStyle(Curve.SHORT_DASH);U25.HideTitle();plot L2 = if Aspect == Aspect."Position" then -2 else Double.NaN;L2.SetDefaultColor(Color.DARK_RED);L2.AssignValueColor(if DfV < L2 then Color.YELLOW else Color.DARK_RED);L2.SetLineWeight(2);plot L1 = if Aspect == Aspect."Position" then -1 else Double.NaN;L1.SetDefaultColor(Color.LIGHT_RED);L1.AssignValueColor(if DfV < L1 then Color.YELLOW else Color.LIGHT_RED);L1.SetStyle(Curve.SHORT_DASH);L1.HideTitle();plot L25 = if Aspect == Aspect."Position" then -2.5 else Double.NaN;L25.SetDefaultColor(Color.DARK_RED);L25.AssignValueColor(if DfV < L25 then Color.YELLOW else Color.DARK_RED);L25.SetStyle(Curve.SHORT_DASH);L25.HideTitle();plot Signal_Line = if Aspect == Aspect."DevWidth" then 0 - Round((Avg_Dev_Width / 3), 2) else Double.NaN;Signal_Line.SetDefaultColor(Color.LIGHT_GRAY);Signal_Line.SetStyle(Curve.SHORT_DASH);plot difference = if Aspect == Aspect."DevWidth" then if GetYYYYMMDD() != GetYYYYMMDD()[1] then Double.NaN else Round(deviation - (Avg_Dev_Width), 2) else Double.NaN;difference.AssignValueColor(if difference > 0 then Color.CYAN else if difference < Signal_Line then Color.RED else Color.WHITE);difference.SetLineWeight(1);difference.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);difference.Hide();AddLabel(Aspect == Aspect."DevWidth", "Avg. StDev: " + AsDollars(Round(Avg_Dev_Width, 2)), Color.WHITE);AddLabel(Aspect == Aspect."DevWidth", " ", Color.BLACK);AddLabel(Aspect == Aspect."DevWidth", "Current StDev: " + AsDollars(Round(deviation, 2)), if difference >= 0 then Color.LIGHT_GREEN else Color.PINK);AddLabel(Aspect == Aspect."DevWidth", " ", Color.BLACK);AddLabel(if difference > 0 then yes else no, "Diff: +" + AsDollars(Round(difference, 2)) + " (" + AsPercent(1 + Round(difference / Avg_Dev_Width, 2)) + " of Avg.)", Color.LIGHT_GREEN);AddLabel(if difference <= 0 then yes else no, "Diff: -$" + AbsValue(Round(difference, 2)) + " (" + AsPercent(1 + Round(difference / Avg_Dev_Width, 2)) + " of Avg.)", Color.PINK);AddCloud(difference, zeroline, CreateColor(50, 237, 190), Color.CURRENT);def conditional = Min(zeroline, Max(Signal_Line, difference));AddCloud(conditional, Signal_Line, CreateColor(144, 195, 212), Color.CURRENT);AddCloud(Signal_Line, difference, Color.PINK, Color.CURRENT);AddVerticalLine(if NewDay then yes else no , "", Color.DARK_GRAY, Curve.FIRM);AssignPriceColor(if Price_Color thenif difference > zeroline and Between(close, VW, VW + deviation) then Color.WHITE elseif difference > zeroline and close > (VW + deviation) then Color.GREEN elseif difference > zeroline and Between(close, VW - deviation, VW) then Color.WHITE elseif difference > zeroline and close < (VW - deviation) then Color.RED elseColor.DARK_GRAY else Color.CURRENT);#plot typicaldevwidth_upper = VW + (Avg_Dev_Width);#plot typicaldevwidth_lower = VW - (Avg_Dev_Width);03/23/2017 at 12:58 PM #29591Added as text file as well
03/24/2017 at 7:41 PM #29780Hi guys any suggestions regarding the code i have uploaded from TOS for Volume aspect Ratio
Thanks
03/27/2017 at 3:24 PM #30006Would someone kindly look into this and see if it is possible please ?
03/27/2017 at 3:26 PM #3000703/28/2017 at 9:39 AM #30076Hi Nicolas,
I have added 2 screen shots – the first screen shot you can below the volume graph the aspect ratio bar graph – this will indicate the slope of the VWAP as at time it it hard to visually see the gradient of the VWAP. The more agressive the slope the higher the aspect ratio will be displayed – indicating a strong trend.
In the second screen shot where the VWAP is more or less flat you will see that there is no aspect ratio displayed which means that the we are non trending .
Hope this is clear.
Many thanks
03/28/2017 at 2:29 PM #30154This is a test on FB share like you did. I’m wondering if you use the “SlopeTrend” setting? because your upper and lower levels seems to be at 10 and -10 instead of 12.5 / -12.5 when using this parameter is set to true. If the slope exceeds the upper treshold, yellow dots appears? and what is the color for the lower piercing (don’t see it in your example), I can retrieve it in the code, but I want to be sure.
What is the coefficient you use for share like Facebook? Cause it’s not possible to automatically adapt this coefficient (probuilder can’t recognize the current instrument on chart ..), you’ll have to set yourself the “Custom_Sensitivity” variable to your needs.
There are different kind of rendering of this indicator in the code, are you only using the “Slope” one? (like it is in your screenshots).
03/31/2017 at 11:10 AM #3048511/28/2017 at 12:48 PM #5425311/28/2017 at 2:49 PM #54277That’s right, I was hoping @scarface34 could answer my questions. I think this indicator has definitely something very interesting to explore! Anyway, please find attached the code in its current state I made in March this year, with an example on DAX and FTSE today.
11/28/2017 at 2:55 PM #5428111/30/2017 at 12:02 PM #54415candlevolume is also useful and dont need any coding
http://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:candlevolume
-
AuthorPosts
Find exclusive trading pro-tools on