MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Max Between Two Troughs by Jose Silva

From: vbabuff <no_reply[at]>
To: equismetastock[at] <equismetastock[at]>
Date: Wednesday, January 18, 2006, 7:04:06 AM
Subject: [EquisMetaStock Group] Maximum-In-Between Function

I am trying to create a function that will calculate the maximum between two troughs (in the past). Unfortunately, as the HHV function will only accept constants as arguments, I am stuck. Ideally, if RP1 and RP2 are - respectively - the number of bars between the last two troughs T1 and T2 and today, the function should calculate the highest high between T1 and T2. Can you please help me?

Many thanks in advance.


From: Jose Silva <josesilva22[at]>
To: equismetastock[at] <equismetastock[at]>
Date: Wednesday, January 18, 2006, 7:23:52 PM
Subject: [EquisMetaStock Group] Re: Maximum-In-Between Function

Try this MS indicator:

Max Between Two Troughs

{ Maximum between last two troughs }
{ }

{ User inputs }
pr:=Input("Trough minimum % change",.001,100,5);
plot:=Input("Plot: [1]Max, [2]Trough signals, [3]Trough zone",1,3,

{ Data array or indicator for Max search }

{ Last 2 troughs' signals }
tr2:=tr1 AND Cum(tr1)=LastValue(Cum(tr1)-1);
tr1:=tr1 AND Cum(tr1)=LastValue(Cum(tr1));

{ Trough1-Trough2 period }
zone:=ValueWhen(1,tr2-tr1<>0 OR init,tr2);

{ Maximum High for trough period }
Hi:=Highest(ValueWhen(1,zone {OR init},x));

{ Plot on price chart }


jose '-)

From: vbabuff <no_reply[at]>
To: equismetastock[at] <equismetastock[at]>
Date: Thursday, January 19, 2006, 9:41:54 AM
Subject: [EquisMetaStock Group] Re: Maximum-In-Between Function

Thanks Jose', really appreciated !!!



Source / From: TOP

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!