Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

dbntina

VWAP Indicator with 1SD and 2SD bands

Recommended Posts

Hi there,

 

See your PM's. Am travelling at the moment but the current work is complete however I now want to incorporate multi day stuff and a histogram. The stuff that DBNTina is absolutely fine btw it ust cane be a little sluggish loading up...results are pretty much the same. That should do as a stopgap.

 

Cheers,

Nick

Share this post


Link to post
Share on other sites
Does anyone know whether the VWAP indicator downloadable from this thread is almost 100% accurate? Or does it need further adjustments?

 

Thanks.

 

Its 100% accurate on tick charts. To be honest on 2 minute charts its fine too. Its actually the PvP that can change characteristics on 2 minute bars. Dbntina posted an indicator that gets round that by using ADE to take data from a tick chart and push it to an X minute chart.

 

Cheers.

Share this post


Link to post
Share on other sites
add a 3rd SD, as this is the way Jerry teaches it? Bryan

 

Please find below in the code box the complete code listing for Jay who asked for it in August and for Bryan, just add the last three lines of this listing to the bottom of your indicator code:

 

input : trdSD (3);

Plot6(VolWAPValue + (trdSD*VolWAPSD), "VWAP3SDUp");

Plot7(VolWAPValue - (trdSD*VolWAPSD), "VWAP3SDDown");

 

The third SD is now an input, allowing you to use different numbers. There is nothing magical about '3'; it all depends on how many are following it and how strong the trend. Sometimes 2.5 works better.

attachment.php?attachmentid=4591&stc=1&d=1198255005


{***********************************************************************************************

Coded by dbntina/boxmeister 8/2/2007

Used the VWAP_H code provided by Tradestation on 02/07/2003 Topic ID = 6735 Thanks Guys!

Added the computation for variance and the Standard Deviation to combine into one indicator
plot and this indicator plots the VWAP, SD1 bands and SD2 bands

***********************************************************************************************}



[LegacyColorValue = true];

vars:
	PriceW(0),
	ShareW(0),
	Count(0),
	VolWAPValue(0),
	VolWAPVariance(0),
	VolWAPSD(0);


if date > date[1] then begin
	PriceW = 0;
	ShareW = 0;
	Count = -1;
	Value1 = 0;
	Value2 = 0;
	VolWAPValue = 0;
end;

PriceW = PriceW + (AvgPrice * (UpTicks+DownTicks));
ShareW = ShareW + (UpTicks+DownTicks);
Count = Count + 1;
Value3 = 0;

if ShareW > 0 then VolWAPValue = PriceW / ShareW;

{Calculate the individual variance terms for each intraday bar starting with the current
bar and looping back through each bar to the start bar.  The terms are each normalized
according to the Variance formula for each level of volume at each price bar			}

	For Value1 = 0 To Count Begin
	Value2 = ((UpTicks[Value1]+DownTicks[Value1])/ShareW) * (Square(AvgPrice[Value1]-VolWAPValue));
	Value3 = Value3 + Value2;
End;

VolWAPVariance = Value3;
VolWAPSD = SquareRoot(VolWAPVariance);


Plot1(VolWAPValue, "VWAP");
Plot2(VolWAPValue + VolWAPSD, "VWAP1SDUp");
   Plot3(VolWAPValue - VolWAPSD, "VWAP1SDDown");
Plot4(VolWAPValue + (2*VolWAPSD), "VWAP2SDUp");
   Plot5(VolWAPValue - (2*VolWAPSD), "VWAP2SDDown");
// added by request http://www.traderslaboratory.com/forums/f46/vwap-indicator-with-1sd-and-2sd-2175.html#post27273
input : trdSD (3);
   Plot6(VolWAPValue + (trdSD*VolWAPSD), "VWAP3SDUp");
   Plot7(VolWAPValue - (trdSD*VolWAPSD), "VWAP3SDDown");


5aa70e2e9ab98_vwapsd2.52007-12-21_113611.png.baeff4533d6cc6078c25fe28a779dae8.png

Share this post


Link to post
Share on other sites

I am using the 3 SD version updated by thrunner. There is one problem. When I add a Horizontal line like in the included picture, the price as listed on the horizontal line is incorrect. This problem only occurs on charts with the VWAP indicator. Notice that the HL is listed at 1508.91 while it is actually at the 1510.00 level.

 

Any thoughts on this?

 

ScreenShot001.thumb.png.3df23059753c590f29a1e3f3ae9464bc.png

Share this post


Link to post
Share on other sites
problem only occurs on charts with the VWAP indicator. Notice that the HL is listed at 1508.91 while it is actually at the 1510.00 level
Does this horizontal line problem persist after you move it up and down the vertical axis and/or right click format it? I do not see this problem in TS 8.2.3896. Which TS version are your using? There are some reports of inaccurate HL and alerts in prior versions of TS, but not recently. You may have to save a minimal chart and workspace with the problem and report it to TS support.

