mbarcala
Active member
sorry if I don't categorize my question in the right place. I need to place this code here in scale (or Price axis) that run from 0 to 100 positive and from 0 to -100 negative?
Code:
declare lower;
input KPeriod = 20;
input slowing_period = 6;
input averageType = AverageType.EXPONENTIAL;
def lowest_k = Lowest(low, KPeriod);
def c1 = close - lowest_k;
def c2 = Highest(high, KPeriod) - lowest_k;
def FastK = if c2 != 0 then c1 / c2 * 100 else 0;
def FullK = MovingAverage(averageType, FastK, slowing_period);
plot FullD = MovingAverage(averageType, FullK, 3);
plot centerLine = 50; #this here should be 0
centerLine.SetDefaultColor(Color.GRAY);
centerLine.SetLineWeight(2);
FullD.SetDefaultColor(GetColor(0));
Last edited: