Page 1 of 1

VWAP Oscillator (StDeV based)

Posted: 12 Oct 2008
by Tresor
Hello,

I recently encountered this VWAP Oscillator (screenshot attached). Would any of you happen to have the EL code of it?

Regards

Posted: 12 Oct 2008
by zukkaweb
how does it works?

Posted: 13 Oct 2008
by Tresor
how does it works?
Hi,

All I know is that the lines (4, 3,.., .., - 4) are standard deviations.

Re: VWAP Oscillator (StDeV based)

Posted: 21 Dec 2008
by TJ
Hello,
I recently encountered this VWAP Oscillator (screenshot attached). Would any of you happen to have the EL code of it?
Regards
it is already in MC.

Look for VWAP Reset in the indicator list.

Posted: 22 Dec 2008
by Tresor
Hello TJ,

VWAP Reset is an indicator the values of which are similar to the values of an instrument (from zero to zillions), while VWAP Oscillator oscillates between -5 to 5 and crosses zero.

Regards

Posted: 22 Dec 2008
by TJ
does it oscillate against another VMAP, or against the close?

This can easily arranged.
Just get one value minus the other.

Posted: 22 Dec 2008
by Tresor
does it oscillate against another VMAP, or against the close?
Hi TJ,

To be frank, I have no idea of how this oscillator is built.

Posted: 22 Dec 2008
by Tresor
Hello TJ,

Thanks a lot:-) I will experiment with your code to see if crossing of this VWAP_Osc with another oscilator would bring promising signals. Please see the attached screenshot.

As far as I remember the original VWAP Oscillator's levels are standard deviations of the daily VWAP. It was inpired by this code:

Code: Select all



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

Coded by dbntina/boxmeister 8/2/2007

Used the VWAP_H code provided by TS 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 (2.5);
Plot6(VolWAPValue + (trdSD*VolWAPSD), "VWAP3SDUp");
Plot7(VolWAPValue - (trdSD*VolWAPSD), "VWAP3SDDown");
Thanks

Posted: 27 Dec 2008
by TJ
T: Your Christmas present.

enjoy
:-)

Code: Select all

// Type : Function
// Name : VWAP_H

vars:
PriceW(0),
ShareW(0),
Answer(0);

if date > date[1] then begin
PriceW = 0;
ShareW = 0;
end;

PriceW = PriceW + (AvgPrice * (UpTicks+DownTicks));
ShareW = ShareW + (UpTicks+DownTicks);

if ShareW > 0 then
Answer = PriceW / ShareW;

VWAP_H = Answer;

Code: Select all

// VWAP Std Dev

vars: aa(0);

value1=
square(c-vwap_h)+
square(c[1]-vwap_h)+
square(c[2]-vwap_h)+
square(c[3]-vwap_h)+
square(c[4]-vwap_h)+
square(c[5]-vwap_h)+
square(c[6]-vwap_h)+
square(c[7]-vwap_h)+
square(c[8]-vwap_h)+
square(c[9]-vwap_h)+
square(c[10]-vwap_h)+
square(c[11]-vwap_h)+
square(c[12]-vwap_h)+
square(c[13]-vwap_h)+
square(c[14]-vwap_h)+
square(c[15]-vwap_h)+
square(c[16]-vwap_h)+
square(c[17]-vwap_h)+
square(c[18]-vwap_h)+
square(c[19]-vwap_h)+
square(c[20]-vwap_h)+
square(c[21]-vwap_h)+
square(c[22]-vwap_h)+
square(c[23]-vwap_h)+
square(c[24]-vwap_h)+
square(c[25]-vwap_h)+
square(c[26]-vwap_h)+
square(c[27]-vwap_h)+
square(c[28]-vwap_h)+
square(c[29]-vwap_h)+
square(c[30]-vwap_h)+
square(c[31]-vwap_h)+
square(c[32]-vwap_h)+
square(c[33]-vwap_h)+
square(c[34]-vwap_h)+
square(c[35]-vwap_h)+
square(c[36]-vwap_h)+
square(c[37]-vwap_h)+
square(c[38]-vwap_h)+
square(c[39]-vwap_h)+
square(c[40]-vwap_h)+
square(c[41]-vwap_h)+
square(c[42]-vwap_h)+
square(c[43]-vwap_h)+
square(c[44]-vwap_h);

