RecalcLastBarAfter Not Recognized in Scanner with MC64 Beta2

Questions about MultiCharts and user contributed studies.
trader39
Posts: 105
Joined: 08 Jan 2006
Has thanked: 8 times
Been thanked: 5 times

RecalcLastBarAfter Not Recognized in Scanner with MC64 Beta2

Postby trader39 » 21 Mar 2012

The RecalcLastBarAfter() function does not seem to work in studies applied to scanner windows in MC64 beta 2. This is critical when the scanner is loaded with long time frame data (e.g. daily), because otherwise "update on every tick" must be selected in order to view updates more frequently than the bar interval; which can create a tremendous CPU load with active symbols. Currently, with daily data loaded in the Scanner, if "update on every tick" is not selected, the calculation is based on the previous day's close for the entire day, which renders the scanner window useless for trading. I did not notice this problem with the MC64 pre-beta.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: RecalcLastBarAfter Not Recognized in Scanner with MC64 B

Postby Henry MultiСharts » 22 Mar 2012

Hello Trader39,

"RecalcLastBarAfter" code word works in the scanner window.
If "update on every tick" option is disabled then the indicator code will be calculated only on the bar close.
You need to enable "update on every tick" option. You can limit your code from recalculation on every tick. With the following code sample your script will be executed each 100 ticks.

Code: Select all

var: intrabarpersist count(0);
if barstatus=2 then count=0 else count = count+1;
if mod(count, 100) = 0 then
begin
// script body
end;


Return to “MultiCharts”