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

RE: If I can stay awake.... part 2



PureBytes Links

Trading Reference Links

**BP Vol_IntraAvg2 - indicator

In subgraph one, scale to screen

Plot1: Yellow line = N day average of NASDAQ+NYSE volume for the last 5
minutes at the same time every day.
Plot2: Magenta line = 3 day average of NASDAQ+NYSE volume for the last 5
minutes at the same time every day.
Plot3: Yellow line = level where Plot 1 will end up on last bar of the
day.
Plot4: Light Gray point = Actual value of current volume.

---  cut/copy from here --

{Bob Perry 2/01, 5/01
only use with time bar charts
futures have 405 minutes, indexes only have 390 minutes
Data1 = $VOLQE - NASDAQ Total Volume
Data2 = $VOLU - NYSE Total Volume	}
{-----  If you are using just one data stream: "High Data1 + High Data2"
can be replaced with "High"  -----}

Inputs:	DaysBak (10);	{ 10 day max unless you change array }
Vars:	BSS (0),		{ BSS = BarsSinceStart of Day }
		Daycount(0),
		Barcount(0),
		Sum(0),
		TodaysAvg10(0),
		TodaysAvg3(0),
		Avg3Day(0);	
Arrays:	Volume10Day[{405}78, 10](0),	{two dimensional array set up for 5
minute bars}
		Volume3Day[{405}78](0) ;		{one dimensional array set up for 5 minute
bars}

If date <> date[1] then begin
	for daycount = DaysBak downto 1 begin
		for barcount = 1 to 81 begin
			Volume10Day[ Barcount, Daycount ] = Volume10Day[ Barcount, Daycount-1
];
		End;
	End;

	for barcount = 1 to 81 begin
		Sum = 0;
		For Daycount = 1 to DaysBak begin
			Sum = Sum + Volume10Day[ BarCount, Daycount ];
		End;
		Volume10Day[ Barcount, 0 ] = Sum/DaysBak;
	End;

	for barcount = 1 to 81 begin
		Sum = 0;
		For Daycount = 1 to 3 begin
			Sum = Sum + Volume10Day[ BarCount, Daycount ];
		End;
		Volume3Day[ Barcount ] = Sum/3;
	End;
	
	TodaysAvg10 = Volume10Day[ BSS, 0 ] ;
	TodaysAvg3 = Volume3Day[ BSS ] ;

End;

BSS = Round(( TimeToMinutes(time) -
TimeToMinutes(Sess1StartTime))/BarInterval , 0 );

Plot3( TodaysAvg10, "TodaysAvg10" );
{color:yellow,type:line,style:1,weight:1}
{ Plot4( TodaysAvg3, "TodaysAvg3" ); 
{color:magenta,type:line,style:1,weight:1}}

If Currentbar >= DaysBak * Round(( TimeToMinutes(Sess1EndTime) -
TimeToMinutes(Sess1StartTime))/BarInterval, 0 ) then begin
	Plot1( Volume10Day[ BSS, 0 ], "Avg10Vol" ) ;
{color:yellow,type:line,style:1,weight:1}
	Plot2( Volume3Day[ BSS ], "Avg3Vol" ) ;	
{color:magenta,type:line,style:1,weight:1}
End;

If BSS = 1 then Value1 = ( High Data1 + High Data2 )
	Else Value1 = MaxList( Value1[1], ( High Data1 + High Data2 )) ;

Volume10Day[ BSS, 0 ] = Value1 ;
	
Plot4( Value1, "Volume" );	{color:light
gray,type:point,style:1,weight:1}

---  cut/copy to here --

Bob Perry
San Jose, CA

Attachment: Description: "INTRAAVG2.ELA"