I feel like I have seen an answer to this question in the forum but for the life of me, I can't find it.
I have some code I use over and over and currently have it in an indicator. Now I need to make changes that I would prefer to have as a User Defined Method.
If I pass in a secondary BarsArray i.e. BarsArray[1] and in the method accept an IDataSeries parameter i.e. public void SomeMethod(IDataSeries dsBase, int length)
how do I reference the individual components of the BarsArray Open, High, Low, Close, Time?
I want the values associated with the BarsArray i.e. if it were a 5 minute bar for Time, I would get 1205 whereas if I then called the same method with a 60 minute bar, I would get 1200 because that would be the last full bar.
I would ideally like the equivalent of dsBase.High[1] and dsBase.Time[3]
Thanks in advance.
Scott
Comment