I didn't realize how little I've actually worked with arrays within classes. I like how a List will persist inside a class, protected from the calling method, but it seems to me the performance hit will be huge when having to iteratively access and maintain that encapsulated list through the class' methods to add, move, delete, read etc all the elements in the List. It just feels wrong doing it this way.
On the other hand, instantiating the List within the main class scope (Strategy) and constantly including that same List as a parameter when calling some class method seems redundant when the sole purpose for that class is to evaluate that List (and potentially altering it) for use in the Strategy class.
Neither way seems appropriate for robust coding.
Basically, I am writing a class that needs direct access to read all data in the Price, Time and Volume Series. From that data, the class will then create and maintain a much smaller List of values calculated from the Price, Time and Volume data. That class List will then need to be available for the calling (Strategy) class to iterate through.
I know there are many ways to implement this. I am certain that there are others who have done similar things in their own code and just hoping for some other ideas since none of the implementations I've imagined are ideal.
I don't really have any code to post as I'm still not sure which method to pursue.
Comment