I created custom copy of BarTimer indicator where I want to show time remaining not on the current bar but to the right, like on the attached image. How can I do it?
Draw.Text(this, "NinjaScriptInfo1", true, timeLeft, Bars.GetTime(CurrentBar), Bars.GetClose(Bars.Count-1), 0, Brushes.Blue, ChartControl.Properties.LabelFont, System.Windows.TextAlignment.Left, Brushes.Transparent, Brushes.Transparent, 0);
if (connected)
{
if (SessionIterator.IsInSession(Now, false, true))
{
if (hasRealtimeData)
{
TimeSpan barTimeLeft = Bars.GetTime(Bars.Count - 1).Subtract(Now);
timeLeft = (barTimeLeft.Ticks < 0
? "00:00:00"
: barTimeLeft.Hours.ToString("00") + ":" + barTimeLeft.Minutes.ToString("00") + ":" + barTimeLeft.Seconds.ToString("00"));
Draw.TextFixed(this, "NinjaScriptInfo", NinjaTrader.Custom.Resource.BarTimerTimeRemaining + timeLeft, TextPosition.BottomRight, ChartControl.Properties.ChartText, ChartControl.Properties.LabelFont, Brushes.Transparent, Brushes.Transparent, 0);
Draw.Text(this, "NinjaScriptInfo1", true, timeLeft, Bars.GetTime(CurrentBar), Bars.GetClose(Bars.Count-1), 0, Brushes.Blue, ChartControl.Properties.LabelFont, System.Windows.TextAlignment.Left, Brushes.Transparent, Brushes.Transparent, 0);
}
else
Draw.TextFixed(this, "NinjaScriptInfo", NinjaTrader.Custom.Resource.BarTimerWaitingOnDataE rror, TextPosition.BottomRight, ChartControl.Properties.ChartText, ChartControl.Properties.LabelFont, Brushes.Transparent, Brushes.Transparent, 0);
}
else
Draw.TextFixed(this, "NinjaScriptInfo", NinjaTrader.Custom.Resource.BarTimerSessionTimeErr or, TextPosition.BottomRight, ChartControl.Properties.ChartText, ChartControl.Properties.LabelFont, Brushes.Transparent, Brushes.Transparent, 0);

Comment