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)
Does anyone have a quarterly and/or weekly VWAP indicator for easy language? I've been trying to look at long range views for some stocks and commodities and how it relates to daily movements with respect to the longer VWAP.
Thanks,
-C
“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
I would like to see this to, but have had zero time to even investigate. I assume you started by looking at the current VWAP daily? It is not straightforward to set a begin/end time based on days? I know it currently has begin/end time based on session times.
I don't know really, I'm sure somebody around here would know or maybe you can talk to the multichart guys and ask them. I will post the code so you can see how it is written if that helps:
// ==================================================================================================================================================
// VWAP Indicators for TS-Forum (Monthly, Weekly, Daily ....) - Just for beginner Release 1.00 / Date 03/14/2011
// Link to original post in TS Forum : https://www.tradestation.com:443/Discussions/Topic.aspx?Topic_ID=6735
// ==================================================================================================================================================
// Inputs
// ==================================================================================================================================================
input: Plot_Section("------------------------------------");
input: Show_Daily(1{1=Yes,0=No});
input: Show_Weekly(1{1=Yes,0=No});
input: Show_Monthly(1{1=Yes,0=No});
input: Show_Prior_VWAP(1{1=Yes,0=No});
input: Round_Section("------------------------------------");
input: Round_VWAP_DWM(1{1=Yes,0=No});
input: Color_Section("------------------------------------");
input: ColAbove_DVWAP((RGB(0,128,192)));
input: ColBelow_DVWAP((RGB(255,0,0)));
input: ColPrev_DVWAP((RGB(255,128,64)));
input: ColAbove_WVWAP((RGB(0,0,255)));
input: ColBelow_WVWAP((RGB(255,0,128)));
input: ColPrev_WVWAP((RGB(255,255,128)));
input: ColAbove_MVWAP((RGB(0,0,160)));
input: ColBelow_MVWAP((RGB(185,0,0)));
input: ColPrev_MVWAP((RGB(192,192,192)));
// ==================================================================================================================================================
// Variables to define values and transforming inputs to variables to improve memory performance of the indicator
// ================================================================================================================================================== var: sdv(0); // transformer to change inputs in var's (show daily)
var: swv(0); // transformer to change inputs in var's (show weekly)
var: smv(0); // transformer to change inputs in var's (show monthly)
var: sp(0); // transformer to change inputs in var's (show prior vwap's)
var: rv(0); // transformer to change inputs in var's (round)
var: cad(0); // transformer to change inputs in var's (color above daily vwap)
var: cbd(0); // transformer to change inputs in var's (color below daily vwap)
var: cpd(0); // transformer to change inputs in var's (color previous daily vwap)
var: caw(0); // transformer to change inputs in var's (color above weekly vwap)
var: cbw(0); // transformer to change inputs in var's (color below weekly vwap)
var: cpw(0); // transformer to change inputs in var's (color previous weekly vwap)
var: cam(0); // transformer to change inputs in var's (color above monthly vwap)
var: cbm(0); // transformer to change inputs in var's (color below monthly vwap)
var: cpm(0); // transformer to change inputs in var's (color previous monthly vwap)
var: cd(0); // define plot color of current daily vwap
var: cw(0); // define plot color of current weekly vwap
var: cm(0); // define plot color of current monthly vwap
var: dvwap1(0); // take over daily vwap function for current daily vwap
var: dvwap2(0);// take over daily vwap function for prior daily vwap
var: wvwap1(0); // take over daily vwap function for current weekly vwap
var: wvwap2(0); // take over daily vwap function for prior weekly vwap
var: mvwap1(0); // take over daily vwap function for current monthly vwap
var: mvwap2(0); // take over daily vwap function for prior monthly vwap
// ==================================================================================================================================================
// Transform input's into var's
// ==================================================================================================================================================
sdv = show_daily; // transformer to change inputs in var's (show daily)
swv = show_weekly; // transformer to change inputs in var's (show weekly)
smv = show_monthly; // transformer to change inputs in var's (show monthly)
sp = show_prior_vwap; // transformer to change inputs in var's (show prior vwap)
rv = round_vwap_dwm; // transformer to change inputs in var's (round vwap's yes/no)
cad = colabove_dvwap; // transformer to change inputs in var's (color above daily vwap)
cbd = colbelow_dvwap; // transformer to change inputs in var's (color below daily vwap)
cpd = colprev_dvwap; // transformer to change inputs in var's (color previous daily vwap)
caw = colabove_wvwap; // transformer to change inputs in var's (color above weekly vwap)
cbw = colbelow_wvwap; // transformer to change inputs in var's (color below weekly vwap)
cpw = colprev_wvwap; // transformer to change inputs in var's (color previous weekly vwap)
cam = colabove_mvwap; // transformer to change inputs in var's (color above monthly vwap)
cbm = colbelow_mvwap; // transformer to change inputs in var's (color below monthly vwap)
cpm = colprev_mvwap; // transformer to change inputs in var's (color previous monthly vwap)
dvwap1 = vwap_d; // take over daily vwap function for current daily vwap
wvwap1 = vwap_w; // take over daily vwap function for current weekly vwap
mvwap1 = vwap_m; // take over daily vwap function for current monthly vwap
// ==================================================================================================================================================
// Definition of prior Daily/Weekly/Monthly VWAP's
// ==================================================================================================================================================
// Daily VWAP
if date>date[1] then dvwap2=dvwap1[1];
if date<>date[1]
then
begin
dvwap2 = dvwap1[1];
end;
// Weekly VWAP
if week(date)>week(date)[1]
then
wvwap2 = wvwap1[1];
if week(date)<>week(date)[1]
then
begin
wvwap2 = wvwap1[1];
end;
// Monthly VWAP
if month(date)>month(date[1])
then
mvwap2 = mvwap1[1];
if month(date)<>month(date[1])
then
begin
mvwap2 = mvwap1[1];
end;
// ==================================================================================================================================================
// Rounding Definitions
// ==================================================================================================================================================
if rv=1
then
begin
dvwap1 = roundinst(dvwap1);
dvwap2 = roundinst(dvwap2);
wvwap1 = roundinst(wvwap1);
wvwap2 = roundinst(wvwap2);
mvwap1 = roundinst(mvwap1);
mvwap2 = roundinst(mvwap2);
end;
// ==================================================================================================================================================
// Color Definitions
// ==================================================================================================================================================
// Daily VWAP
if close>dvwap1 then cd=cad else if close<dvwap1 then cd=cbd;
// Weekly VWAP
if close>wvwap1 then cw=caw else if close<wvwap1 then cw=cbw;
// Monthly VWAP
if close>mvwap1 then cm=cam else if close<mvwap1 then cm=cbm;
// ==================================================================================================================================================
// Plot Statements
// ==================================================================================================================================================
// Daily VWAP
if sdv=1
then
begin
plot1(dvwap1,"Curr._DVWAP",cd);
plot2(dvwap2,"Prev._DVWAP",cpd);
end;
// Weekly VWAP
if swv=1
then
begin
plot3(wvwap1,"Curr._WVWAP",cw);
plot4(wvwap2,"Prev._WVWAP",cpw);
end;
// Monthly VWAP
if smv=1
then
begin
plot5(mvwap1,"Curr._MVWAP",cm);
plot6(mvwap2,"Prev._MVWAP",cpm);
end;
Math is a weakness, so you will most certainly wish to double and triple check accuracy. I haven't had time to test yet.
set numdays to -1 for a continuous never ending rolling vwap
set numdays to 0 to reset every sunday
set numdays to any other day to reset after numdays
It didn't quite work, so I modified it and now it works: This is the weekly VWAP. It matches the daily Tradestation VWAP indicator perfectly on Mondays. It also matches very well the weekly VWAP on TradingView.