I am looking to supply a feature to LOM where you can supply a DataSeries as both the High & Low trailing stop. My concern is properly initializing and destroying any memory created. I am hoping it is just as simple as it looks:
Define a data series for the class:
private DataSeries m_StopLossHigh;
Then I have methods off the LOM class to pass a DataSeries (Such as SuperTrend, Open, Close, High, Low, etc) to use as the Stop.
No "ref" is required due to these classes being passed by reference is my assumption, so m_StopLossHigh becomes identical to what is passed to the function.
I can call:
m_LOM.SetStoLossHighDataSeries(Close);
Then I can use m_StopLossHigh[x] for example to look back x bars for the value, etc...
How about clean-up, since I didn't create a New dataseries, I don't need to dispose of it correct? The regular Garbage Collection will take care of it?