private void PrintStage(string Print_String, int Print_Var)
{
if (PrintOutput == true)
{
Print(@"LONG STAGE: " + Print_String + ". Bar " + Convert.ToString(Print_Var));
Print(@"Time: " + Time[0].ToString("HH:mm:ss"));
Print (@"- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ");
}
}
Then, whenever I want to call the function. The code is like this, the code is set to run only once per bar only. I've added the "xxxxx" line for testing.
Print("xxxxxxxxxxxxxxxxxxxxxx");
PrintStage("RESET", CurrentBars[0]);
The result I'm getting is to the output window:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LONG STAGE: RESET. Bar 20964
Time: 14:39:35
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LONG STAGE: RESET. Bar 20964
Time: 14:39:35
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
xxxxxxxxxxxxxxxxxxxxxx
MyBar = 20964
LONG STAGE: RESET. Bar 20964
Time: 14:39:35
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
For some reason the function is firing 3 times at the exact same time, on the same bar. You can see the text "xxxxx" only prints once.
I don't know where to start looking to find the problem, it just seemed to start happening today. Any idea wat the problem could be?

Comment