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

[EquisMetaStock Group] Re: finding tops and bottoms without zig-zag



PureBytes Links

Trading Reference Links

This can be done easily in MetaStock with a little bit of time & effort.

Try this basic code, and adapt to own use:

---8<-----------------------------

{ Custom indicator v1.0
  http://www.metastocktools.com }

{ User inputs }
pds1:=Input("SMA 1 periods",1,252,5);
pds2:=Input("SMA 2 periods",2,2520,21);
type:=Input("use:  [1]Price(Low),  [2]Stoch(5,3)",1,2,1);
plot:=Input("plot:  [1]Lows,  [2]Signals",1,2,1);

{ Indicators }
SMA1:=Mov(C,pds1,S);
SMA2:=Mov(C,pds2,S);

{ Data array }
dat:=If(type=1,L,Stoch(5,3));

{ SMA crossover signals }
entry:=Cross(SMA1,SMA2);
exit:=Cross(SMA2,SMA1);
signals:=entry-exit;

{ Price lows at crossovers }
Lo1:=ValueWhen(1,entry,LowestSince(1,entry,dat));
Lo2:=ValueWhen(1,entry,LowestSince(2,entry,dat));

{ Plot price lows on chart, all else in own window }
If(plot=1,Lo1,0);
If(plot=1,Lo2,signals)

---8<-----------------------------


jose '-)
http://www.metastocktools.com




--- In equismetastock@xxxxxxxxxxxxxxx, chris butler <timbuktu66@xxx> 
wrote:
>
> does anyone know how to go about finding swing tops
> and bottoms of price and an indicator without zig-zag?
>  
> 
> here's what i'm trying to do:
> 
> find the low in price between the points of crossing
> down and up of two moving averages.  that, in and of
> itself is not difficult.  but finding that most recent
> low, defined by crossovers and the *previous* low from
> the crossovers is the problem. 
> 
> in addition, i want to use the same moving average
> crossovers to give the values of the two most recent
> lows in a stoch(5,3).
> 
> i hope to do the same for highs as i'm doing for lows.
>  in other words i'm looking for divergence where the
> periods in which to select highs and lows is defined
> by moving average crossovers.
> 
> any help would be greatly appreciated.
> 
> "The gods, too, are fond of a joke." - Aristotle, 582 B.C.





 
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/