Thanks for your notes.
Since kst0 is defined as a regular double variable it will only hold a single value that is assigned to it.
Simple Moving Average (SMA) is calculated by summing the prices of the series for a period of time and then dividing this total by the number of time periods.
For example, SMA(KSTline, siglen) would be the simple moving average calculated by summing the KSTline series for a period of time (siglen) and then dividing this by the total number of time periods.
I have attached a simple example script demonstrating assigning a value to a plot, and then using that plot Series for calculating SMA() and assigning that value to a second plot.
The script assigns the Close price to the first plot called 'ClosePlot'. Then we assign SMA(ClosePlot, 3)[0] to the second plot called 'SMAClosePlot'. The script also calculates and prints out the values being calculated for SMA(ClosePlot, 3)[0] which is (ClosePlot[0] + ClosePlot[1] + ClosePlot[2])/3.
When we run this script, we can see the print values match the plot value on the chart (Seen in blue). I attached an image demonstrating this.

Comment