Page 1 of 1

Help with formula: day counter and PRINT

Posted: 10 Oct 2009
by arnie
Hi.

I have this simple and little formula that counts the days for each year.

Code: Select all

variables:
stYear (false),
count (0);

if Year(date) <> Year(date)[1] then begin
stYear = true;
count = 0;
end;

if stYear then
count = count + 1;

plot1(count);
What I'd like to know is how can I print the last value of each yearly count?

If I request to print the count variable, all days within the year will be printed, but what I want is to print only the last count for the last day of each year.

Thank you.
Fernando

Posted: 10 Oct 2009
by TJ
what is the chart resolution?

daily chart?

Posted: 11 Oct 2009
by arnie
Hi TJ.

Yes, daily chart.

The same will also be implemented for intraday charts, though the previous formula need to be altered accordingly.

Re: Help with formula

Posted: 13 Oct 2009
by TJ
Hi.

I have this simple and little formula that counts the days for each year.


What I'd like to know is how can I print the last value of each yearly count?

If I request to print the count variable, all days within the year will be printed, but what I want is to print only the last count for the last day of each year.

Thank you.
Fernando
what do you mean by "Print"?

print to PLE log?
print to a file?
print to a printer?
a print on the screen?

how would you like the print out formated?
can you make a mock up sample?

Re: Help with formula

Posted: 13 Oct 2009
by TJ
Hi.

I have this simple and little formula that counts the days for each year.


What I'd like to know is how can I print the last value of each yearly count?

If I request to print the count variable, all days within the year will be printed, but what I want is to print only the last count for the last day of each year.

Thank you.
Fernando

this might be what you are looking for:

Code: Select all

if Year(date) <> Year(date)[1] or LastBarOnChart
then
Plot1( Count [1] );

LastBarOnChart will give you a print on year-to-date number of days.