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

Re[2]:EL Averaging Function



PureBytes Links

Trading Reference Links

Sorry I didn't understand what you were looking for but I think this code for
Price Distribution (Activity Bar) may help. The average price of the ticks in a
bar is the same as the Function AvgPrice. 
This will plot the avg price in a bar. Let me know if you need the .els files. 

{******** Indicator AvgPrice *********}

Plot1(AvgPrice,"AvgPrice")


If you want to see the Price Distribution in a bar, use this code on daily bars.



{***************** Price Distribution Activity Bars ******}

Inputs: ZoneStdDev(1), IntervalColors(True), IntervalMinutes(30),               
 NonIntColor(DarkGreen), ApproxNumRows(10);

Variables: CellColor(0), AB(0), ABSDev(0), ModePrice(0), HZone(0),           
LZone(0);

AB_SetRowHeight(AB_RowCalc(ApproxNumRows, 3));

If IntervalColors Then
 CellColor = AB_ColorIntervals(BarStatus(1), IntervalMinutes, BarInterval Data1)
of ActivityData;
If IntervalColors = False OR CellColor = -1 Then
 CellColor = NonIntColor;

AB = AB_AddCellRange(High ActivityData, Low ActivityData, RightSide,
NumToStr(CellColor, 0), CellColor, 0);

IF DataCompression of ActivityData > 0 Then Begin
 ABSDev = AB_StdDev(ZoneStdDev, RightSide);
 ModePrice = AB_ModePrice(RightSide);
 HZone = MinList(High, ModePrice + ABSDev);
 LZone = MaxList(Low, ModePrice - ABSDev);

 If HZone <> 0 AND LZone <> 0 Then 
  AB_SetZone(HZone, LZone, RightSide);
End;
 







____________________Reply Separator____________________
Subject: Re:EL Averaging Function
Author: Howard Jackson
Date:  7/15/99 3:05 PM

I think the original question was misunderstood. I
think the question is: how do I calculate the average
PRICE of the ticks during a day - on a daily chart?

And the only way to do this (to my knowledge), and I
have not done it myself, is with an activityBar in
2000i. If you put up a daily chart, and choose an
activityBar that adds a cell for each tick, then you
can use the function AB_Average() to get the average
tick price of the bar.

H