PureBytes Links
Trading Reference Links
|
Hi Maxwells.
> Tkx, that s exactly what I wanted! The error I had in earlier post
> is that I was comparing orange and apple, that s why I didn t get
> same numbers as your version. (I compared your ema30 with my "SMA"
> 30)
My indicator was an SMA. I haven't posted an EMA yet.
> If I may, can I ask you to elaborate on the "J" part, I didn't get
> it from your post, neither from reading the formula. Do I need it?,
The "J" variable is the timing signal that when data is sampled (end of 30-minute bar or beginning
of next 30-minute bar), and what data is sampled (data from the current bar for end of 30-minutes,
or data from the previous bar if beginning of new 30-minutes)
> It's because I have a lots of charts open (that s the main reason I
> want that 30m ema on the same 5m chart, to cut down charts number by
> 2) and I would I do to have an input for the timeframe instead of a
The EMA version of this Moving Average uses the PREV function, so it might not be a good idea to use
it with many intraday charts open. I don't know if open charts in the background affect the
foreground open chart, but I would be cautious about having PREV based formulas on all open charts.
> To answer your question, I did bother trying the SMA not the EMA,
> that's what was my problem :), and I find it very usefull to look at
> an EMA 4-6 times my usual working timeframe to find the strengh of
> the trend.
Sorry.
> It's nice to chat with the pros.
Likewise.
Both SMA and EMA are repeated below. I had some labelling mistakes on the previous indicator.
{Half Hour EMA - Close}
{2005 Roy Larsen, www.metastocktips.co.nz}
{for use on 5-30 minute charts}
N:=Input("Half Hour EMA - Periods",1,99,10);
Q:=Input("Display Mode, 0=Static 1=Dynamic 2=Test",0,2,1);
{0=Update on last bar of 30-minute frame if possible}
{1=Update on each new bar}
{2=Update on first bar of 30-minute frame}
A:=Minute(); B:=ValueWhen(2,1,A);
X:=Hour(); Y:=ValueWhen(2,1,X);
G:=LastValue(Highest(Sum(A=0 OR A=30,5))=5);
F:=G OR A=0 OR A=30;
M:=G OR X<Y OR (X=Y)*(B=0) OR (X=Y)*(B=30) OR
(X>Y)*(A<>0) OR (A>30)*(B<=30) OR
(A<=30)*(A<>0)*(B>30) OR ValueWhen(2,1,F);
A:=LastValue(Cum(1)-1)=Cum(1);
B:=ValueWhen(2,1,A);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
N:=2/(1+N);
If(Cum(J>0)=1,K,ValueWhen(1,J,PREV)*(1-N)+K*N);
{Half Hour SMA - Close}
{2005 Roy Larsen, www.metstocktips.co.nz}
{for use on 1-30 minute charts}
N:=Input("Half Hour SMA - Periods",1,99,10);
Q:=Input("Display Mode, 0=Static 1=Dynamic 2=Test",0,2,1);
{0=Update on last bar of 30-minute frame if possible}
{1=Update on each new bar}
{2=Update on first bar of 30-minute frame}
A:=Minute(); B:=ValueWhen(2,1,A);
X:=Hour(); Y:=ValueWhen(2,1,X);
G:=LastValue(Highest(Sum(A=0 OR A=30,5))=5);
F:=G OR A=0 OR A=30;
M:=G OR X<Y OR (X=Y)*(B=0) OR (X=Y)*(B=30) OR
(X>Y)*(A<>0) OR (A>30)*(B<=30) OR
(A<=30)*(A<>0)*(B>30) OR ValueWhen(2,1,F);
A:=LastValue(Cum(1)-1)=Cum(1);
B:=ValueWhen(2,1,A);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
X:=Cum((J>0)*K);
(X-ValueWhen(N+1,J,X))/N;
Roy Larsen
www.metastocktips.co.nz
Free formulas and MS links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/
|