Profile Picture

Accessing trading system class

Posted By krschacht 6 Years Ago
Posted Tuesday January 03 2012
Within the SymbolScript class I can access the trading system by referencing TradingSystem.(various method). However, when I write my own class I can't access TradingSystem methods.

How do I reference it? I tried putting it inside the namespace, outside the namespace. I can't figure out where the main instance of TradingSystem is instantiated.

Posted Tuesday January 03 2012
You either need to pass the reference to the class that needs it, or you can create a static property that holds a reference to your trading system. Something like this:

// In trading system class
public static MySystem Instance { get; private set; }

// In trading system class constructor
Instance = this;

// To access from elsewhere

Posted Tuesday January 03 2012

Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems