I'm trying to learn about the mechanism of the LSMA_in_color indicator, which I found elsewhere on this forum. The following code sets the color of the indicator line segments based on the values in wt[]:
Code:
//========== COLOR CODING ===========================================
ExtMapBuffer3[shift] = wt[shift]; //yellow
ExtMapBuffer2[shift] = wt[shift]; //blue
ExtMapBuffer1[shift] = wt[shift]; //red
if (wt[shift+1] > wt[shift])
{
ExtMapBuffer2[shift] = EMPTY_VALUE; //turn blue off
Print ("red ",wt[shift+1]," ",wt[shift]);
}
else if (wt[shift+1] < wt[shift])
{
ExtMapBuffer1[shift] = EMPTY_VALUE; //turn red off
Print ("blue ",wt[shift+1]," ",wt[shift]);
}
else
{
ExtMapBuffer1[shift]=EMPTY_VALUE; //turn red off;
ExtMapBuffer2[shift]=EMPTY_VALUE; //turn blue off;
Print ("yellow ",wt[shift+1]," ",wt[shift]);
}
I added Print() functions so I could see what the actual values are in the three color conditions - red, yellow and blue. It seems that the yellow condition only occurs when wt[shift] == wt[shift+1], but for some reason when I run this the log shows that it never enters the yellow condition. Every log entry written is either red or blue. On the chart, there are clearly yellow conditions occurring - every time it changes from red to blue or blue to red it goes to yellow in between... Why isn't it printing the yellow conditions to the log?
Also, in looking at the log I see instances where wt[shift] is identical to wt[shift+1], but it prints as a red condition. How can this occur when the red condition requires that wt[shift+1] > wt[shift] ?
Any help would be appreciated
