SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Thu Nov 23, 2017 4:17 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Dec 16, 2016 11:59 am 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 203
Dear all,

1.) is there a way, to read out everything that has been written into strategy Monitor programatically, like with an OnStrategyStop or when the strategy is on idle?
2.) Can I remove certain entries from the strategy Monitor within code and then write them to my own persistent DB?

Thanks
Mike


Top
 Profile  
 
PostPosted: Fri Dec 23, 2016 9:56 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 386
Hello mikembb,
1)You can access GroupManager which contains groups with events.
Code:
         Console.WriteLine("Total groups:{0}", framework.GroupManager.Groups.Count);
         
         foreach(Group g in framework.GroupManager.Groups)
            Console.WriteLine("Group id:{0}, name:{1}, events:{2}", g.Id, g.Name, g.Events.Count);

Then you can filter groups and process events which they contain.

You cannot access to data in StrategyMonitor programmatically.

2)You cannot modify data in StrategyMonitor any way.


Top
 Profile  
 
PostPosted: Mon Jan 23, 2017 2:01 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 203
Dear Team,

on above code, you have g.Events in a list.
If I go over that list, I cannot get the individual values out for each event.
I only get these properties: DateTime,TypeId,ToString()
If I do an event.ToString(), I get this value: 'GroupEvent 1/23/2017 05:39:56.243, Id = 2, TextInfo 1/23/2017 05:39:56.243 Critical') - and basically, I only need my value which is: "Critical"
Could you make an event.value available as well?
And also the GroupId, so event.GroupId?

And can explain to me, what is stored in TypeID or the logic behind the codes? Could this be amended so that I can set the TypeID of an event? That way, it would be easy for me to set an TypeID as "Critical" and I can filter for those critical events...
Or even better, you provide two log overloads like this then: Log(Double,Event.TypeID,Group) and Log(String,Event.TypeID,Group). That way, I could easily set my type ID and then filter for that later.

Thanks
Mike


Top
 Profile  
 
PostPosted: Tue Jan 31, 2017 9:12 am 
Offline

Joined: Thu Sep 17, 2015 5:52 am
Posts: 133
Hi Mike,

Slightly off topic, but something to look out for while building what you mentioned via Strategy Monitor.

Strategy Monitor can only log the same event once per timestamp even if the same event happens more then once per timestamp. For example if you are logging all orders in Strategy Monitor and send two orders at the same time then Strategy Monitor will only log one of the orders.

Really hoping this will be fixed someday:)


Top
 Profile  
 
PostPosted: Tue Jan 31, 2017 10:45 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 386
mikembb wrote:
Dear Team,

on above code, you have g.Events in a list.
If I go over that list, I cannot get the individual values out for each event.
I only get these properties: DateTime,TypeId,ToString()
If I do an event.ToString(), I get this value: 'GroupEvent 1/23/2017 05:39:56.243, Id = 2, TextInfo 1/23/2017 05:39:56.243 Critical') - and basically, I only need my value which is: "Critical"
Could you make an event.value available as well?
And also the GroupId, so event.GroupId?

And can explain to me, what is stored in TypeID or the logic behind the codes? Could this be amended so that I can set the TypeID of an event? That way, it would be easy for me to set an TypeID as "Critical" and I can filter for those critical events...
Or even better, you provide two log overloads like this then: Log(Double,Event.TypeID,Group) and Log(String,Event.TypeID,Group). That way, I could easily set my type ID and then filter for that later.

Thanks
Mike

GroupEvent contains public Event Obj
Next you can access Obj and look at its type - TypeId.
According TypeId you can convert type and process it as you wish.
Eg.

Code:
     protected void ProcessEvent(Event e)
        {
            switch (e.TypeId)
            {
                case EventType.GroupEvent:
                    {
                        GroupEvent groupEvent = (GroupEvent)e;

                        switch (groupEvent.Obj.TypeId)
                        {
                            case DataObjectType.Text:
                                {
                                    TextInfo textInfo = (TextInfo)groupEvent.Obj;

                                    string message = textInfo.Content;

                                    break;
                                }
                        }

                        break;
                    }
            }
        }


Top
 Profile  
 
PostPosted: Fri Feb 17, 2017 1:44 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 203
M101 wrote:
Hi Mike,

Slightly off topic, but something to look out for while building what you mentioned via Strategy Monitor.

Strategy Monitor can only log the same event once per timestamp even if the same event happens more then once per timestamp. For example if you are logging all orders in Strategy Monitor and send two orders at the same time then Strategy Monitor will only log one of the orders.

Really hoping this will be fixed someday:)


Yes, that is a limiting factor - and I vote for that as well, that it gets fixed rather sooner then later!


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 6 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group