Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I need some help modifying an EL VWAP indicator I found. It does what I want except for the start time. I would like it to start daily at 1800 ET instead of midnight. Sounds like a simple adjustment if you are not a dummy like me.
Any help would be much appreciated.
vars: vwap(0),
pv(0),
Totalvolume(0),
Barfromstart(0),
Squareddeviations(0),
Probabilityweighteddeviations(0),
deviationsum(0),
standarddeviation(0);
If date > date[1]
then
begin
Barfromstart=0;
pv=AvgPrice*volume;
Totalvolume=volume;
vwap=pv/totalvolume;
end
else
begin
Barfromstart=Barfromstart[1]+1;
pv=pv[1] + AvgPrice*Volume;
Totalvolume=Totalvolume[1] + Volume;
vwap=pv/Totalvolume;
end;
deviationsum=0;
for value1= 0 to Barfromstart
begin
Squareddeviations=Square( vwap-avgprice[value1]);
Probabilityweighteddeviations=volume[value1]*Squareddeviations/Totalvolume;
deviationsum=deviationsum +Probabilityweighteddeviations;
end;
Could somebody please add the ability to only plot the VWAP starting from a start time and ending at an end time in the code below? In other words, the VWAP would only be visible on the chart from say 930 - 1615. The reason for this is that you can use an ETH chart but plot an RTH VWAP. Right now the VWAP calculates from the input time but it plots throughout the chart.
standarddeviation=SquareRoot(deviationsum);
if time <= 1615 then begin
Plot1(vwap);
Plot2(vwap+standarddeviation);
Plot3(vwap+2*standarddeviation);
Plot4(vwap-standarddeviation);
Plot5(vwap-2*standarddeviation);
end;
Just by looking at the code, no idea if it will work is change
standarddeviation=SquareRoot(deviationsum);
if time <= 1615 then begin
Plot1(vwap);
Plot2(vwap+standarddeviation);
Plot3(vwap+2*standarddeviation);
Plot4(vwap-standarddeviation);
Plot5(vwap-2*standarddeviation);
end;
input: time_start (0930), time_end (1615), upColor(Cyan), dnColor(Magenta);
vars: vwap(0),
pv(0),
Totalvolume(0),
Barfromstart(0),
Squareddeviations(0),
Probabilityweighteddeviations(0),
deviationsum(0),
standarddeviation(0),
OncePerDay(0);
If date > date[1] then OncePerDay = 0 ;
If Time >= time_start and OncePerDay = 0 then begin
OncePerDay = 1 ;
Barfromstart=0;
pv=AvgPrice*volume;
Totalvolume=volume;
vwap=pv/totalvolume;
end
else
begin
Barfromstart=Barfromstart[1]+1;
pv=pv[1] + AvgPrice*Volume;
Totalvolume=Totalvolume[1] + Volume;
vwap=pv/Totalvolume;
end;
deviationsum=0;
for value1= 0 to Barfromstart
begin
Squareddeviations=Square( vwap-avgprice[value1]);
Probabilityweighteddeviations=volume[value1]*Squareddeviations/Totalvolume;
deviationsum=deviationsum +Probabilityweighteddeviations;
end;
standarddeviation=SquareRoot(deviationsum);
if time <= time_end and time >= time_start then begin
Plot1(vwap);
Plot2(vwap+standarddeviation);
Plot3(vwap+2*standarddeviation);
Plot4(vwap-standarddeviation);
Plot5(vwap-2*standarddeviation);
end
else begin
Plot1(0); // outside of session plots, edit as needed
Plot2(0);
Plot3(0);
Plot4(0);
Plot5(0);
end;
var: var1(yellow);
if vwap > vwap[1] then var1 = upColor;
if vwap < vwap[1] then var1 = dnColor;
SetPlotColor(1,var1);
This is just a really quick fix, it makes the plots plot 0 when its outside of your time, so they are basically hidden. But as you can see in my screenshot it makes vertical lines. which may be annoying. but at least you have the time function that is customizable.