This is an awesome indicator!
Flowing this thread this is what i got the script.
{***********************************************************************************************
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];
inputs:
iStartTime (0800),
ResetMinutes (60);
vars:
PriceW(0),
ShareW(0),
Count(0),
VolWAPValue(0),
VolWAPVariance(0),
VolWAPSD(0);
if mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) ), TimeToMinutes(ResetMinutes) ) = 0 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");
I wanted to have this indicator plot in RTH only on my 24h tick charts. in Daylight Mountain standard Time it is 7:30am to 14:15pm. I have setup up start time at 7:30 and the reset in minutes to 405min, that should give me the reset at 14:15pm. For some odd reason the indicator would plot till next day 7:30am. Any one know how to fix that?
Other function i would like to incorporate is for the indicator to stop plotting between 14:15 - 7:30 (RTH close to open)
I have inserted iEndTime (1415); but that did not go over too well when came to plotting the indicator.
I would appreciate help on this one.
R