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

Re: [amibroker] ColorCode Syntax Help please



PureBytes Links

Trading Reference Links



TAS&C Dec. 2000, (Vol. 18, #12), p.32, "Volume-Weighted Average
Pricing" by Michael Tanksley, PhD.
http://www.traders.com
HHP
=====================
At 10:25 AM 22/02/2004, you wrote:
Herman,
 
Is there a description of how to use VWAP for
trading? .. Sounds like it may have potential... I am just not familiar
with it


----- Original Message ----- 

From: Herman van den Bergen


To: amibroker@xxxxxxxxxxxxxxx 

Sent: Sunday, February 22, 2004 4:34 AM

Subject: RE: [amibroker] Calculating VWAP prices with RT data

Ara and others, the explanation for the Xmas holday descrepancey its that they were trading half days, my code is looking for 4pm, which never came. Need to check for the last bar before 4pm...

 

h

-----Original Message-----

From: Herman van den Bergen [mailto:psytek@xxxxxxxx]

Sent: Sunday, February 22, 2004 7:27 AM

To: amibroker@xxxxxxxxxxxxxxx

Subject: RE: [amibroker] Calculating VWAP prices with RT data

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!


Herman

EndOfDay = TimeNum() == 160000;

StartOfDay = TimeNum() == 093000;

TradingHours = TimeNum() >= 093000AND TimeNum() <= 160000;

BarsInDay = 390;                                                                                                  // Number of minutes in a day

DailyMF = 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/volume

VWAP=ValueWhen(EndOfDay, VWAP,0);

Plot(IIf(TradingHours,VWAP,Null),"VWAP",4,1|4);

Plot(C,"Close",1,64);


h

-----Original Message-----

From: Ara Kaloustian [mailto:ara1@xxxxxxxxxx]

Sent: Saturday, February 21, 2004 11:16 PM

To: amibroker@xxxxxxxxxxxxxxx

Subject: Re: [amibroker] Calculating VWAP prices with RT data


Herman,

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 Bergen

To: AmiBroker

Sent: Saturday, February 21, 2004 6:31 PM

Subject: [amibroker] Calculating VWAP prices with RT data


Further 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*volume

DailyVol = ValueWhen(EndOfDay,Sum(V,390));                       // calculate daily volume

VWAP = DailyMF/DailyVol;                                                         // VWAP

Plot(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."

[ http://interactivebrokers.com/html/tradingInfo/orders/vwapOrders.html ]

Thanks,

herman




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 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.


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



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




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. 


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 



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 



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. 



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.