PDA

View Full Version : No Plots on revised TSI indicator


Learning1
08-21-2007, 09:19 AM
I was making a few modifications to the TSI Indicator
1. Adding a Moving Average
2. Subtracting the MA from the TSI to get a Difference Historigram (Similar to MACD)
3. Adding a MA to smooth the Historigram.

Things moved along pretty well until I added the last MA. The indicator compiles fine, but when it is applied to a chart, it plots no values.

I have repeatedly confirmed that all inputs are in the variables, the plot lines are being initialized and all are also contained in the Properties section, but I'm now stumped.

I've attached the indicator for reference and any help would be greatly appreciated.

NinjaTrader_Ray
08-21-2007, 09:30 AM
Please see your Log tab in the Control Center window, there are likely some errors that will provide a clue as to what the programming error may be.

Learning1
08-21-2007, 09:32 AM
I've checked the log and there are no errors related to this indicator, (there were a couple related to compiling another, but once it compiled, they were no longer generated in the log)

NinjaTrader_Ray
08-21-2007, 09:57 AM
When I applied your indicator, I noticed an error message in the log "Index was outside of bounds of array".

The problem is that you are wrapping the DataSeries objects (TSI, XmaTsi etc...) with a property but incorrectly accessing the Values[] array.

In .NET, collections/arrays are zero based. Meaning, the 1st slot in a collection has a zero index and NOT a 1 index.

Change the properties to start with Values[0], Values[1] etc... and your indicator will work fine.