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

[amibroker] Average Traded Price (ATP) modification



PureBytes Links

Trading Reference Links



Dear Tomaz,
 
This is ATP.afl for Average Traded Price.
========================================
DayChange = Day() != Ref(Day(), -1);
AvgTradePrice = Null;
CurDayBars = 0;
CurDayCloseSum = 0;
for (i = 0; i < BarCount; i++)
{
if (DayChange[i] )
{
CurDayCloseSum = C[i];
CurDayBars = 1;
}
else
{
CurDayCloseSum = CurDayCloseSum + C[i];
CurDayBars++ ;
}
AvgTradePrice[ i] = CurDayCloseSum / CurDayBars;
}
Plot(AvgTradePrice, "ATP" , 55, 1);
PlotShapes(shapeCircle * DayChange, colorBlue, 0, C, 0);
==============================================
There is little error in calculation.
There is Summession of Every closing price in one variable and then deviding No of bars then ATP derrives.But actually it may as under:
 
The Price may linked with Volume.
A=Price*Volume=Traded Value then (This may store in one variable)
B=Volume may store in seperate varable.
Finally, ATP= (A)Total Taded Value(Turnover)/(B)No of Traded Shares
I request o please modify the formula and oblige.
 
Thanking you with Kind Regards,

Haresh Patel



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___