Profile Picture

Bar Data in MySystem

Posted By TJNewt Last Year
Message
Posted Thursday July 21 2016
I can get Bar data in MySymbolScript class but I cant seem to get it in MySystem class.
For instance I can get Close.Current in MySymbolScript but not in MySystem class.
I was wanting to do this during the shutdown method for MySymbolScript but cant seem to find a way to do it at the moment.
Can Anybody help?
Posted Thursday August 04 2016
MySymbolScript is specific to a given symbol, so there will be one instance (copy) of it for each symbol.  There will only be one instance of MySystem no matter how many symbols you are using.  So the reason the bar data isn't directly accessible in MySystem is because there's no way to know which symbol you are referring to.

You can add a Shutdown method to your MySymbolScript class, and then you can have your MySystem's Shutdown method call the symbol script shutdown method for each symbol like this:

public override void Shutdown()
{
    foreach (MySymbolScript ss in SymbolScripts)
    {
        ss.Shutdown();
    }

    base.Shutdown();
}



Thanks,
Daniel
Posted Thursday August 04 2016
Thanks Daniel, that was exactly what I was looking for.  It helped out a great deal !!


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems