Welcome to the Traders Laboratory.

Trading Indicators Share, download, and discuss trading indicators.

Reply
VWAP Indicator with 1SD and 2SD bands Details »»
VWAP Indicator with 1SD and 2SD bands
Platform: , by dbntina dbntina is offline
Developer Last Online: Jan 2017 Show Printable Version Email this Page

Platform: Unknown Rating: (6 votes - 4.33 average)
Released: 08-03-2007 Last Update: Never Installs: 0
 
No support by the author.

Guys I am not a TS coding guru by any means...still new at it but wanted to share this code if anyone else was interested. Just wrote this code for myself to keep up with JPERL's threads on Market Statistics. It plots the VWAP, and 1st and 2nd Standard Deviation bands. It lines up with his numbers within a tick or two so I think it is working correctly.

Any other TS coders out there please take a look because it can probably be improved upon.

This is my first post of a file so if I screwed something up...be gentle!

Hope this helps,

dbntina
boxmeister

Download Now

File Type: eld DBVWAP_SD.ELD (5.0 KB, 3045 views)

Show Your Support

  • If you like to thanks you by the author -> Click Thanks to the Author
  • This modification may not be copied, reproduced or published elsewhere without the author's permission.

Similar Indicator
Mod Developer Type Replies Last Post
TS Tick by Tick PVP Plotted with VWAP and SD Bands dbntina Trading Indicators 56 04:31 PM 04-15-2013
The Following 16 Users Say Thank You to dbntina For This Useful Post:
ClocharT (01-02-2011), cunparis (03-29-2010), hawk_7_7 (12-04-2008), hiteshshah1 (08-10-2017), mb3000 (06-21-2009), opmtraders (12-26-2008), ppcl (02-15-2016), proton242 (02-28-2011), RomanFx (07-28-2009), ronnn777 (02-21-2009), Tams (05-04-2009), TIKITRADER (08-06-2009), tradingbigboy (04-19-2016), vero (08-22-2010), wuxw (09-08-2011)

Comments
Old 08-03-2007, 11:56 AM   #2

Join Date: Jan 2007
Location: Houston, TX
Posts: 70
Ignore this user

Thanks: 6
Thanked 7 Times in 7 Posts

Re: VWAP Indicator with 1SD and 2SD bands

dbntina:

Thank you for posting this. I had always wanted an indicator that provided statistical representation of what was happening today. Nice job!
bh_trade is offline  
Reply With Quote
Old 08-03-2007, 12:40 PM   #3

JayRemy's Avatar

Join Date: Oct 2006
Location: Louth, UK
Posts: 54
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: VWAP Indicator with 1SD and 2SD bands

Good post mate. I've been wanting to do this since reading Jpearls threads. I am however using ninja trader, so (if you dont mind) Im going to try and convert your code to ninja script.

I dont think there are too many ninja users out there - everybody seems to use esignal or tradestation!

Cheers, Jay.
JayRemy is offline  
Reply With Quote
Old 08-03-2007, 12:51 PM   #4

Join Date: Jan 2007
Location: san jose
Posts: 91
Ignore this user

Thanks: 0
Thanked 6 Times in 6 Posts

Re: VWAP Indicator with 1SD and 2SD bands

Hi DbnTina,
I am not sure if the calculation for vi is correct.
In your EL you have used
variance_i = ((UpTicks[Value1]+DownTicks[Value1])/ShareW) * (Square(AvgPrice[i]-VolWAPValue));

where (UpTicks[i]+DownTicks[i]) represents volume of the bar [i]... I think in a probability calculation one should use total volume at price i, not just volume of the bar i. Lets ask Jerry for clarification.
nickm001 is offline  
Reply With Quote
Old 08-03-2007, 06:22 PM   #5

Join Date: Mar 2007
Location: OKC
Posts: 61
Ignore this user

Thanks: 0
Thanked 39 Times in 10 Posts

Re: VWAP Indicator with 1SD and 2SD bands

