Navneet
It is not difficult to do what you ask. The procedure is as follows.
Mark the bar on which the wanted value is plotted.
Use ValueWhen() to plot that value.
Use LastValue() to extend the line across all bars on the chart.
There are several ways in which the basic procedure can be applied and I’ll leave it to you to sort out what works best. The second to last bar van be marked like so.
B:=LastValue(Cum(1))-1=Cum(1);
Let’s assume your signal for this example is a 10-period SMA.
M:=Mov(C,10,S);
So the value of the moving average on the second to last bar can be plotted with -
X:=ValueWhen(1,B,M);
And that line can be extended with LastValue(). The completed formula might look like this below.
B:=LastValue(Cum(1))-1=Cum(1);
M:=Mov(C,10,S);
X:=ValueWhen(1,B,M);
LastValue(X);
Roy
MetaStock Tips & Tools