PureBytes Links
Trading Reference Links
|
Hi there,
Note that
0.5 * ( H + L )
is the mid point between the high and the low and should be fairly
close to the close. If you change this to
0.3 * ( H + L )
it is the same as writing
0.6 * 0.5 * ( H + L )
So here you calculate the mid point and then lower it to 60% of its
value! This is waaaay below the close and even waaaay below the low
in 99.99% of the bars you'd observe.
Much better is to play with the weights assigned to the high and low
inside the brakets, something like
( 1 * H + 5 * L ) / 6
will assign a weight of 1 to the high and a weight of 5 to the low.
Note that I have to divide by the sum of the weights (= 6 here). This
1:5 ratio will almost be equal to the low. If you want to rather
work in percentages, just make sure it adds up to 1, and write
something like
0.25 * H + 0.75 * L
Here I give 25% to the high and the remaining, 75% to the low. It
*must* add up to 1.
Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com
--- In equismetastock@xxxxxxxxxxxxxxx, "AA" <arnaouto@xxxx> wrote:
> may I ask a question please?
>
> when I am putting in an expert the expression C<0.5*(H+L) for a
bearish reversal bar indication,I always have an expert symbol for the
bar fullfilling this condition.
>
> But,if I want a close closer to the low,for example C<0.3*(H+L),or
less,I never see an expert symbol on the appropriate bar.I wonder what
happens....Does Metastock reject the expression? because,I never get
an error message
>
> thanks a lot
>
> ----- Original Message -----
> From: PJ Chai
> To: equismetastock@xxxxxxxxxxxxxxx
> Sent: Friday, September 02, 2005 10:51 AM
> Subject: Re: [EquisMetaStock Group] Projecting indicator direction
into the future
>
>
> Thank you Jose, this is exactly what I am looking for. I have put
in another 2 parallels to form a channel. Thank you once again for
your big help.
>
> PJ Chai
>
>
> On 9/2/05, Jose Silva <josesilva22@xxxx> wrote:
> Here's a concept I thought about whilst on holidays:
>
> Forward reference (shift backwards on charts) and center a Moving
> Average, then extend and project the last known MA direction
into the
> future.
>
> This method gets around the no-plot in null (N/A) zone limitation in
> MetaStock, and can apply to any indicator or oscillator on
charts or
> separate windows.
>
>
> MetaStock -> Tools -> Indicator Builder -> New ->
> Copy and paste complete formula between "---8<---" lines.
>
> =============
> MA - centered
> =============
> ---8<--------------------------
>
> { Centered Moving Average - v3.0 }
> { Uses forward-referencing to center Mov Avg
> and project future direction.}
> { Uses hindsight - do not trade! }
>
> { ©Copyright 2005 Jose Silva
> For personal use only.
> http://www.metastocktools.com }
>
> { User inputs }
> fwPds:=Input("Forward-referencing periods (automatic =
-1)",-1,2600,-
> 1);
> proj:=Input("Project last known MA: [1]Direction,
[2]Value",1,2,1);
> pds:=Input("Mov Avg periods",1,2600,21);
> type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol
[7]Wght",1,7,
> 2);
>
> { Choose MovAvg type:
> 1 - Exponential MA
> 2 - Simple MA
> 3 - Time Series MA
> 4 - Triangular MA
> 5 - Variable MA
> 6 - Volume adjusted MA
> 7 - Weighted MA }
> ma:=
> If(type=1,Mov(C,pds,E),
> If(type=2,Mov(C,pds,S),
> If(type=3,Mov(C,pds,T),
> If(type=4,Mov(C,pds,TRI),
> If(type=5,Mov(C,pds,VAR),
> If(type=6,Mov(C,pds,VOL),
> Mov(C,pds,W)))))));
>
> { Automatic period-centering }
> center:=LastValue(If(fwPds<0,Int(pds/2),fwPds));
>
> { Forward-referenced MovAvg }
> fwd:=Ref(ma,center);
>
> { Last valid MovAvg plot point }
> lastVal:=IsUndefined(fwd)
> AND Alert(IsUndefined(fwd)=0,2);
>
> { Extend MovAvg plot into future null zone }
> xtend:=LastValue(fwd+PREV-PREV);
>
> { Restrict invalid initial MovAvg plot }
> movAvg:=Ref(Ref(xtend,pds-1),-pds+1);
>
> { Last MA known direction & future projection }
> init:=Cum(IsDefined(movAvg))=1;
> direction:=movAvg+
> ( ValueWhen(1,init OR lastVal,Ref(movAvg,-1))
> -ValueWhen(1,init OR lastVal,Ref(movAvg,-2)))
> *(BarsSince(init OR lastVal)+1);
>
> { Plot MovAvg on price chart }
> If(proj=1,direction,movAvg)
>
> ---8<--------------------------
>
>
> jose '-)
> http://www.metastocktools.com
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
> SPONSORED LINKS Business finance course Business finance online
course Business finance class
> Small business finance Business finance schools Business
finance small software
>
>
>
------------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> a.. Visit your group "equismetastock" on the web.
>
> 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 --------------------~-->
Help tsunami villages rebuild at GlobalGiving. The real work starts now.
http://us.click.yahoo.com/njNroD/KbOLAA/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/
|