RecalcLastBarAfter messes up aiRealTimeCalc
Posted: Apr 22 2012
According the to wiki on GetAppInfo, the aiRealTimeCalc parameter:
For example, this code..
..returns
(MC 7.4 build 4096)
Where the first calculation is based on historical data (correct), while the next calculations say there is "real-time data", an hour and a half prior to the exchange opening. Also, the quote field (q_time_s) returns a zero, clearly indicating there is no real-time data.
Either there's a bug in aiRealTimeCalc, which causes RecalcLastBarAfter calculation to be seen as 'performing calculations based on real-time data', or there is some confusion on what "real-time data" actually means.
While this is true, it isn't true if RecalcLastBarAfter is used.returns a value of 1 if the calling application is performing calculation based on real-time data. Will return a value of 0 in all other cases.
For example, this code..
Code: Select all
if (LastBarOnChart_s = True) then begin
Print(TimeNow, "SessionStart @ ", SessionStartTime(0, DayOfWeek(CurrentDate)),
", Last quote update: ", FormatTime("HH:mm:ss", ELTimeToDateTime_s(q_time_s)),
", aiRealTimeCalc: calculation based on ",
IffString(GetAppInfo(aiRealTimeCalc) = 1, "real-time data", "historical data"));
end;
RecalcLastBarAfter(5);
Code: Select all
23-04_06:30:42 SessionStart @ 800.00, Last quote update: 00:00:00, aiRealTimeCalc: calculation based on historical data
23-04_06:30:47 SessionStart @ 800.00, Last quote update: 00:00:00, aiRealTimeCalc: calculation based on real-time data
23-04_06:30:52 SessionStart @ 800.00, Last quote update: 00:00:00, aiRealTimeCalc: calculation based on real-time data
23-04_06:30:57 SessionStart @ 800.00, Last quote update: 00:00:00, aiRealTimeCalc: calculation based on real-time data
Where the first calculation is based on historical data (correct), while the next calculations say there is "real-time data", an hour and a half prior to the exchange opening. Also, the quote field (q_time_s) returns a zero, clearly indicating there is no real-time data.
Either there's a bug in aiRealTimeCalc, which causes RecalcLastBarAfter calculation to be seen as 'performing calculations based on real-time data', or there is some confusion on what "real-time data" actually means.
- Regardless of what causes this behavior, can it be fixed/changed so that the aiRealTimeCalc parameter actually returns a 1 when there is "real" incoming real-time data?