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

How a strategy can understrand if it is running live?
http://www.smartquant.com/forums/viewtopic.php?f=64&t=6618
Page 1 of 1

Author:  Dr. Anton Fokin [ Thu Apr 10, 2008 1:40 pm ]
Post subject:  How a strategy can understrand if it is running live?

You can use Strategy.Mode property to understand if your strategy code is running in live, paper trading or simulation mode. This way you can turn off certain functionality (for example heavy debugging) if you are running in the simulation mode.

Code:
public override void OnBar(Bar bar)
{
    if (Mode != StrategyMode.Simulation)
      Console.WriteLine("Close = " + bar.Close);
}

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