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

[amibroker] Re: Some questions to AFL and functions!!!



PureBytes Links

Trading Reference Links

I use this file to answer some of the questions you have. It is for 
my own use so not beautified!!!

/*Time AND Hour exercise*/
/*Version: 3*/
CM=Cum(1);
Hr=15;                		//Fill in selected hour of the day
Hr1=19;                		//Fill in selected hour of the day
Hr2=19;                		//Fill in selected hour of the day
Mn=0;                 		//Fill in selected minute of the hour.
StartDate=1020707;	//Fill in startdate as follows 10000 * (year -
 1900) + 100 * month + day, so 2001-12-31 becomes 1011231 and 1995-12-
31 becomes 951231
EndDate=1030707;		//Fill in startdate as follows 10000 
* (year - 1900) + 100 * month + day, so 2001-12-31 becomes 1011231 
and 1995-12-31 becomes 951231

/*Enable filter below for finding number of bars from last bar for a 
particular day and time in the past.*/
//Filter=(Hour()==Hr AND Minute()==Mn AND DateNum()>startdate AND 
DateNum()<enddate) OR (Hour()==Hr1 AND Minute()==Mn AND DateNum()
>startdate AND DateNum()<enddate);

/*Enable filter for finding number of bars from last bar for a 
particular time of the day.*/
//Filter=Hour()==Hr;
/*Filter for the number of days during a certain period. Setting of 
periodicy: daily*/
//Filter=Cm AND DateNum()>startdate AND DateNum()<enddate;	
					
/*Filter for 1 moment of the day Hr*/
Filter=Hour()==Hr AND Minute()==Mn;    				
								
			    
/*Filter for 2 moments of the day Hr and r1*/
//Filter=(Hour()==Hr AND Minute()==Mn) OR (Hour()==Hr1 AND Minute()
==Mn);   							
	    
/*Filter for 3 moments of the Day Hr, Hr1 AND Hr2*/
//Filter=(Hour()==Hr AND Minute()==Mn) OR (Hour()==Hr1 AND Minute()
==Mn) OR (Hour()==Hr2 AND Minute()==Mn);   

LVCM=LastValue(Cum(1),True);					
						//Last bar number
CMInt=LVCM-ValueWhen(Hour()==Hr OR Hour()==Hr1 OR Hour()==Hr2,Cum(1));
	//Number of bars till last bar for  
CMD=LVCM-CM;							
							//Number of 
bars till lats bar onm daily basisi (setting = daily)
AddColumn(IIf(Hour()==Hr OR Hour()==Hr1 OR Hour()==Hr2 AND Minute()
==Mn,Cum(1),2),"Bars since 1st bar",format=1.0);
AddColumn(CMInt,"Bars till last bar",format=1.0);
AddColumn(LVCM,"Last Bar Number",format=1.0);
AddColumn(CM,"Nr. Bars from start",format=1.0);
AddColumn(CMD,"Bars till last bar",format=1.0);
AddColumn(DateNum(),"date",1.0);
AddColumn(CMInt-Ref(CMInt,-1),"Bars p/ Day",format=1.0);
AddColumn(Ref(CMint,-1),"c",format=1.0);  
  
--- In amibroker@xxxxxxxxxxxxxxx, "Thomas Schneider" <TS-
Schneider@xxxx> wrote:
> Hi Folks,
> I have some questions regarding the arrays.
> For example the Close array. If I have e.g 5-Minutes bars. How much 
> entries does the array have. How can I get the first value of the 
bar 
> and how the last.
> How can can I determine the number of entries in the array?
> 
> 
> Thx 
> Regards
> Thomas


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/sO0ANB/LIdGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/