Calculating Studies only at the last bars

Questions about MultiCharts and user contributed studies.
SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Calculating Studies only at the last bars

Postby SP » 02 Aug 2010

I need to load for some pattern recognition charts with 40 000 bars back.

I now want that some very cpu consuming ADE indicators only calculate for the last 500 bars. Is there an way to implement this, i havent found an easy way with barnumber ?

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Re: Calculating Studies only at the last bars

Postby SUPER » 02 Aug 2010

just wondering if something like this will work:

date > MyDate then begin
..........
..........
end;


or

datetojulian(date) > datetojulian(date)-500 then begin

...........

...........

end;

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Calculating Studies only at the last bars

Postby Dave Masalov » 03 Aug 2010

Dear SP,

Please try the following:

Code: Select all

if(currentbar > 39 500 ) then ....


Return to “MultiCharts”