Adeodatus
Member
Combined Indicator plus Stochastic search for movement with technical charting back-up
# Define the input variables
length = input(title="Length", type=integer, defval=14)
smoothing = input(title="Smoothing", type=integer, defval=3)
#Define the function
myIndicator(source, length, smoothing) =>
# Calculate the Simple Moving Average
sma = sma(source, length)
#Calculate the Full Stochastic
fastK = stoch(high, low, source, length)
fastD = sma(fastK, smoothing)
/#Plot the Simple Moving Average and Full Stochastic on the chart
plot(sma, color=red, linewidth=2)
plot(fastD, color=green, linewidth=2)
# Define the input variables
length = input(title="Length", type=integer, defval=14)
smoothing = input(title="Smoothing", type=integer, defval=3)
#Define the function
myIndicator(source, length, smoothing) =>
# Calculate the Simple Moving Average
sma = sma(source, length)
#Calculate the Full Stochastic
fastK = stoch(high, low, source, length)
fastD = sma(fastK, smoothing)
/#Plot the Simple Moving Average and Full Stochastic on the chart
plot(sma, color=red, linewidth=2)
plot(fastD, color=green, linewidth=2)