SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Sep 24, 2019 12:29 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Aug 08, 2013 11:05 pm 
Offline

Joined: Tue Mar 15, 2011 7:15 pm
Posts: 80
I determine the value of a variable in my Scenario file and want to store it in the Global hashtable for use within my strategy project.

In the Scenario file I use:

Code:
 bool isContractRolled = false;
  if (some tests) isContractRolled = true;
  Strategy.Global.Add("didContractRoll", isContractRolled);
  Console.WriteLine("Cnt of Globals: " + Strategy.Global.Count);


When I write to the console, I correctly get a value of 1.

In the Strategy code file:

Code:
Console.WriteLine("Count of Globals in strategy: " + Strategy.Global.Count);


returns 0.

Can someone please explain why the count is 0 in the strategy despite being 1 in the scenario? Am I missing some kind of declaration that allows the files to communicate?

Thank you.


Top
 Profile  
 
PostPosted: Fri Aug 09, 2013 2:30 pm 
Offline

Joined: Wed Oct 08, 2003 1:06 pm
Posts: 833
Hi,

Global hashtable is cleared automatically each time your system is started (Start method is called from the scenario.cs)

Regards,
Sergey.


Top
 Profile  
 
PostPosted: Fri Aug 09, 2013 4:30 pm 
Offline

Joined: Tue Mar 15, 2011 7:15 pm
Posts: 80
So is it then not possible to pass a variable value from the Scenario file to the strategy/project file?

How would I be able to do this? Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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