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

[amibroker] workaround AFL problem



PureBytes Links

Trading Reference Links

hello everybody,

I'd like to have daily moving average on intraday charts. in AMi 4.40 there are no time range functions so I wrote the following code:

arrClose	= 0;
arrMAtmp	= 0;
arrMA		= 0;
dblLast	= 0;

arrEOD	= IIf( DateNum()!=Ref(DateNum(),1), 1, 0);

j = 0;
for(i=0; i<BarCount; i++) if ( arrEOD[i] ) { arrClose[j] = arrEOD[i] * Close[i]; j++; };
arrMAtmp = MA(arrClose, Param("DayPrd", 20, 2, 200, 1));

j = 0;
for(i=0; i<BarCount; i++) {
  if ( arrEOD[i] ) { arrMA[i]=arrMAtmp[j]; dblLast=arrMAtmp[j]; j++; }
  else { arrMA[i]= dblLast; }
}

PlotShapes( shapeHollowSmallCircle, colorOrange, 8, arrMA, 0);

this works on 60 & 30 minutes charts. but the lower interval the plot disappears.. I can't find any solution. could anybody help me to repair this code?

cheers,
BM


------------------------ 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/mOAaAA/3exGAA/qnsNAA/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/