Error with VWAP indicator  [SOLVED]

Questions about MultiCharts and user contributed studies.
madj0ker
Posts: 33
Joined: 11 Jan 2013

Error with VWAP indicator

Postby madj0ker » 07 Feb 2013

Hi, when i try insert the indicator below i have pop-up alert without explanation, someone know why? I use last MultiCharts RC, thank you.
// =====
// 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.TS.com/Discussion ... ic_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;
Attachments
generic_error.jpg
(15.78 KiB) Downloaded 650 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Error with VWAP indicator

Postby Henry MultiСharts » 08 Feb 2013

Hello madj0ker,

Plese post the functions codes so that the study can be compiled, or export the study with dependent functions:
in Power Language editor->File->Export->export with dependent functions

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: Error with VWAP indicator

Postby madj0ker » 08 Feb 2013

Here the file, thank you for support.
Attachments
vwap.pla
(39.56 KiB) Downloaded 497 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Error with VWAP indicator

Postby Henry MultiСharts » 08 Feb 2013

madj0ker, have you tried to restart MultiCharts and all of its processes?

Does the error appear on any chart or on a particular chart only?
I have no such problem in my MultiCharts. The code is calculated and plotted on the chart ok.
Is your MC 32 or 64 bit ?

Please attach the workspace you are using or come to our live chat to demonstrate this behavior 6.30am-4pm EST.

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: Error with VWAP indicator

Postby madj0ker » 08 Feb 2013

I have restarted also my PC, nothing. The problem is present in all charts that i use, i use last RC of MC 64bit
Attachments
chart.jpg
(590.26 KiB) Downloaded 626 times

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2223 times

Re: Error with VWAP indicator  [SOLVED]

Postby TJ » 08 Feb 2013

I have restarted also my PC, nothing. The problem is present in all charts that i use, i use last RC of MC 64bit
is there volume data in your symbol?

you can check by adding the Volume Average indicator.

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: Error with VWAP indicator

Postby madj0ker » 08 Feb 2013

yes TJ

madj0ker
Posts: 33
Joined: 11 Jan 2013

Re: Error with VWAP indicator

Postby madj0ker » 08 Feb 2013

I have deleted and import the indicator and now work


Return to “MultiCharts”