PureBytes Links
Trading Reference Links
|
Hello,
Q1. Yes. Just add SetBarsRequired( 10000, 0 ); at the top to turn off this effect
Q2. Not really. AFL automatically 'knows' how many bars are needed for given code to calculate properly
in most cases. The only cases when you should provide "hint" (via SetBarsRequired) are:
- you are using some external plugins
- some 'for' loops that access data more than 100 bars back
Hope this helps.
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "black_marubozu" <black_marubozu@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, November 21, 2003 8:34 AM
Subject: [amibroker] QuickAFL question
> hello everybody,
>
> I would like to have daily moving averages plot on intraday charts. because AB4.40 doesn't have time frame functions I wrote
workaround. it works well on 60 min data bars but the shorter interval, the less dots of daily MA are visible.
>
> q1: is that because of QuickAFL enabled?
> q2: if so, is it true that if QuuickAFL enabled and calculus involves variable that depends on its past values (eg. EMA), the
calculus will not be exact from point of required data?
>
> I would appreciate any explanation,
> regards,
> BM
>
> here's my code:
>
> //detecting last day bar
> arrLastDayBar = Nz( DateNum()!=Ref(DateNum(),1) );
>
> j = 0;
> arrCloseTmp = 0;
> for(i=0; i<BarCount; i++) {
> // if bar is day last bar -> put its close into temp array ("sqeezed" version of Close)
> if( arrLastDayBar[i] ) { arrCloseTmp[j] = Close[i] * arrLastDayBar[i]; j++; }
> }
>
> //temp array looks like C0,C1,..,C[lastday],0,0,0...0[lastbar]
> //evaluate MA of temp array
> arrCloseMA = MA(arrCloseTmp, 20);
> //and redistribute result through bars
> j = 0;
> for(i=0; i<BarCount; i++) {
> // if bar is day last bar -> fill cell of temp array with MA value
> if( arrLastDayBar[i] ) { arrCloseTmp[i] = arrCloseMA[j]; j++; }
> // otherwise put zero there
> else arrCloseTmp[i] = 0;
> }
>
> // finally plotshapes
> PlotShapes( IIf(arrCloseTmp, shapeHollowSmallCircle, shapeNone), colorBlue, 8, arrCloseTmp, 0);
>
>
>
> 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/
>
>
>
------------------------ 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/
|