value2=squareroot(value1/(45-1));
value3=vwap_h+value2;
value4=vwap_h-value2;
value5=vwap_h+(value2*2);
value6=vwap_h-(value2*2);
value7=vwap_h+2.50;
value8=vwap_h-2.50;


if time>930 and time<1615 then begin

{Plot1(vwap_h, "VWAP" ) ;}
Plot2(value7, "UpperBand" ) ;
Plot3(value8, "UpperBand" ) ;
Plot4(value5, "UpperBand" ) ;
Plot5(value6, "LowerBand" ) ;

end;

Posted: 27 Dec 2008
by RobotMan
I don't come in here too often, but I was going to post some code today and noticed this thread.
There is a pretty good discussion of VWAP and Std Dev on the TradersLaboratory site. I have read through it and I DO use VWAP as a Moving Average S/R point on the chart, but not all the other stuff he talks about.

01 Trading With Market Statistics I. Volume Histogram
http://www.traderslaboratory.com/forums ... -1962.html

02 Trading With Market Statistics.II The Volume Weighted Average Price (VWAP)
http://www.traderslaboratory.com/forums ... -1990.html

03 Trading with Market Statistics III. Basics of VWAP Trading
http://www.traderslaboratory.com/forums ... -2008.html

04 Trading with Market Statistics. IV Standard Deviation
http://www.traderslaboratory.com/forums ... -2101.html

05 Trading with Market Statistics V. Other Entry Points
http://www.traderslaboratory.com/forums ... -2130.html

06 Trading with Market Statistics VI. Scaling In and Risk Tolerance
http://www.traderslaboratory.com/forums ... -2189.html

07 Trading with Market Statistics VII. Breakout Trades at the PVP
http://www.traderslaboratory.com/forums ... -2232.html

08 Trading with Market Statistics VIII. Counter Trend Trades in Symmetric Distributions
http://www.traderslaboratory.com/forums ... -2285.html

09 Trading with Market Statistics IX. Scalping
http://www.traderslaboratory.com/forums ... -2322.html

10 Trading with Market Statistics X. Position Trading
http://www.traderslaboratory.com/forums ... -2423.html

11 Trading with Market Statistics XI. HUP
http://www.traderslaboratory.com/forums ... -2735.html

VWAP Indicator with 1SD and 2SD bands
http://www.traderslaboratory.com/forums ... -2175.html

Some useful explanation and code here (you might need to be registered to get into the forum - sorry):

TS Forum - VWAP Standard Deviation Since Open -- Question
https://www.TS.com/Discussion ... c_ID=66875

TS Forum - Volume At Price Histogram (Futures)
https://www.TS.com/Discussion ... c_ID=67207

TS Forum - gkMtkProfileTL
https://www.TS.com/Discussion ... c_ID=50398

Posted: 27 Dec 2008
by Tresor
Hello TJ,

Thank you very much for the present :mrgreen:

Is the VWAP_H function: a) Numeric / b) TrueFalse / c) String?

Regards

Posted: 27 Dec 2008
by Tresor
There is a pretty good discussion of VWAP and Std Dev on the TradersLaboratory site. I have read through it and I DO use VWAP as a Moving Average S/R point on the chart, but not all the other stuff he talks about.
Hello RobotMan,

I agree the discussion there is pretty good. Unfortunately MC doesn't plot a daily histogram the way other charting programmes do. In fact MC doesn't plot daily volume histogram at all. So I was not able to benefit from this discussion :cry:

Posted: 27 Dec 2008
by TJ
Hello TJ,

Thank you very much for the present :mrgreen:

Is the VWAP_H function: a) Numeric / b) TrueFalse / c) String?

Regards
numeric.

you can see it by:

Code: Select all

vars:
Answer(0); // <--numeric

VWAP_H = Answer; // <--- the function returns this variable.

Posted: 27 Dec 2008
by TJ
...
Some useful explanation and code here (you might need to be registered to get into the forum - sorry):

TS Forum - VWAP Standard Deviation Since Open -- Question
https://www.TS.com/Discussion ... c_ID=66875

TS Forum - Volume At Price Histogram (Futures)
https://www.TS.com/Discussion ... c_ID=67207