Hi DbnTina,
I am not sure if the calculation for vi is correct.
In your EL you have used
variance_i = ((UpTicks[Value1]+DownTicks[Value1])/ShareW) * (Square(AvgPrice[i]-VolWAPValue));

where (UpTicks[i]+DownTicks[i]) represents volume of the bar [i]... I think in a probability calculation one should use total volume at price i, not just volume of the bar i. Lets ask Jerry for clarification.




NickM001,

You are correct. In the code, ShareW is always the total share volume up to the current time from your start. You divide the volume of the current bar by the total volume and use this "normalized volume" to multiply with according to Jerry. This should be correct if I am understanding the formula correctly. It also seems to line up with Jerry's bands so I think it is correct.

Let me know...I can correct if I am not suppossed to normalize this way...

Thanks for taking a look at the code if it is incorrect we want to find out now.

dbntina
dbntina is offline  
Reply With Quote
Old 08-03-2007, 07:30 PM   #6

Soultrader's Avatar

Join Date: Aug 2006
Location: Tokyo
Posts: 3,659
Ignore this user

Thanks: 539
Thanked 1,464 Times in 507 Posts

Re: VWAP Indicator with 1SD and 2SD bands

Hi dbntina,

Thank you for your contribution. If you happen to need any updating on the code, threads here can be edited at anytime so please feel free to do so. Also, would it be possible to add a screenshot of the indicator in action? It would help traders give a visual clue on what the indicator is all about. Thanks.
Soultrader is offline  
Reply With Quote
Old 08-03-2007, 09:51 PM   #7

Join Date: Mar 2007
Location: OKC
Posts: 61
Ignore this user

Thanks: 0
Thanked 39 Times in 10 Posts

Re: VWAP Indicator with 1SD and 2SD bands

Soultrader...will try to do a screenshot on Monday...everythings at work...good idea.

Thanks,

dbntina
dbntina is offline  
Reply With Quote
Old 08-03-2007, 11:46 PM   #8

Join Date: Jan 2007
Location: san jose
Posts: 91
Ignore this user

Thanks: 0
Thanked 6 Times in 6 Posts

Re: VWAP Indicator with 1SD and 2SD bands

OK let me try to explain again my understanding of the formula. Let quote what Jerry wrote in his explanation:
QUOTE#################### ###################
While we won't address all these questions in one thread their answers can be obtained by analysis of the volume distribution function. To do so requires that we introduce a third property of the volume distribution function called the Standard Deviation of the VWAP, SD for short. SD is computed from the following equations:

NOTE : Formula did not copy ... see http://www.traderslaboratory.com/for...dard-2101.html

where the summation subscript i, runs over all prices in the volume distribution
pi = ith price in the volume distribution
Pi = vi/V is the probability of occurrence of price pi
vi = the volume traded at price pi from the volume distribution
V = total volume for the entire distribution

######################### ########

Note that factor vi is volume traded at price pi. If I understand your code, you have used volume of the bar[i], or volume at time [i], not as described in the formula.

To get proper value for vi, you would have to keep track of all the volume distribution at EACH price level of the range in the array and use the value of volume array element [i] that corresponds to price pi. It can be done, but it would take more then few lines of code, unfortunately.

For some odd reason, it does not seem to make much difference even if you set vi/V = 1, for the few sample charts I looked at. So for all practical purposes, SD value is usable...
nickm001 is offline  
Reply With Quote

Reply

Tags
vwap

Thread Tools
Help Others By Rating This Thread
Help Others By Rating This Thread:

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trading With Market Statistics.II The Volume Weighted Average Price (VWAP). jperl Market Profile 66 11-11-2014 11:30 AM
Trading with Market Statistics III. Basics of VWAP Trading jperl Market Profile 77 08-20-2014 10:06 AM
Question regarding Bollinger Bands Robert Technical Analysis 22 08-08-2009 10:37 PM
Is the RSI indicator any good? Lisa Technical Analysis 14 04-27-2008 12:41 PM

All times are GMT -4. The time now is 07:13 AM.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
2006-2011 Traders Laboratory, All Rights Reserved.