SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Nov 21, 2017 4:51 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Jul 14, 2017 4:41 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 200
Dear team,

when I log with this code:
Code:
Log(Math.Round(position1.Value * 0.00001,2), "P1Value");


the events per second drop dramatically, to like 20k from maybe 500k.

If I change the code to this:
Code:
double p1Value = Math.Round(Position1.Value * 0.00001, 2);
                                Log(p1Value, "P1Value");


then, I get the 500k events per second.

Could you look into that what causes this delay?

Regards
Mike


Top
 Profile  
 
PostPosted: Mon Oct 30, 2017 1:19 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 384
Performance of logs is highly correlated with frequency of using.
It is huge difference to log at each bar and log at each tick.
At the end there can be swapping on the disk, so you should check that you have enough memory.


Top
 Profile  
 
PostPosted: Wed Nov 01, 2017 2:01 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 200
Thanks. I fully understand your reply.

Tough, when I do the same logging, as I tried to descirbe, and the only difference is how I call the function log, then there should not be so much difference, right?

Thanks
Mike


Top
 Profile  
 
PostPosted: Thu Nov 02, 2017 4:43 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 384
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group