log in     sign up for free
 
If you can't take a small loss, sooner or later you will take the mother of all losses.
Ed Seykota
 
 
Home
systems (284)
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Dunnigan Trend

Formula for: MetaStock

expert advisor


 

 

Views:  2174

Added: March 15, 2007
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaStock, expert advisor
 
Your Ad Here


Code:

Market swing is defined as: Up = higher highsand higher lows, Down = lowerhighs and lower lows.

Dunn-Type1
TD1:=If(BarsSince(H>Ref(H,-1) AND L>Ref(L,-1)) <
BarsSince(L<Ref(L,-1) AND H<Ref(H,-1)),
{then}1,
{else}-1);
TD1




Market swing is defined as: Up = 2 higher highs and 2 higher lows, Down= 2 lower highs and 2 lower lows.

Dunn-Type2
TD1:=If(BarsSince((H>Ref(H,-1) AND L>Ref(L,-1))
AND (Ref(H,-1)>Ref(H,-2)
AND Ref(L,-1)>Ref(L,-2))) <
BarsSince((L<Ref(L,-1) AND H<Ref(H,-1))
AND (Ref(L,-1)<Ref(L,-2)
AND Ref(H,-1)<Ref(H,-2))),
{then}1,
{else}-1);
TD1




Poni¿sza formu³a wymaga wczeœniejszego wprowadzenia formu³y znajduj¹ce siê powy¿ej pod niezmodyfikowan¹ nazw¹.

Dunnigan Trend
{Ask to use 1 day or 2 day Swing type}
St:=Input("Short Term Swing Type, 1 or 2 ?",
1,2,2);
{Call Swing Type Formula}
Sd:=If(Round(St)=1,
{then} FmlVar("Dunn-Type1","TD1"),
{else} FmlVar("Dunn-Type2","TD1"));
{Number Of Periods Since Swing Started Up}
Hc:=BarsSince(SD=-1);
{Number Of Periods Since Swing Started Down}
Lc:=BarsSince(SD=1);
{Find Highest Value Of Up Swing}
Hv:=If(Hc>Lc AND H>Ref(H,-1),
{then}HighestSince(1,Hc=1,H),
{else}0);
{Find Lowest Value Of Down Swing}
Lv:=If(Hc<Lc AND L<Ref(L,-1),
{then}LowestSince(1,Lc=1,L),
{else}0);
{Find The Low Of The Highest High}
Hlv:=ValueWhen(1,H=Hv,L);
{Find The High Of The Lowest Low}
Lhv:=ValueWhen(1,L=Lv,H);
{Calculate And Plot Trend Direction, Note:1= Uptrend, -1= Downtrend}
TD2:=If(Sd=1 AND H>Lhv,
{then}1,
{else}If(Sd=-1 AND L<Hlv,
{then}-1,
{else}0));
TD3:=ValueWhen(1,TD2<>0,TD2);
TD3




Re: Expert "Trend"
¡ To: metastock@xxxxxxxxxxxxx
¡ Subject: Re: Expert "Trend"
¡ From: michael arnoldi <marnoldi@xxxxxxxxxxxxx>
¡ Date: Sun, 18 Apr 1999 12:30:26 -0400
¡ References: <020601be89ac$eeb56c80$0f68a8c2@xxxxxxx>
¡ Reply-To: metastock@xxxxxxxxxxxxx
¡ Sender: owner-metastock@xxxxxxxxxxxxx

click on "experts" {the man's head logo in metastock}, click on an expert you like or created. the tab next to "name" is the "trend" tab. for my experts i have the following trend formula:

Dunnigan Trend Expert
Bullish:

Fml("Dunnigan Trend")=1


Bearish:

Fml("Dunnigan Trend")=-1



 





Source: http://www.purebytes.com

 

View similar (expert advisor for MetaStock):

Trend Trigger Factor Expert
%Bands I
Combining Statistical & Pattern Analysis, Shark-32
Smoothed Stochastic Expert
Squelch Threshold
Double Stochastics Expert
Dunnigan Trend
Chande's Long Bomb Expert
Ehlers Distant Coefficient Filter
Bull Fear and Bear Fear Expert
...
 
 
all formulas for MetaStock
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012