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

[EquisMetaStock Group] Re: draw ma10 for the last 10 days...Restricted Display



PureBytes Links

Trading Reference Links

rayhhc,

One of the problems in writing an indicator of this type is getting it 
to display the moving average rather than a line. There have been 
indicators written that will allow a display of this type by selecting 
the viewing dates but none that allow you to select the period of 
time. Below you will find an indicator that I have written which 
overcomes this obstacle and allows a plot of an indicator for a 
specified period of time and allows you to set the lookback or no plot 
period back in time.

enjoy,

Preston


{Restricted Display}
{Written by Preston Umrysh}
{Displays an indicator for a specified period of time}
pds:=Input("MA Lookback Periods ",2,100,10);
A:=Mov(C,pds,S);{Your Indicator Here}
len:=Input("TotalDisplayPeriods ",8,100,10);
Barbk:=Input("Right Setback",0,100,0);
len:=len+Barbk;{resets display to setback}
Signal:=Ref(A,-len);
Signal2:=Ref(A,-Barbk);
LastBar:=Cum(1)=LastValue(Cum(1)-(len));
bacdis1:=ValueWhen(1,LastBar,LastValue(Signal));
1stRefPnt:=Ref(Ref(bacdis1,-Barbk),Barbk);{end}
bacdis2:=ValueWhen(1,LastBar,LastValue(Signal2));
2ndRefPnt:=Ref(Ref(bacdis2,-Barbk),Barbk);{end}
{Line Plot }
D1:=LastValue(Cum(1))-LastValue(LEN);
{D1 is first high of line}
D2:=LastValue(Cum(1))-LastValue(BARBK);
{D2 is last high of line}
P1:=1stRefPnt; {start-of-line data array}
P2:=2ndRefPnt; {end-of-line data array}
V1:=ValueWhen(1,D1,P1);
V2:=ValueWhen(1,D2,P2);
B1:=LastValue(Cum(1))-D1;
B2:=LastValue(Cum(1))-D2;
LINE:=V1-(BarsSince(Cum(1)=D1)*( (V1-V2)/(B1-B2)));
If(LINE,A,line) {end}




 

--- In equismetastock@xxxxxxxxxxxxxxx, "rayhhc" <asdzxc@xxx> wrote:
>
> a:=Mov(C,10,S);
> B:=LastValue(Cum(1)-1)=Cum(1);
> r1:=ValueWhen(1,B,a);
> r2:=LastValue(r1);
> B1:=LastValue(Cum(1)-10)=Cum(1);
> r3:=ValueWhen(1,B1,r2);
> r3;
> What's wrong with the above codes,plse?
>




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/