Opération en Virgule flottante

Questions about MultiCharts and user contributed studies.
rvnono
Posts: 14
Joined: 29 Oct 2013
Has thanked: 1 time

Opération en Virgule flottante

Postby rvnono » 03 Dec 2014

Hello ,
Please excuse me for my English.
This is the code of VWAP .
On the charts in Minutes or Hours , it's OK.
On the charts in RANGECANDLE , it's ok for YM Dec14 and FDAX Dec14 (IB code), but for GCZ5 (gold) and EUR.USD , I see this message :
Message ;Error in study "VWAPbis(EUR.USD-2Point)";
{EXCEPTION}
Opération en virgule flottante non valide .
What is the problem ? Can you help me ?
Thanf you in advance ,
Regards
H.Paternotte

CODE (VWAPbis)
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 >= 0000 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);
Plot1(vwap);
Plot2(vwap+standarddeviation);
Plot3(vwap+2*standarddeviation);
Plot4(vwap-standarddeviation);
Plot5(vwap-2*standarddeviation);
Plot6(vwap+3*standarddeviation);
Plot7(vwap-3*standarddeviation);

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

Re: Opération en Virgule flottante

Postby TJ » 03 Dec 2014

Hello ,
Please excuse me for my English.
This is the code of VWAP .
On the charts in Minutes or Hours , it's OK.
On the charts in RANGECANDLE , it's ok for YM Dec14 and FDAX Dec14 (IB code), but for GCZ5 (gold) and EUR.USD , I see this message :
Message ;Error in study "VWAPbis(EUR.USD-2Point)";
{EXCEPTION}
Opération en virgule flottante non valide .
What is the problem ? Can you help me ?
Thanf you in advance ,
Regards
H.Paternotte
::
VWAP = Volume Weighted Average Price

That means volume is required for its calculation.

YM has volume
but forex does not.

rvnono
Posts: 14
Joined: 29 Oct 2013
Has thanked: 1 time

Re: Opération en Virgule flottante

Postby rvnono » 03 Dec 2014

Thank you for your answer .
OK for the forex .
But GCZ5 has volume , and VWAP is possible with charts in Minutes or Hours , but not with charts in RANGECANDLE .
Why ?
Thank you

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

Re: Opération en Virgule flottante

Postby TJ » 03 Dec 2014

Thank you for your answer .
OK for the forex .
But GCZ5 has volume , and VWAP is possible with charts in Minutes or Hours , but not with charts in RANGECANDLE .
Why ?
Thank you
What do you mean by "but not with charts in RANGECANDLE." ?
What exactly does not work?
What is the range parameters?
Can you post a screenshot?

Please make sure you have volume data in your gcz5. It is a distance contract, you might not have much. You might have some bad data bars (eg. empty volume).

You can plot a RANGECANDLE chart with the volume indicator as a subchart; you should be able to see how much volume data you have.

ps. please look up VWAP in the web, there are lots articles on the subject; please study the logic to understand how it works, and how to apply it to your analysis.

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

Re: Opération en Virgule flottante

Postby TJ » 03 Dec 2014

ps.
[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713


Return to “MultiCharts”