[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Newbie question



PureBytes Links

Trading Reference Links




Thanks Ara,  here is the final formula. I maintain an 
ongoing sum of 390 minutes (min/day) and sample that at the end of the day. 
After having a good night's rest I realized what my problem is: I am plotting my 
VWAP on the next day instead of on the day it is calculated. I think VWAPs have 
some interesting trading opportunities....but read the IB disclaimer before 
using them.
Note that during the Xmas holidays (ellipse) something weird 
happened... I have no explanation for that yet. I have not 
been able to find any data-source for VWAP prices so it is difficult to verify 
whether the formula is actually correct.
Thanks everybody for your comments, discussion always helps to 
get to the bottom of things!
HermanEndOfDay = TimeNum() == 160000;StartOfDay = 
TimeNum() == 093000;TradingHours = TimeNum() >= 093000AND TimeNum() <= 
160000;BarsInDay = 
390;                                                                                                  
// Number of minutes in a dayDailyMF = 
ValueWhen(EndOfDay,Sum(V*(H+L)/2,BarsInDay 
));              // 
calculate daily price*volume (bar-by-bar)DailyVol = 
ValueWhen(EndOfDay,Sum(V,BarsInDay 
));                               
// calculate daily volume (bar-by-bar)VWAP = 
DailyMF/DailyVol;                                                                               // 
average price/volumeVWAP=ValueWhen(EndOfDay, 
VWAP,0);Plot(IIf(TradingHours,VWAP,Null),"VWAP",4,1|4);Plot(C,"Close",1,64);<IMG 
alt="" hspace=0 src="jpg00018.jpg" align=baseline 
border=0>h-----Original Message-----From: Ara Kaloustian [<A 
href="">mailto:ara1@xxxxxxxxxx]Sent: Saturday, 
February 21, 2004 11:16 PMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: 
[amibroker] Calculating VWAP prices with RT dataHerman,I 
think you need to look at each transaction separately, then sum the results in a 
loop.My understanding from the definition you provided is that you need 
data on each transaction, but it may be an adequate approximation if you take 
each minute as " a transaction"Ara----- Original Message 
-----From: Herman van den BergenTo: AmiBrokerSent: Saturday, 
February 21, 2004 6:31 PMSubject: [amibroker] Calculating VWAP prices with 
RT dataFurther to my earlier post copied down below I tried to code 
the daily VWAP prices for RT data but  i am getting some results but it 
"doesn't look" good. For example I cannot imagine how a VWAP price can be 
outside the daily high and low... comments invited on what could be wrong with 
my code. See definition of VWAY below.EndOfDay = TimeNum() == 
160000;StartOfDay = TimeNum() == 093000;TradingHours = TimeNum() >= 
093000AND TimeNum() <= 160000;DailyMF = 
ValueWhen(EndOfDay,Sum(V*(H+L)/2,390));       // 
calculate daily price*volumeDailyVol = 
ValueWhen(EndOfDay,Sum(V,390));                       
// calculate daily volumeVWAP = 
DailyMF/DailyVol;                                                         
// 
VWAPPlot(IIf(TradingHours,VWAP,Null),"VWAP",2,1);Plot(C,"",1,64);Plot(StartOfDay,"StartOfDay",5,2|styleOwnScale);Plot(EndOfDay,"EndOfDay",4,2|styleOwnScale);Plot(NOT 
TradingHours,"ExtHours",0,styleArea|styleOwnScale);Thanks,Herman.Hello,Has 
anybody written a VWAP formula for RT data? I would be happy with a minute 
approximation."...The VWAP for a stock is calculated by adding the dollars 
traded for every transaction in that stock ("price" x "number of shares traded") 
and dividing the total shares traded.A VWAP is computed from the open of 
the market to the market close, and is calculated by volume weighting all 
transactions during this time period."[ <A 
href="" 
target=_blank>http://interactivebrokers.com/html/tradingInfo/orders/vwapOrders.html 
]Thanks,hermanSend BUG REPORTS to 
bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlYahoo! 
Groups LinksTo visit your group on the web, go to:<A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/To unsubscribe 
from this group, send an email 
to:amibroker-unsubscribe@xxxxxxxxxxxxxxxYour use of Yahoo! Groups is 
subject to the Yahoo! Terms of Service.Send BUG REPORTS to 
bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlSend 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlYahoo! 
Groups SponsorADVERTISEMENTYahoo! Groups 
LinksTo visit your group on the web, go to:<A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/To unsubscribe 
from this group, send an email 
to:amibroker-unsubscribe@xxxxxxxxxxxxxxxYour use of Yahoo! Groups is 
subject to the Yahoo! Terms of Service. 


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


ADVERTISEMENT




Click Here















Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.






Attachment: Description: ""