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);
Opération en Virgule flottante
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Opération en Virgule flottante
VWAP = Volume Weighted Average PriceHello ,
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
::
That means volume is required for its calculation.
YM has volume
but forex does not.
Re: Opération en Virgule flottante
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
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
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Opération en Virgule flottante
What do you mean by "but not with charts in RANGECANDLE." ?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 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.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times