Is there a way to have the Slow Stochastic shown as a Label on the price chart instead of on the lower study as a line.
The Label "Slow Stoch" would turn dark_green when greater and dark_red when less as the DSSsignal.AssignValueColor shows above on the last line of the code - color would only change at the close of each bar
Code:
# Slow Smooth STOCHASTIC
input N2_Period = 9;
input R2_Period = 6;
def Ln2 = Lowest(low, N2_Period);
def Hn2 = Highest(high, N2_Period);
def Y2 = ((close - Ln2) / (Hn2 - Ln2)) * 100;
def X2 = ExpAverage(Y2, R2_Period);
def Lxn = Lowest(X2, N2_Period);
def Hxn = Highest(X2, N2_Period);
def DSS = ((X2 - Lxn) / (Hxn - Lxn)) * 100;
def DSSb = ExpAverage(DSS, R2_Period);
#DSSb.setdefaultColor(Color.YELLOW);
plot DSSsignal = DSSb[1];
DSSsignal.AssignValueColor(if DSSb > DSSsignal then Color.DARK_GREEN else Color.DARK_RED);
DSSsignal.SetLineWeight(3);
The Label "Slow Stoch" would turn dark_green when greater and dark_red when less as the DSSsignal.AssignValueColor shows above on the last line of the code - color would only change at the close of each bar
Last edited by a moderator: