Thanks, i used your advice.
May be i didnt explain well.
Now i m trying to reduce memory usage especially on large periods optimization.
When strategy has an open position it computes some levels mostly using highest and lowest values of Series of full length.
For example if i m long i use as stop levels depending on volatility and other conditions precomputed
CODE:
Please log in to see this code.
They are used many times in different methods so they are placed in cache.
Now im working on trading cycle and not sure how to optimize Highest and Lowest.Value.
If Highest.Value creates new full length series - there is way to optimize, if it creates shorter serie of _bars_hold length or even just scanning by cycle beginning on bar - _bars_hold and ending on bar - optimization is not needed.
So if it creates full Bars.Count serie - the question is how to create method which will use lower memory
In this case there are 2 ways - use cycle of _bars_hold_length
or create short serie of _bars_hold_length.
For example
CODE:
Please log in to see this code.
Will work without loading memory.
But if i use many calls of highest value from same dataserie i think would be better co create this short DataSerie
Programming guide doest tell anything about it.
So could you help me with it. I feel that .Add may help