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

Re: [amibroker] Re: how to convert barnumber to date string?



PureBytes Links

Trading Reference Links

Try this, load into indicator builder, click apply...

x=Cum(1);
fastperiod=3;
slowperiod=10;
Cond=ValueWhen(Cross(MA(C,fastperiod),MA(C,slowperiod)),x,1);

Month1=ValueWhen(Cond==x,Month());
Day1=ValueWhen(Cond==x,Day());
Year1=ValueWhen(Cond==x,Year());

Cond2=ValueWhen(Cross(MA(C,slowperiod),MA(C,fastperiod)),x,1);

Month2=ValueWhen(Cond2==x,Month());
Day2=ValueWhen(Cond2==x,Day());
Year2=ValueWhen(Cond2==x,Year());


Plot(C,"close",colorBlack,styleCandle);
Plot(MA(C,fastperiod),"",colorRed,styleLine);
Plot(MA(C,slowperiod),"",colorBlue,styleLine);

//interpretation

"The "+WriteVal(fastperiod,1)+" period moving average
moved"+WriteIf(MA(C,fastperiod)>MA(C,slowperiod)," above"," below")+"
the "+WriteVal(slowperiod,1)+"  period moving average on
:"+WriteIf(MA(C,fastperiod)>MA(C,slowperiod),WriteVal(Month1,1)+"/"+WriteVal(Day1,1)+"/"+WriteVal(Year1,1),WriteVal(Month2,1)+"/"+WriteVal(Day2,1)+"/"+WriteVal(Year2,1));

"mmqp " wrote:

>  for a start, I'd like to display it in the interpretation window.  Is
>
> there a limitation to which one you can display to?  TIA
>
> --- In amibroker@xxxxxxxxxxxxxxx, Anthony Faragasso <ajf1111@xxxx>
> wrote:
> > Where do you want to display the date...AA...Guru
> commentary...Indicator
> > builder...etc.
> >
> > Anthony
> >
> > "mmqp " wrote:
> >
> > >  Sorry, I did not ask the question clearly.  I have a particular
> bar
> > > and want to know what the corresponding date is;  and would like
> to
> > > display in yymmdd or mmddyy format.  TIA
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanag@xxxx> wrote:
> > > > dateString = DateNum() + 19000000;
> > > >
> > > > gives yyyymmdd
> > > >
> > > > Cheers,
> > > > Graham
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: mmqp <mmqp@xxxx> [mailto:mmqp@x...]
> > > > Sent: Thursday, 13 February 2003 5:44 AM
> > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > Subject: [amibroker] how to convert barnumber to date string?
> > > >
> > > > Can someone help converting barnumber to date string?
> > > > some thing like:
> > > >
> > > > eg.  dateString = datenum (barnumber);
> > > >
> > > > dateString can be same format as yymmdd.  TIA
> > > >
> > > >
> > > > 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
> >                         ADVERTISEMENT
> >
> >
> > >
> > > 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 the Yahoo! Terms of
> Service.
>
>
>                    Yahoo! Groups Sponsor
                        ADVERTISEMENT


>
> 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 the Yahoo! Terms of Service.


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/