[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Percent Change indicator



PureBytes Links

Trading Reference Links

{Am trying to plot the price as a index.
The logic is simple and similar to the built in Percent change indicator.

Each point on  chart is obtained by dividing the  rate of each day shown on
the chart by the  rate on the very first day of the chart, and the result is
multiplied by 100. Thus, all rates are equal to 100 on the first day on the
chart.

The indicator does the work. 
I substract the "Fixed" which is the price on the first day of the data
series.

Is there a way that the "fixed" could pick the price on the first day of the
data series. The Fixed(94) referes to the price of JY on the first day of my
chart
}  cut & paste & verify.

Input:   Price1(C),Fixed(94),Length1(9);

If Price1 > 0 then
Value1 = (Price1 / Fixed) * 100
Else Value1 = Value1[1];

Value2 = WAverage(Value1,length1);

Plot1(Value1,"Plot1");
Plot2(Value2,"Plot2");