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]yahoogroups.com>
To: equismetastock[at]yahoogroups.com <equismetastock[at]yahoogroups.com>
Date: Wednesday, January 18, 2006, 7:04:06 AM
Subject: [EquisMetaStock Group] Maximum-In-Between Function

Hello.
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.

VBABUFF

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
From: Jose Silva <josesilva22[at]yahoo.com>
To: equismetastock[at]yahoogroups.com <equismetastock[at]yahoogroups.com>
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 }
{ http://www.metastocktools.com }

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

{ Data array or indicator for Max search }
x:=H;

{ Last 2 troughs' signals }
tr1:=TroughBars(1,L,pr)=0;
tr2:=tr1 AND Cum(tr1)=LastValue(Cum(tr1)-1);
tr1:=tr1 AND Cum(tr1)=LastValue(Cum(tr1));

{ Trough1-Trough2 period }
init:=Cum(IsDefined(tr1))=1;
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 }
If(plot=1,Hi,If(plot=2,tr1+tr2,zone))



 

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

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

Thanks Jose', really appreciated !!!

VBABUFF

 

Source / From: TOP
Metastockusers[at]yahoogroups[dot]com

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!