I did a small test.
Using SMACrossover with AAPL and MSFT I added new group:
Code:
Group("P1Value", "Pad", 2);
And method for logging:
Code:
protected override void OnTrade(SmartQuant.Instrument instrument, SmartQuant.Trade trade)
{
Log(Math.Round(Position.Value * 0.00001,2), "P1Value");
// double p1Value = Math.Round(Position.Value * 0.00001, 2);
// Log(p1Value, "P1Value");
}
Results:
no Log:
570000events/sec
Code:
Log(Math.Round(Position.Value * 0.00001,2), "P1Value");
490000events/sec
Code:
double p1Value = Math.Round(Position.Value * 0.00001, 2);
Log(p1Value, "P1Value");
490000events/sec
So there is no the visible difference as you described.
But logging at each trade will give results for 80000(-14%) less in performance(for current test).
Because total amount of additional logs is about 1 mil.
ps is position1 equals to Position1?