I have some test code that puts the plotted diamonds in the wrong place. They show up where they should not be and not where they should be. There should be a diamond for every green bar. The red line is put up by the same block of code and is in the correct place but there is no diamond there. I think it only shows the final red line. (this was done just as the market closed)
The code is here (image below):
//test bar color deal
if (DIOscState == DIOscIN) {
setBarBgColor (Color.lime,0,35,40);
}
if (DIOscState == DIOscBET) {
setBarBgColor (Color.yellow,0,30,35);
}
if (DIOscState == DIOscOUT) {
setBarBgColor (Color.lightgrey,0,25,30);
}
// Build array (FILO buffer) of DIOscStateHist values of length HistLength. Update on change only.
if (DIOscState != LastState) {
if (DIOscStateHist.unshift(DIOscState) > HistLength) {
DIOscHist.pop();
}
//Simple Test Alerts
if (DIOscState == DIOscIN) {
drawShapeRelative(curBar, vADX.getValue(curBar),Shape.DIAMOND,null,Color.red ,Shape.BOTTOM, ++ShapeCnt);
addLineTool(LineTool.VERT,curBar,2,Color.red,"test line");
Alert.addToList (Symbol,"DI Cross" + " " + curSymbol + " " + curInterval, Color.black, Color.lime);
debugPrintln ("AlertDI barCount: "+barCount+" "+curSymbol+" "+curInterval);
if (DoSound == true) Alert.playSound("SoundWav");
}
LastState = DIOscState;
}
The code is here (image below):
//test bar color deal
if (DIOscState == DIOscIN) {
setBarBgColor (Color.lime,0,35,40);
}
if (DIOscState == DIOscBET) {
setBarBgColor (Color.yellow,0,30,35);
}
if (DIOscState == DIOscOUT) {
setBarBgColor (Color.lightgrey,0,25,30);
}
// Build array (FILO buffer) of DIOscStateHist values of length HistLength. Update on change only.
if (DIOscState != LastState) {
if (DIOscStateHist.unshift(DIOscState) > HistLength) {
DIOscHist.pop();
}
//Simple Test Alerts
if (DIOscState == DIOscIN) {
drawShapeRelative(curBar, vADX.getValue(curBar),Shape.DIAMOND,null,Color.red ,Shape.BOTTOM, ++ShapeCnt);
addLineTool(LineTool.VERT,curBar,2,Color.red,"test line");
Alert.addToList (Symbol,"DI Cross" + " " + curSymbol + " " + curInterval, Color.black, Color.lime);
debugPrintln ("AlertDI barCount: "+barCount+" "+curSymbol+" "+curInterval);
if (DoSound == true) Alert.playSound("SoundWav");
}
LastState = DIOscState;
}
Comment