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

[EquisMetaStock Group] Re: Highest prices for the year



PureBytes Links

Trading Reference Links

Copy and paste indicator code below, and plot on price chart.

========================
Highs/Lows within period
========================
---8<-------------------

{Plots Highs/Lows within user-input date period}
{josesilva22 at yahoo.com}

StDay:=Input("start Day",1,31,1);
StMnth:=Input("start Month",1,12,1);
StYear:=Input("start Year",1800,2200,2002);
EnDay:=Input("end Day",1,31,31);
EnMnth:=Input("end Month",1,12,12);
EnYear:=Input("end Year",1800,2200,2003);

start:=Year()>StYear
 OR (Year()=StYear AND (Month()>StMnth
  OR Month()=StMnth AND DayOfMonth()>=StDay));
end:=Year()<EnYear
 OR (Year()=EnYear AND (Month()<EnMnth
  OR Month()=EnMnth AND DayOfMonth()<=EnDay));

period:=start AND end;
Hi:=Highest(ValueWhen(1,period,H));
Lo:=Lowest(ValueWhen(1,period,L));

{rem next 3 lines to extend plot to chart's end}
plot:=LastValue(BarsSince(end));
Hi:=Ref(Ref(Hi,-plot),plot);
Lo:=Ref(Ref(Lo,-plot),plot);

Hi;Lo

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

With thanks to Roy for the Ref(Ref(x,-pds),pds) plot-restrict idea.

There is more MetaStock code at
http://users.bigpond.com/prominex/pegasus.htm#metastock

jose '-)



--- In equismetastock@xxxxxxxxxxxxxxx, jmtrader2003 <no_reply@xxxx> 
wrote:
> Can anyone help me write the formula new highs new lows for a stock 
> over a given period EG for the last year. Thanks in advance.


 

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/