TS Forum - gkMtkProfileTL
https://www.TS.com/Discussion ... c_ID=50398
too bad I can't get into the TS forum...

can someone make a precis?

;-)

Posted: 27 Dec 2008
by TJ
I don't come in here too often, but I was going to post some code today and noticed this thread.
There is a pretty good discussion of VWAP and Std Dev on the TradersLaboratory site. I have read through it and I DO use VWAP as a Moving Average S/R point on the chart, but not all the other stuff he talks about.
Roboman...

Thanks for the links... that's a wealth of information!

Posted: 27 Dec 2008
by Tresor
Hello TJ,

Thank you very much for the present :mrgreen:

Is the VWAP_H function: a) Numeric / b) TrueFalse / c) String?

Regards
numeric.

you can see it by:

vars:
Answer(0); <--numeric

VWAP_H = Answer; <--- the function returns this variable.
Thanks TJ,

This indicator works like per attached screenshot (from zero to zillions). Do you think anything could be done to to make these lines oscillate (between 0 to 100 or between 20 to 80 or between -100 to 100 or between a similar range of values)?

Posted: 27 Dec 2008
by TJ
Thanks TJ,

This indicator works like per attached screenshot (from zero to zillions). Do you think anything could be done to to make these lines oscillate (between 0 to 100 or between 20 to 80 or between -100 to 100 or between a similar range of values)?
mmm... this indicator is like a bollinger band.
I don't think it was meant to oscillate between 0-100.

I will take a look at other indicators in roboman's links.

Posted: 14 Jan 2009
by Tresor
This is how the author explains how Vwap Osc is calculated:

http://www.traderslaboratory.com/forums ... #post56139

Regards

Re: VWAP Oscillator (StDeV based)

Posted: 03 Jan 2011
by bomberone1
Folks, anyone compare vwap by twap?

I have difficult coding twap indicator in easylanguage, anyone get it?

Re: VWAP Oscillator (StDeV based)

Posted: 13 Jan 2011
by bomberone1
TJ i don't understand the modification that u did at original code on Trsor , the code of dbtina vwap_H, could u exaplin please?

Twap are u able to code it?

Re: VWAP Oscillator (StDeV based)

Posted: 13 Jan 2011
by TJ
TJ i don't understand the modification that u did at original code on Trsor , the code of dbtina vwap_H, could u exaplin please?
you need to learn to walk before run.
I would suggest you to go through this ebook first:
Getting Started with EasyLanguage
https://www.multicharts.com/multicharts ... mentation/
this is the book you should read if you want to use EasyLanguage but don't know how.
Twap are u able to code it?
yes.
how much would you like to pay?

Re: VWAP Oscillator (StDeV based)

Posted: 13 Jan 2011
by bomberone1
how much would you like to pay?
A cup of coffee???
:-)

Re: VWAP Oscillator (StDeV based)

Posted: 08 Apr 2011
by pivot
Image
VWAP_SD.png
(149.38 KiB) Downloaded 5427 times

Here is the code

Code: Select all


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

Coded by dbntina/boxmeister 8/2/2007

Used the VWAP_H code provided by TS 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");



Re: VWAP Oscillator (StDeV based)

Posted: 10 Apr 2011
by pivot

Code: Select all

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(Close of data1 - VolWAPValue, "Diff VWAP");
Plot2(VolWAPSD, "VWAP1SDUp");
Plot3( -1* VolWAPSD, "VWAP1SDDown");
Plot4(2*VolWAPSD, "VWAP2SDUp");
Plot5(-2*VolWAPSD, "VWAP2SDDown");
Plot6(0, "zeroline");


{Plot2(VolWAPValue + VolWAPSD, "VWAP1SDUp");
Plot3(VolWAPValue - VolWAPSD, "VWAP1SDDown");
Plot4(VolWAPValue + (2*VolWAPSD), "VWAP2SDUp");
Plot5(VolWAPValue - (2*VolWAPSD), "VWAP2SDDown");}



I have changed a few things on the original TS forum code. This is code for the Oscillator all it is, is the current price less the Vwap. Be sure to make the "Diff Vwap" into a Historgram with upper and lower SD bands.

The IRT version looks like the SD bands are normalized which some how I don't think a VWAP Standard deviation will be a straight line all day.