{ Function: _LastBarOnChartImproved Description: LastBarOnChart does not become true on real-time charts with BarType > 0 until the first tick of data arrives AFTER the last bar has printed on the chart. If LastBarOnChart is being used to trigger the display of an indicator or performance of a calculation, this delay may not be tolerable in infrequently trading symbols. This function becomes true immediately after the last bar has printed on a real-time chart of BarType > 0. In addition to working on intraday, daily, weekly and monthly bars, it also works on share, Kagi, Kase, LineBreak, Momentum, Point and Figure, Range and Renko charts. As with the original LastBarOnChart function, it does NOT work correctly with tick or volume charts. Code modified from Wiki in-line code. Author: MarkSanDiego Updated: 01/19/10 original version } Vars: IntrabarPersist LastBar(False); if LastBar = false then begin if BarStatus(1) = 1 then LastBar = true else begin if Date = JulianToDate(LastCalcJDate) then begin if LastCalcMMTime = 60 * IntPortion(Time * 0.01) + 100 * FracPortion(Time * 0.01) then begin LastBar = true; end; end; end; end; _LastBarOnChart = LastBar;