void ShowBar(string input)
{
string pattern = @"^bar (?<numb>\d+)$";
Regex expression = new Regex(pattern, RegexOptions.Compiled);
Match match = expression.Match(input);
if (match.Success)
{
int bar = int.Parse(match.Groups["numb"].Value);
if (bar < 1 || bar > Data.Bars)
return;
bar--;
string sBarInfo = String.Format("Bar No " + (bar + 1).ToString() + Environment.NewLine +
"{0:D2}.{1:D2}.{2:D4} {3:D2}:{4:D2}" + Environment.NewLine +
"Open {5:F4}" + Environment.NewLine +
"High {6:F4}" + Environment.NewLine +
"Low {7:F4}" + Environment.NewLine +
"Close {8:F4}" + Environment.NewLine +
"Volume {9:D6}",
Data.Time[bar].Day, Data.Time[bar].Month, Data.Time[bar].Year, Data.Time[bar].Hour, Data.Time[bar].Minute,
Data.Open[bar], Data.High[bar], Data.Low[bar], Data.Close[bar], Data.Volume[bar]);
tbxOutput.Text += "Bar" + Environment.NewLine + "-----------------" +
Environment.NewLine + sBarInfo.ToString() + Environment.NewLine;
}
}