5aa70e2f7f761_dbvwaphorizontallineTS8.22007-12-27_085836.png.7ecff833c5d6c1d7abedff573f906639.png

Share this post


Link to post
Share on other sites

Thanks for the great indicator!

 

I tried it with the daily charts it it looks very weird and does not appear to work.

 

Can someone try it and see if they get this problem as well?

 

Also, it looks a bit different from the Ensign data that I got for today's trading (JAN 4 - 08)

 

Namely, Ensign hung around VWAP -std2, but with TS it hung around -std1 and it never touched std2.

Share this post


Link to post
Share on other sites

Thanks for the VWAP indicator for TS guys. I've been looking for this for a while and stumbled on this great thread. I have some issues though....

 

I have used the TS VWAP indicator posted here and I have seem some descrepencies between it and the VWAP indicator for Ensign (build in 03-Jan-08 version).

 

Namely, they don't seem to match. See the attached images for trading TODAY (Jan-04). Ensign has most of todays trading at -2std, while TS has it at -1std.

 

Also, the TS indicator does not seem to work for intervals other intraday. I tried to recreate someone else's chart for daily's on and it seemed to fail.

5aa70e3030b94_ensign-jan04vwap.thumb.PNG.9840278763623263040c3cabf4636e40.PNG

ts-vwap-jan04.thumb.PNG.0694590f38b2787c766e9ed908107499.PNG

ts-vwap-daily.thumb.PNG.23bbf5b904c60ed76be32f3902f25edc.PNG

Edited by lj2500
add more info...

Share this post


Link to post
Share on other sites
some descrepencies..... and it seemed to fail.
Welcome to the forum. As you have noticed, VWAP is a moving average and it's calculation can differ greatly depending on when (exact time) you started counting the VWAP, which defined as:
VWAP (Volume Weighted Average Price) is a measure of the price at which the majority of a given day's trading in a given security took place. It is calculated by adding the dollars traded for the average price of the bar throughout the day ("avgprice" x "number of shares traded" per bar) and dividing the total shares traded for the day.

There is not a great deal of meaning for VWAP that spans multiple days and it is not a great trend predictor as you can see in the attached picture; I am not sure if many traders follow it other than that there is a correlation between daily VWAP and Market Profile's idea of POC (Point of control). The previous ELD attached in this thread will not do VWAP across different trading days. There is some code below from the TS forum that will, posted below.

{ plot a five-day VWAP to use on my charts } 

{ Format -> Symbol... -> Settings tab -> For volume, use: Trade Vol } 

{ Need more than 5 days of data not including bars to satisfy MaxBarsBack } 

inputs: 
Price( AvgPrice ), 
Color( Red ); 

variables: 
Trade_Vol( 0 ), 
VWAP_5Day( 0 ), 
TLID( -1 ), 
x( 0 ); 

arrays:	 
VPSum[5]( 0 ), 
VSum[5]( 0 ); 

if Date <> Date[1] then { detect day changes } 
begin 
{ Build the arrays of Summed Price and Volume } 
for x = 5 downto 1 
	begin 
	VPSum[x] = VPSum[x-1] ; 
	VSum[x] = VSum[x-1] ; 
	end ; 
if VSum[5] > 0 then 
	begin 
	{ Calculate the 5-day VWAP once values for the 5th day are obtained } 
	VWAP_5Day = SummationArray( VPSum, 5 ) / SummationArray( VSum, 5 ) ; 
	{ Plot the end of each day starting with the 5th day } 
	Plot1( VWAP_5Day, "VWAP_5Day", Color ) ; 
	{ Project last calculated VWAP_5Day forward with a Trendline } 
	if TLID = -1 then 
		begin 
		TLID = TL_New( Date[1], Time[1], VWAP_5Day, Date, Time, VWAP_5Day ) ; 
		TL_SetExtRight( TLID, true ) ; 
		TL_SetColor( TLID, Color ) ; 
		end 
	else 
		begin 
		TL_SetEnd( TLID, Date, Time, VWAP_5Day ) ; 
		TL_SetBegin( TLID, Date[1], Time[1], VWAP_5Day ) ; 
		end ; 
	end ; 
end ; 

if BarType >= 2 then { ie, not tick/minute data } 
Trade_Vol = Volume 
else { if tick/minute data } 
Trade_Vol = Ticks ; 

{ Sum Price and Volume data } 
VPSum[0] = VPSum[0] + Trade_Vol * Price ; 
VSum[0] = VSum[0] + Trade_Vol ; 

5aa70e303ddac_Calculatethe5-dayVWAPoncevaluesforthe5thdayareobtained2008-01-05_111820.png.228fe5bf65f7373b8bb7d2e65c565ce9.png

Share this post


Link to post
Share on other sites

I thought it would make a difference depending on the start point...so the BIG question is, what is the best start point? 12am? 8am?

 

Since I am a newbie trader, any one want to suggest what they are using?

 

Thanks TRunner for the other version of vwap...i'll take a look at it over multiple days...from your post, it doesn't look like it means much...at least for the past few weeks.

Share this post


Link to post
Share on other sites

I don't know, there is something very wrong with both Ensign and the TS vwap/bands in those charts.

I wonder if Jerry could post a chart from that day? I've noticed with alot of the versions people have wrote up, something is totally off with the variance calculations for the bands. With that big drop at the open the dev band away from price should be expanding. Alot of the versions people have made the bands just look like channels while in Jerry's videos they look more like "claws".

Investors r/t seems to be the closest to what Jerry did in his videos. Here is a chart from marketdelta/investors RT with DTN iq feed. The variance setting for investors r/t seems to get like what Jerry does, then the proprietary is different as price never seems to get beyond the 2nd standard dev band on any chart i've pulled up.

vwapbands.jpg.582b4fc43139554d2d21962b812fab4e.jpg

Share this post


Link to post
Share on other sites
I don't know, there is something very wrong with both Ensign and the TS vwap/bands in those charts.
Please see the attached PNG. The TS VWAP SD appears to match what you displayed if TS code is set to 0930 regular trading hours (EST). By default, both the Ensign and TS appeared to use the start of next day as basis for calculation.

5aa70e3176f41_TSVWAPSD2008-01-04_180248.png.51eb7bf195db8bdb9dbfdfa3d94dd4cb.png

Share this post


Link to post
Share on other sites
I don't know, there is something very wrong with both Ensign and the TS vwap/bands in those charts.

I wonder if Jerry could post a chart from that day? I've noticed with alot of the versions people have wrote up, something is totally off with the variance calculations for the bands. With that big drop at the open the dev band away from price should be expanding. Alot of the versions people have made the bands just look like channels while in Jerry's videos they look more like "claws".

Investors r/t seems to be the closest to what Jerry did in his videos. Here is a chart from marketdelta/investors RT with DTN iq feed. The variance setting for investors r/t seems to get like what Jerry does, then the proprietary is different as price never seems to get beyond the 2nd standard dev band on any chart i've pulled up.

 

Hi Darth, firstly I am no maths expert though I did do a degree in a math heavy subject ... that was in the stoneage! I did do a bit of research (actually a lot) when Jerry first published this excellent series.

 

There are a few algorithms out there for variance but they can be prone to accuracy errors due to overflow and underflow. More likely an issue is when using anything but individual ticks you need to decide what price level to assign the volume of that bar to. Ensign I think uses a uniform distribution at each level from bar high to low. I guess some might use mid points or other methods. Sounds like this might not be the issue you have got. By definition price will get to the 3rd standar deviation X% of the time (can't remember what X is but its pretty small) from memory 2SD's is something like 2% of the sample. anyway no real answers but some food for thought.

 

Cheers.

Share this post


Link to post
Share on other sites

Thank you for your comments Blowfish. As a long time user of Multicharts, could you please comment on the following chart where the VWAP-SD indicator plots dramatically moved up and down vs the underlying bars as one scrolls along the x axis. Is this a bug in MC? Is there an easy fix? The same code in TS and MC also do not show the same results. Thanks.

5aa70e31ed514_MCcomboTSVWAPSD2008-01-08_202607.thumb.png.120f0660aebd7315e250bd77bbe3fabd.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • No one can specify that who can become successful in what time, it all depends on the skills you have applied and know;edge you have implied while trading.
    • On this Forum by Introducing yourself new beginner will get many things to learn, good links and videos also. Forex4you is a platform where you can learn about Forex as well as Demo account trading.
    • Open a new futures brokerage account by April 30th with a NinjaTrader Lifetime license & receive: Commission-Free Micro trading in May $50 margins on Micros Access to the most powerful version of NinjaTrader Free platform upgrades for life! Simply open & fund your new account in April with as little as $400 & purchase a Lifetime license. You will then receive a rebate for commissions on all Micro futures trades placed from May 1 – May 31st.* Open Futures Account A NinjaTrader Lifetime license provide access to all premium features including Chart Trader, OCO orders, Order Flow +, and more. *Program Requirements: Account must be funded by April 30th, 2020 with $400 minimum A new NinjaTrader Lifetime license ($1099) must be purchased by April 30th, 2020 Standard exchange, NFA and routing fees still apply A commission rebate will be applied to the account holder’s balance for all May Micro trades 2nd accounts for current NinjaTrader Brokerage account owners not eligible for rebates Futures and Forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or life style. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.
    • Date : 1st April 2020. All eyes on Commodity Currencies.Asian stock markets are lower, while European and US equity index futures are showing losses of around 3%. Data out of Asia today were nothing short of dismal, showing manufacturing contracting across most of the region, highlighting the economic toll that virus-containing measures are having.The main concern remains that the massive global stimulus measures simply won’t be fully effective while many economies remain in a state of lockdown of as-yet unknown duration.Commodity currencies have come under pressure as the winds of risk aversion picked up again.The Canadian dollar was the main loser so far today , while it has remained under pressure with oil prices sinking back toward major-trend lows as crude storage facilities burst at the seems from excessive supplies.USDCAD has gained up nearly 2% in making a 1.4230 high, though the pair so far has remained below yesterday’s peak at 1.4350. This is due to the fact that crude prices are down by over 65% year-to-date. This level of price decline in Canada’s principal export, while it sustains, marks a significant deterioration in the Canadian economy’s terms of trade. Given the glut of crude flooding the market, and given that supply is increasing as demand will remain weak for a historically protracted amount of time, Canadian Dollar is anticipated to remain apt to underperformance. The likes of the Norwegian krona, which like the Canadian dollar is an oil-price correlator, and many developing world currencies have also come under pressure.From the technical perspective, USDCAD overall outlook remains positive with asset holding above all three daily SMAs since January, and momentum indicators positively configured. RSI at 59 recovery from a pullback last week, Stochastic rebound from oversold territory and MACD presents some decline of the bullish momentum but holds well above 0. That said, USDCAD revisiting its recent 17-year high at 1.4669 seems likely before long.Intraday meanwhile, the rebound of USDCAD looks to run out of steam, however only a move below 1.4050 could suggest a reverse of the outlook.AUDUSD tipped over 1% lower in making a 5-day low at 0.6064 amid weaker Gold prices (end-of-quarter flows). The Aussie still remains comfortably above the 17-year low that was seen on March 19th at 0.5507. The Kiwi dollar has also taken a tumble.Always trade with strict risk management. Your capital is the single most important aspect of your trading business.Please note that times displayed based on local time zone and are from time of writing this report.Click HERE to access the full HotForex Economic calendar.Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!Click HERE to READ more Market news. Stuart Cowell Head Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • Date : 31st March 2020. Dead cat Bounce!Dead cat Bounce! A new term? Not really but definitely something that we haven’t seen for more than a generation.In general, investors throughout the years invented this term as a follow up to a market free fall. By definition, the “Dead cat Bounce” is simply a market phenomenon that translates into temporary small and short-lived rebounds of an asset’s price within a prolonged period of downside. This term is based on the idiom that “even a dead cat will bounce if it falls far enough and fast enough“. Hence in the financial market it is said that even if an asset falls with a considerable speed, it would rebound as even a dead cat would bounce. However, every time there is a rebound, the overall initial trend is then anticipated to resume, bringing the bearish influence back into play.In addition, the phenomenon can occur in any market, yet is particularly prevalent in equity markets. It is often the case that it is considered a continuation pattern.Why are we raising this topic now? This March, was the first time after Black Monday 1987 that we have seen the worst intraday selloffs in stock markets. Since February 20th, the stock market entered an aggressive bear market with a few days of an absolute rally. An example was the 13th of March in which the stock market roared back in the biggest one-day rally since 2008 after its worst single-day crash in 33 years just a day before. This is the classic dead cat bounce.If you closely observe stock market behaviour in March you will notice that there is a dramatic decline, with a number of days when the market reversed some of its losses, but failed to take the bait, and eventually fell back down again. This is a situation of portfolio managers wanting to sell some of their positions and when they see some strength in the market, decided to unload. This is what we call a “dead cat bounce” after it falls from high enough. Remember however that not every correction/reversal can be interpreted as a dead cat bounce.Theoretically this term is defined as the term in which,   A stock in a severe steep decline has a sharp bounce off the lows. A small upward price movement in a bear market after which the market continues to fall. Unfortunately, I need to highlight that there is not an easy way to determine in advance whether an upwards movement is a dead cat bounce which will eventually reverse quickly or whether it is a trend reversal. There is nothing easy in identifying the bottom of the market. However to a large extent a dead cat bounce is a retracement, in comparison to a reversal, i.e. it is temporary.Dead cat bounce as a technical analysis tool and more precisely as a continuation pattern could be tradable from short-term or medium term traders. Having explained this phenomenon, a follow-up article will elaborate on how market participants can trade a dead cat bounce.Always trade with strict risk management. Your capital is the single most important aspect of your trading business.Please note that times displayed based on local time zone and are from time of writing this report.Click HERE to access the full HotForex Economic calendar.Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!Click HERE to READ more Market news. Andria Pichidi Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.