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

[amibroker] Re: Intraday indicator loop question



PureBytes Links

Trading Reference Links

I see what you're saying, I could make it reset after every 390 bars 
(6.5 hrs. * 60 mins) or whatever.  That would work for most days but 
would get messed up whenever there was a half day like on New Years 
Eve.  I guess I could remove all the half days from my data.  Is 
there no way to make it reset at 9:30 every day though?



--- In amibroker@xxxxxxxxxxxxxxx, "rlb21079" <rlb21079@xxxx> wrote:
> I can do a little better than that,
> 
> day  = 0; //your day array
> time = 0; //your time array
> for(i=1;i<BarCount;i++)
> {
> time[i] = time + 1; //assume for example time in hrs. and 6 hrs./day
> day[i]  = Iif(frac(time/6)==0,day+1,day);
> if (day[i] != day[i-1])
> {
> your coding...
> }
> else...
> 
> > > IntradayH[0]=High[0];
> > > IntradayL[0]=Low[0];
> > > 
> > > for(i=1;i<BarCount;i++)
> > > {
> > > if(TimeNum()==093000)
> > > {
> > > IntradayH[i]=High[i];
> > > IntradayL[i]=Low[i];
> > > }
> > > else
> > > {
> > > IntradayH[i]=max(IntradayH[i-1], High[i]); 
> > > IntradayL[i]=min(IntradayL[i-1], Low[i]);
> > > }
> > > }
> > > Plot( IntradayH, "High", 27); Plot( IntradayL, "Low", 32);
> > > 
> > > 
> > > NOTE:  I know that I can create the intraday high/low with the 
> > > following AFL code...
> > > 
> > > IntradayH = IIf(TimeNum() == 930000, High, HHV(High, BarsSince
> > (TimeNum
> > > () == 093000)));
> > > IntradayL = IIf(TimeNum() == 930000, Low, LLV(Low, BarsSince
> (TimeNum
> > > () == 093000)));
> > > 
> > > ...but I want to know how to do it with a loop because I have a 
> > > couple of other ideas that also need to be reset at the 
beginning 
> > of 
> > > each day, but are too complex to code without a loop (without 
the 
> > > program crashing).  If anyone can help it would be much 
> appreciated.
> > > 
> > > Greg


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/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/