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 #

Bar Number of ..........
Re: Gann Swing concepts (Fibonacci trader) in Metastock?

. To: metastock@xxxxxxxxxxxxx
. Subject: Re: Gann Swing concepts (Fibonacci trader) in Metastock?
. From: divenfish@xxxxxxxxxxxxx
. Date: Wed, 30 Dec 1998 22:51:30 -0500
. References: <368A3BEB.6F4C122E@xxxxxxxxxxxxxxxxx>
. Reply-To: metastock@xxxxxxxxxxxxx
. Sender: owner-metastock@xxxxxxxxxxxxx

Attached are 2 zipped files in case you want to import. One contains 3 system tests (one each for Fib levels .382, .5, .618) and the other is about 8 or so indicators that are needed by the tests. (They all have similar names to what is below in text.) It's not really necessary to have to do formula calls- you should be able to have all indicators in their respective test by using variables. I just haven't got to that yet. If you want to do it probably the best place to start is to organize/rename each individual indicator's variables so there are no two the same. Then it should be easy to keep things straight when dumping them into the test. It's always nice to have a test self-contained. Just don't forget to send me a copy of what you come up with...provided this stuff helps. :-)

The test simply places a buy arrow if the current/most recent peak is > the previous peak and today's low <= "n" Fib level. Today's low - so set your Trade Delay to zero. I wrote it to quickly mark Fib retracements - so I wouldn't have to do it buy hand. Saves a lot of time. It should be possible to incorporate it into something more meaningful, possibly even the Gann Swing thing. These tests and indicators use the infamous Zig Zag, but there's nothing wrong using it here. I chose Zig Zag over Peak and Trough because it allows me to use points, not just percent. Since I often use back adjusted continuous contracts, it's a necessity to have that option. You'll likely want to change the Zig Zag values from the .75$ that I included. Just be sure you have all values in all referenced indicators identical. I used .75$ for Live Cattle to define the peaks/troughs. It's a fairly reasonable number but it's not etched.

Here are the indicators and test for a .382 retracement. I'm not going to paste the others in here - you'll just have to import them.


BarNumber of Trade Entry day -.382 Fib .75 pts Zig

a:=If((Peak(1,Zig(H,.75,$),.1) >
(Peak(2,Zig(H,.75,$),.1))),1,0);{This sort
of defines an UPtrend, so you're only
looking to BUY dips [retracements].}
b:= (Peak(1,Zig(H,.75,$),.1) -
Trough(1,Zig(L,.75,$),.1)) * .618{.618
will plot a .382 line one the chart} +
x:=If(a=1,Cum(H),0);{This plots a 1 ONLY when
"a" is true, otherwise it plots zero. It simply
counts all the bars (highs) loaded in chart.}
j:= a=1 AND H < (Peak(1,Zig(H,.75,$),.1))
AND x > 0 AND Cross(b,L);
BarNumber:= If(1>0,Cum(1),Cum(1));
k:= If(j,BarNumber,0);


BarNumber of Peaks (.75 pts Zig)

BarNumber:=If(1 > 0,Cum(1),Cum(1));
r:= If(Zig(H,.75,$) > Ref(Zig(H,.75,$),-1) AND
Zig(H,.75,$) > Ref(Zig(H,.75,$),1),H,0);
q:= If(r,BarNumber,0);



BarNumber of Troughs (.75 pts Zig)

BarNumber:=If(1 > 0, Cum(1),Cum(1));
q:= If(Zig(L,.75,$) < Ref(Zig(L,.75,$),-1) AND
Zig(L,.75,$) < Ref(Zig(L,.75,$),1),L,0);
r:= If(q,BarNumber,0);


You will want to plot this and it's Fib Level companions on the chart so you can make sure things are right.


FIB Level .75 pts (.382%)

a:= (Peak(1,Zig(H,.75,$),.1) - Trough(1,Zig(L,.75,$),.1)) *
.618{.618 will plot a .382 line on the chart} + Trough(1,Zig(L,.75,$),.1);


System Test

FIB Retracement .382 Fib .75 pts Zig YES

Fml("BarNumber of Trade Entry day -.382 Fib .75 pts Zig");

If(Fml("BarNumber of Peaks (.75 pts Zig)")>0,
Fml("BarNumber of Peaks (.75 pts Zig)"),PREV);

If(Fml("BarNumber of Troughs (.75 pts Zig)")>0,
Fml("BarNumber of Troughs (.75 pts Zig)"),PREV);

If(a>0 AND b>d ,1,0)



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!