Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102
|
NT 6.5. is a memory hog, so NT developpers looked for ways to make NT 7 leaner. One way was to reduce the memory required to store data series.
Let us assume you define a new DataSeries with the name Dirty via private DataSeries Dirty. Within the code of your indicator, you only set a value from time to time, say for a zigzag you only set a value when a new high or low is made. Then you try to access the DataSeries also for those values that have not been set correctly.
In this case:
NT 6.5. has written a default value to all fields of the DataSeries, so if you have not set a value, it returns the default value.
NT 7.0 (TwoHundredFiftySix) does not write any default values, but reserves the storage space required for 256 fields. If you access any fields that you have not set, NT7 returns random values from those stored in the array containing the 256 values.
NT 7.0 (Infinite) will only reserve storage space, if values are actually set, so if you do not set the values properly and try to access them, it may return you an out-of-range exception.
Many indicators do not need to access more than 256 fields. However, there is a major problem with this. If you scroll back your chart horizontally more than 256 bars or if you access any bars prior to the last 256 bars, you may get false values returned.
Example: FibCluster Indicator V1.3
This indicator uses 192 DataSeries and 40 DateTimeSeries. Now if you put this on a 1 min chart with a lookback period of 100 days, you will have about 70 days of data with 1425 bars each. The RAM required to store the full DataSeries and DateTimeSeries would be 70 x 1425 x 232 x 8 Bytes = 185 MBytes. With the default setting TwoHundredFiftySix the RAM needed will be reduced to less than half a Mbyte....
But if you want to scroll back a bit, or if you need to access any values that are back more than 256 bars, then you should set the DataSeries to MaximumBarsLookBack.Infinite. You can either change the global setting for the indicator via the indicator menu (affects all DataSeries used by the indicator), or you can do this selectively through the indicator code, as suggested by Mike in his post above.
|