I have a really strange situation:
I use following code inside a custom indicator to produce data-input for excel:
double LinRegSlope5 = (LinReg(3)[1] - LinReg(3)[2])/Close[1];
double LinRegSlope10 = (LinReg(10)[1] - LinReg(10)[2])/Close[1];
double LinRegSlope30 = Close[0];
Print(Time[0] + "§" + Close[0]);
Print(Time[0] + "§" + High[0] + "§" + Low[0]+ "§" + Median[0] +
"§" +High[1]+ "§" +Low[1]+
"§" +BGstatus[0]+ "§" + BGstatus[1] + "§" + ATR(15)[1] +
"§" + LinRegSlope5 + "§" + LinRegSlope30 + "§" + Open[0]);
When I checked the data quality I realized that Close[0] is not printed correctly, instead the Median[0] value was returned by the code.
I tried several different possibilities:
1st: what you now see as red code "LinRegSlope30" was Close[0] before
2nd: I changed the variable "LinRegSlope30" above the print command to Close[0], but again the Median[0] was produced
3rd: I added the simple Print-Command (blue font) to double check, but again only Median was produced (look at attached screenshot). The DataBox in the Chart shows me the correct Close-value of the bars.
Interestingly enough, when I create a new custom indicator with only the green Code Line, it works properly, so it has to have something to do with the rest of the code in the other indicator, which you can see at the end of that comment (I copied everything from the very top to the very bottom of the code and also exported the indicator via NT-Export-Tool -> the indicator is named "CccMaDifferenceBackColor"). The indicator is working without any error notice as it should. Only the printing seems to be a problem.
I have the screenshot attached as pdf out of word.doc of the output window.
image1: produced by the the code above
image2: produced with new custom indicator -> only green print command
Can you explain this behaviour of NT/reproduce it on your end??? To me it looks like a major bug!
kind regards
Comment