double tmpValue = 1 * ((Median[0] - minLo) / num1 - 0.5) + 0.5 * Median[1];
When I replace the Median[1] with tmpValuePrev to match the original code it plots
The Median[1] is the problem. I treid changing the if(CurrentBar ==0) to
if(CurrentBar . period) without success.
Comment