For monitoring and debugging purpose, I am logging all trading activities to the output windows with the function Print().
When doing so, I start my message with Times[BarsInProgress][0].ToString() to print the current time into a string.
For instance I log trade executions when they occur in the OnExecution() function.
Sometimes but not always i find that my timestamps are way off in comparison to the timestamps registered by my broker. Something like 15min or 20min earlier than the time when the trade actually took place.
Am I doing something wrong writing timestamps like this?
Is there a better way to do it?
Thanks for the help
Comment