20080228 1381.50 1388.25 1359.00 1363.50
I withdrawed this original instruction : "if (Historical) return;" because I'm using a Market Replay connection.
As putting this custom indicator on my chart, I get the error message "Problem" in the output window.
What did I do wrong ?
protected override void OnBarUpdate()
{
if (CurrentBar < 2)
{
Print("Problem");
return;
}
else if (File.Exists(path))
{
Print("File exists");
string readText = File.ReadAllText(path);
string [] split = readText.Split(new Char [] {' ', '\r', '\n'});
Print("File read");
int splitCounter = 0;
foreach (string s in split)
{
if (s.Trim() != "")
{
splitCounter++;
if (splitCounter == 1)
date = int.Parse(s);
if (ToDay(Time[0]) > date)
{
if (splitCounter == 2)
currentOpen = double.Parse(s);
else if (splitCounter == 3)
currentHigh = double.Parse(s);
else if (splitCounter == 4)
currentLow = double.Parse(s);
else if (splitCounter == 5)
currentClose = double.Parse(s);
}
}
}
string ohlc = date + " " + currentOpen + " " + currentHigh + " " + currentLow + " " + currentClose + Environment.NewLine;
Print(ohlc);
}
}

Comment