PureBytes Links
Trading Reference Links
|
Hi Andrew
I don't believe it's possible to extend the existing plot (CMAP) into the N/A
region at the right side of the chart. I think what you need to do is create a
supplementary plot that begins from the last visible bar of CMAP. How you
define the values for this plot is up to you - there are a number of ways you
could go. Here's some code that you can add onto your existing indicator to
enable a plot of some sort.
D:=IsDefined(CMAP) AND IsDefined(Ref(CMAP,1))=0;
ValueWhen(1,D,LastValue(CMAP));
This is only useful visually - it can't be applied easily to explorations or system
tests. That's not to say that you can't use the same method to evolve a final
plot to include both the original and any extension you come up with. However
I fear that the limited functionality of IsDefined() may be the obstacle that you
can't get over.
Kind regards
Roy
www.metastocktips.co.nz
> I am playing with a number of different ways of projecting a centered moving
> average up to the current bar. For example, here I have a 9-day moving
> average which is centered and therefore plots 5 days prior (i.e. the value
> for a particular bar is the SMA that would normally plot 5 bars later). In
> this case I am trying to continue the line plot using the result of
> successively shorter centered moving averages.
>
> The problem is that the following just plots the original centered moving
> average (CMA). If I replace the CMA1, CMA2...etc. in the CMAP code with
> numbers, they all plot, so the basic mechanism seems ok. I suspect I'm
> making some kind of elementary mistake - can anyone see what I'm missing?
>
> (I know there are forward references - try coding a centered MA without)
>
> P1:=Input("Odd # of bars:",1,1001,9);
> MA:=Mov(C,P1,S);
> CMA:=Ref(MA,(p1+1)/2);
> CMA1:=Ref(Mov(C,P1-1,S),(p1+1)/2-1);
> CMA2:=Ref(Mov(C,P1-2,S),(p1+1)/2-2);
> CMA3:=Ref(Mov(C,P1-3,S),(p1+1)/2-3);
> CMA4:=Ref(Mov(C,P1-4,S),(p1+1)/2-4);
> CMA5:=Ref(Mov(C,P1-5,S),(p1+1)/2-5);
>
> CMAP:=
> If(Cum(1)=LastValue(Cum(1)-(p1+1)/2+1),CMA1,
> If(Cum(1)=LastValue(Cum(1)-(p1+1)/2+2),CMA2,
> If(Cum(1)=LastValue(Cum(1)-(p1+1)/2+3),CMA3,
> If(Cum(1)=LastValue(Cum(1)-(p1+1)/2+4),CMA4,
> If(Cum(1)=LastValue(Cum(1)-(p1+1)/2+5),CMA5,CMA)))));CMAP;
>
> Best
> Andrew
>
>
>
>
> --------------------------------------------------------------------------------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/equismetastock/
>
> b.. To unsubscribe from this group, send an email to:
> equismetastock-unsubscribe@xxxxxxxxxxxxxxx
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> 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/
|