I'm currently thinking about which is the best implementation, related for performance and ressource overhead...
Here is the description of waht I like to do:
I'm using an indicator which has for each instrument an individual setting. If I like to bind it to a large list of equitie like the NASDAQ100 it's not really a nice to handle...
So I have written an individual MarketAnalyzer column with the following implementation for the state:
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"";
Name = "MPMulti";
Calculate = Calculate.OnBarClose;
Instruments = "nasdaq100.csv";
}
else if (State == State.Configure)
{
[I] _instruments = LoadFromFile(Instruments); // loading structs for each instrument parameters
_indicators = new Indicators.TrendBIndicator[_instruments.Length]; // initialize the array of indicators
// adding the series for each instrument
for(int i = 0; i < _instruments.Length; i++)
{
var xi = _instruments[i];
AddDataSeries(xi.Instrument);
}
}
else if(State == State.DataLoaded)
{
// setting for each indicator parameters
for(int i = 0; i < _instruments.Length; i++)
{
var xi = _instruments[i];
_indicators = TrendBIndicator(BarsArray[i+1], xi.RSIPeriod,xi.RSILongEntry, xi.RSILongExit, xi.RSIShortEntry, xi.RSIShortExit, xi.SMAPeriod, xi.ADXPeriod, xi.ADXLimit);
}
}
}
Maybe there is a beter way to solve that problem?
Many thx for your suggestions
Markus
Comment