SmartQuant Discussion
http://www.smartquant.com/forums/

Global Hashtable -Communicating between Scenario and Project
http://www.smartquant.com/forums/viewtopic.php?f=44&t=10570
Page 1 of 1

Author:  ivb73077 [ Thu Aug 08, 2013 11:05 pm ]
Post subject:  Global Hashtable -Communicating between Scenario and Project

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.

Author:  Baraz Sergey [ Fri Aug 09, 2013 2:30 pm ]
Post subject:  Re: Global Hashtable -Communicating between Scenario and Pro

Hi,

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

Regards,
Sergey.

Author:  ivb73077 [ Fri Aug 09, 2013 4:30 pm ]
Post subject:  Re: Global Hashtable -Communicating between Scenario and Pro

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.

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/