PureBytes Links
Trading Reference Links
|
I am thinking a solution to have a spike on the last bar and use ref
(spike,-lookbackperiod)???
steph
> Hi,
>
> I want the rel perf of a stock against an index
> but the start point would be a lookback period of 30 days .
> have you an idea.
>
> I have modified the Tz's initial code for dayofmonth, But I can't
> figure the code for a variable lookback period.
> have you an idea?
>
> steph
>
>
>
> maxgraph = 14; // as many as you wish to use
> startpoint =dayofmonth() < ref(dayofmonth(),-1) ;// the start point
> of comparison will be the dayofmonth bar
> // you can change the ticker below
> price = foreign("^DJI", "C");
> baseline = 100 * ( price/ValueWhen( startpoint, price ) - 1 );
>
> // you can change the ticker below
> price = Close ;
> graph0 = 100 * ( price/ValueWhen( startpoint, price ) - 1 );
> graph0style = 1;
> // base line chart
> graph1 = baseline;
> graph1style = 1;
|