that monthly was create before the timeframe functions were created by TJ
The weekly on a daily period chart does give the same value for each day of the week unitl the next week ends.
To get just one candle, on say the last day of the week you could try
dow = dayofweek();
wo = iif(dow>ref(dow,1), TimeFrameExpand(wo,inWeekly), null);

now this will give a bar showing only on the last day of the week (eg Friday)

for monthly you just change all the inweekly to inmonthly

The other method to show both daily and weekly would be to open a new linked window and have this window set this to weekly. They will scroll  in psynch with each other as far as the days for that week or month

--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm

On 18/09/06, Tony <[EMAIL PROTECTED]> wrote:
Graham,

Thank you.

I had originally tried coding the indicator the way you mentioned(
see below). However, this code applies the same candle 5 times for
each day in the week, rather than just one candle for each week. I
guess this is because the interval is still daily on the worksheet
tab.
I could just create another tab whose interval could be weekly and I
could get the data i am looking for, however it would be nice to have
the indicator available on the daily worksheet. I know it has been
done for a monthly indicator, by Graham Kavanagh
http://www.amibroker.com/library/formula.php?id=249


Am i doing something obviously incorrect? Am i missing something else?
I would the indicator to display in the title: weekdate, Open, high,
low, close


// Weekly Bar Chart in a worksheet with a daily interval
_SECTION_BEGIN("Weekly Graph");
TimeFrameSet( inWeekly );
wo = O;
wh = H;
wl = L;
wc = C;
TimeFrameRestore();
wo = TimeFrameExpand(wo,inWeekly);
wh = TimeFrameExpand(wh,inWeekly);
wl = TimeFrameExpand(wl,inWeekly);
wc = TimeFrameExpand(wc,inWeekly);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %
g, Lo %g, Close %g (%.1f%%) {{VALUES}}", wO, wH, wL, wC, SelectedValue
( ROC( C, 1 ) ) ));

PlotOHLC( wo, wh, wl, wc, "Weekly Close", colorBlack, styleCandle );
_SECTION_END();





--- In [email protected] , Graham <[EMAIL PROTECTED]> wrote:
>
> You need to use timeframeexpand function to get the weekly to fit
the daily
> chart
> eg
> wo = timeframexpand(wo,inweekly);
>
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
>
>
> On 16/09/06, Tony <[EMAIL PROTECTED]> wrote:
> >
> > Hi everyone... newbie here.
> >
> > I have been trying to test Dr Elders formula for Triple screen,
for
> > which there is a AFL formula in the www.amibroker.com/library.
> >
> > There are indicators provided within the AFL script. However, the
> > Weekly chart indicator does not work correctly. The OHLC ranges
are
> > not correct and are not displayed by weekdate. See below.
> >
> > // Weekly Bar Chart
> > //_SECTION_BEGIN("Weekly Graph");
> > //TimeFrameSet( inWeekly );
> > //wo = O;
> > //wh = H;
> > //wl = L;
> > //wc = C;
> > //TimeFrameRestore();
> > //PlotOHLC( wo, wh, wl, wc, "Weekly Close", colorCustom9,
styleBar );
> > //_SECTION_END();
> > //_SECTION_BEGIN("EMA");
> > //P = ParamField("Price field",-1);
> > //Periods = Param("Periods", 15, 2, 200, 1, 10 );
> > //Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color",
> > colorYellow ),ParamStyle("Style") );
> > //_SECTION_END();
> >
> > I have been looking for a Weekly chart indicator which displays
OHLC
> > by week in our user group and the AFL library. I can only find a
> > working monthly created by Graham Kavanagh 26 Dec 2002 in the
> > amibroker/library (very cool script that uses _javascript_ within
the
> > AFL).
> >
> > The logic to build this indicator does not seem trivial. Does
anyone
> > have a working version of a Weekly chart indicator which will
work on
> > an EOD daily database? It would be beneficial to display in the
> > title: weekdate, Open, High, low, close.
> >
> > Thank you in advance for your help. We should post this indicator
so
> > it is easily available for everyone.
> >
> > Tony
> >
> >
> >
> >
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>







Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html


Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto: [EMAIL PROTECTED]
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

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







__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to