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

Re: [amibroker] Re: Coding Question



PureBytes Links

Trading Reference Links

Dean,

To answer your question, a price move accompanied by volume higher than  
average seems to be more significant than a price move on lower than  
average volume. Watching intraday volume without the reference of an  
average doesn't mean much since volune is typically greater at the  
beginning and end of the day than in the middle.

I added the plot function to the code below. Just paste it into Indicator  
Builder.

--Bill




// Volume
Color =  
IIf(Close>Ref(C,-1),colorGreen,IIf(Close<Ref(C,-1),colorRed,colorBlack));
Plot(V,"Volume ", Color, styleHistogram+styleThick,0 );


_SECTION_BEGIN("Intraday Average Volume");
// Intraday Average Volume

TradeDate1	=	1041116;	// trade date 1 day ago
TradeDate2	=	1041115;	// trade date 2 days ago
TradeDate3	=	1041112;	// trade date 3 days ago
TradeDate4	=	1041111;	// trade date 4 days ago
TradeDate5	=	1041110;	// trade date 5 days ago
TradeDate6	=	1041109;	// trade date 6 days ago
TradeDate7	=	1041108;	// trade date 7 days ago
TradeDate8	=	1041105;	// trade date 8 days ago

x1 = BarsSince(DateNum()==TradeDate1);	
x2 = BarsSince(DateNum()==TradeDate2);
x3 = BarsSince(DateNum()==TradeDate3);
x4 = BarsSince(DateNum()==TradeDate4);
x5 = BarsSince(DateNum()==TradeDate5);
x6 = BarsSince(DateNum()==TradeDate6);
x7 = BarsSince(DateNum()==TradeDate7);
x8 = BarsSince(DateNum()==TradeDate8);

CumVol1 = Sum(V,x1);				// cum vol today
CumVol2 = Sum(V,x2)-Sum(V,x2-x1);		// cum vol 1 day
CumVol3 = Sum(V,x3)-Sum(V,x3-x1);		// cum vol 2 days
CumVol4 = Sum(V,x4)-Sum(V,x4-x1);		// cum vol 3 days
CumVol5 = Sum(V,x5)-Sum(V,x5-x1);		// cum vol 4 days
CumVol6 = Sum(V,x6)-Sum(V,x6-x1);		// cum vol 5 days
CumVol7 = Sum(V,x7)-Sum(V,x7-x1);		// cum vol 6 days
CumVol8 = Sum(V,x8)-Sum(V,x8-x1);		// cum vol 7 days

V0 = CumVol1-Ref(CumVol1,-1);			// vol today
V1 = CumVol2-Ref(CumVol2,-1);			// vol 1 day ago
V2 = CumVol3-Ref(CumVol3,-1);			// vol 2 days ago
V3 = CumVol4-Ref(CumVol4,-1);			// vol 3 days ago
V4 = CumVol5-Ref(CumVol5,-1);			// vol 4 days ago
V5 = CumVol6-Ref(CumVol6,-1);			// vol 5 days ago
V6 = CumVol7-Ref(CumVol7,-1);			// vol 6 days ago
V7 = CumVol8-Ref(CumVol8,-1);			// vol 7 days ago

AvgVol = (V1+V2+V3+V4+V5+V6+V7)/7;		// 7 Day Average
diff = v0 - AvgVol;

Filter = DateNum()==Now(3);
AddColumn(O," Open  ",1.2);
AddColumn(H," High  ",1.2);
AddColumn(L,"  Low  ",1.2);
AddColumn(C," Close  ",1.2);
AddColumn(v0,"    Today   ",1.0);
AddColumn(Avgvol,"   Average   ",1.0);
AddColumn(diff,"Difference", 1.0 , IIf( diff < 0, colorRed, colorDefault),  
colorDefault );
AddColumn( Cum(diff),"Cumulative", 1.0 , IIf( Cum(diff) < 0, colorRed,  
colorDefault), colorDefault );

x = IIf(DateNum()==Now(3),Avgvol,Null);
Plot(x,"",colorBlack,styleLine|styleThick);
_SECTION_END();

Title = "{{NAME}} - {{INTERVAL}} {{DATE}} - MyChart : " + "\nVolume ="  
+ NumToStr(V,0) + ",  Average = " + NumToStr(Avgvol,0);





On Thu, 18 Nov 2004 01:51:21 -0000, Dean Hodgins <deanhodgins@xxxxxxxxx>  
wrote:

>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "W Schmidt" <william.schmidt@xxxx>
> wrote:
>
> Thanks all for your very helpful advise. Bill's code pretty much does
> exactly what I was looking for - a very nice bit of code.
> Do you find that this "unusual" volume scan versus same cummulative
> period average helps re finding trade candidates. I'm hoping to use
> as additional tweak to existing T3 based exploration.
>
> Best Regards,
>
> Dean H.
>
>
>
>> >
>> >
>> >
>> >
>> >
>
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at:  
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
>
>
>
>
>
>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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:
    http://docs.yahoo.com/info/terms/