NexusFi: Find Your Edge


Home Menu

 





Quarterly, Weekly VWAP


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one kbit with 2 posts (9 thanks)
    2. looks_two Big Mike with 2 posts (2 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 sptrader with 1 posts (0 thanks)
      Best Posters
    1. looks_one kbit with 4.5 thanks per post
    2. looks_two cbritton with 2 thanks per post
    3. looks_3 Big Mike with 1 thanks per post
    4. looks_4 forex jim with 1 thanks per post
    1. trending_up 7,593 views
    2. thumb_up 14 thanks given
    3. group 5 followers
    1. forum 9 posts
    2. attach_file 1 attachments




 
Search this Thread

Quarterly, Weekly VWAP

  #1 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256

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
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662



cbritton View Post
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

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.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
kbit's Avatar
 kbit 
Aurora, Il USA
 
Experience: Advanced
Platform: TradeStation
Trading: futures
Posts: 5,854 since Nov 2010
Thanks Given: 3,295
Thanks Received: 3,364


cbritton View Post
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

@ cbritton, Go to the TS forums and look for "VWAP MWD" https://community.tradestation.com/discussions/topic.aspx?topic_id=6735&Page=4Maybe I can also post the code here and you can import it if you know how, below is the ELD just click on it and it should import:


20110314041801VWAP_MWD.ELD

Reply With Quote
  #5 (permalink)
 tradernovice 
Venice/Italy
 
Experience: Intermediate
Platform: MetaTrader4
Broker: Oanda
Trading: EurUsd
Posts: 23 since Jun 2011
Thanks Given: 361
Thanks Received: 9


kbit View Post
@ cbritton, Go to the TS forums and look for "VWAP MWD" https://community.tradestation.com/discussions/topic.aspx?topic_id=6735&Page=4Maybe I can also post the code here and you can import it if you know how, below is the ELD just click on it and it should import:


Attachment 50209

is there any possibilities to have it working with multicharts?
I tried to import it but was not possible.
thanks
nt

Reply With Quote
  #6 (permalink)
 
kbit's Avatar
 kbit 
Aurora, Il USA
 
Experience: Advanced
Platform: TradeStation
Trading: futures
Posts: 5,854 since Nov 2010
Thanks Given: 3,295
Thanks Received: 3,364


tradernovice View Post
is there any possibilities to have it working with multicharts?
I tried to import it but was not possible.
thanks
nt

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;

Reply With Quote
  #7 (permalink)
 proton242 
Italy
 
Experience: Beginner
Platform: MultiCharts
Posts: 10 since Aug 2010
Thanks Given: 10
Thanks Received: 1

@ tradernovice
with MC 7 work very well.

Someone know how to add start date and time? It's possible add also PVP and Standard Deviation daily/weekly/monthly?
Thank you

Reply With Quote
  #8 (permalink)
 
sptrader's Avatar
 sptrader 
Colorado
 
Experience: Advanced
Platform: MultiCharts
Broker: IB & Iqfeed
Trading: ES , CL
Posts: 535 since Apr 2010
Thanks Given: 1,097
Thanks Received: 701


tradernovice View Post
is there any possibilities to have it working with multicharts?
I tried to import it but was not possible.
thanks
nt

*****************************************************
It imported OK for me on Multicharts 7

Reply With Quote
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662

Here is a multi-session VWAP I wrote for MultiCharts.

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



 
Code
                            
// Function
// Copyright 2011 Big Mike Trading, www.bigmiketrading.com
// You may NOT distribute
// numdays = -1 for continuous, 0 to reset on sunday, any other day to reset every x days

input:
   
PriceValue(NumericSeries),
   
numdays(NumericSimple);

vars:
   
var0(0),
   
var1(0),
   
var2(0),
   
daycount(0);
   
once cleardebug;

if 
DayOfWeek(Date) <> DayOfWeek(Date)[1then daycount daycount 1;

var0 var0 + (PriceValue Ticks);
var1 var1 Ticks;

if 
numdays and DayOfWeek(Date) = Sunday then begin

    var0 
= (PriceValue Ticks);
    
var1 Ticks;

end;

if 
numdays <> and daycount numdays then begin
    
    var0 
= (PriceValue Ticks);
    
var1 Ticks;
    
daycount 0;

end;


if 
var0 and var1 0 then
   var2 
var0 var1
else
   
var2 PriceValue;

vwapMultiSession var2
Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
 forex jim 
Princeton NJ, USA
 
Experience: Advanced
Platform: Bookmap, Volumetrica
Broker: AMP futures
Trading: NQ
Posts: 11 since May 2019
Thanks Given: 17
Thanks Received: 21



Big Mike View Post
Here is a multi-session VWAP I wrote for MultiCharts.

Math is a weakness, so you will most certainly wish to double and triple check accuracy. I haven't had time to test yet.

Mike



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.

 
Code
                            
// weekly VWAP


vars:
   
Weighted_Price(0),
   
TotalVolume(0),
   
Weekly_VWAP(0),
   
on_trigger);  


if 
DayOfWeek(Date) < DayOfWeek(Date[1]) then begin
    on_trigger 
1;
    
Weighted_Price AvgPrice Ticks;
    
TotalVolume Ticks;
    
SetPlotColor[1]( 1transparent );
end
else begin
    Weighted_Price 
Weighted_Price + (AvgPrice Ticks);
    
TotalVolume TotalVolume Ticks;
end;


if 
TotalVolume 0 then 
    Weekly_VWAP 
AvgPrice
else 
    
Weekly_VWAP Weighted_Price TotalVolume;


if 
on_trigger 0 then    // set plot to transparent if start of the week has not yet been detected
    
SetPlotColor[1]( 1transparent );

Plot1(Weekly_VWAP); 



Here is the monthly VWAP:

 
Code
                            
// monthly VWAP


vars:
   
Weighted_Price(0),
   
TotalVolume(0),
   
Monthly_VWAP(0),
   
on_trigger);  


if 
Month(Date[1]) <> Month(Datethen begin
    on_trigger 
1;
    
Weighted_Price AvgPrice Ticks;
    
TotalVolume Ticks;
    
SetPlotColor[1]( 1transparent );
end
else begin
    Weighted_Price 
Weighted_Price + (AvgPrice Ticks);
    
TotalVolume TotalVolume Ticks;
end;


if 
TotalVolume 0 then 
    Monthly_VWAP 
AvgPrice
else 
    
Monthly_VWAP Weighted_Price TotalVolume;


if 
on_trigger 0 then    // set plot to transparent if start of the week has not yet been detected
    
SetPlotColor[1]( 1transparent );

Plot1(Monthly_VWAP); 

Reply With Quote
Thanked by:




Last Updated on November 29, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts