PureBytes Links
Trading Reference Links
|
Peter,
The buy sell arrows are generated by the
cci
and are not really of any use in the commentary
except to generate signal for the text for cci " CCI has generated buy
signal 1 periods ago."
you can hide them by changing the code to
:
buy1=cross( cci(), -100 );sell1 = cross( 100,
cci() );
bsbuy = barssince( buy1 );bssell =
barssince( sell1 );
By the way I'm no expert there may be errors in the
commentary,
I welcome any dialog from others if they can spot
any error or suggest more efficient ways to achieve the same
results.
Thanks David
<BLOCKQUOTE dir=ltr
>
----- Original Message -----
<DIV
>From:
<A title=peter.white@xxxx
href="">Peter B. White
To: <A title=dtholz@xxxxxx
href="">dtholz@xxxx
Cc: <A title=filel@xxxxxxxxxxx
href="">filel
Sent: Tuesday, April 17, 2001 6:09
PM
Subject: RE: [amibroker] guru
commentary
Hi
David,
<SPAN
class=030530608-17042001>
<SPAN
class=030530608-17042001>Thanks for posting the guru commentary. I am still a
novice at this and don't seem to find enough time to become
proficient.
<SPAN
class=030530608-17042001>
Can
you tell me what the red/green arrows represent. What indicator arethye based
on?
<SPAN
class=030530608-17042001>
<SPAN
class=030530608-17042001>Cheers,
<SPAN
class=030530608-17042001>
<SPAN
class=030530608-17042001>Peter
<FONT face=Tahoma
size=2>-----Original Message-----From: David Holzgrefe
[mailto:dtholz@xxxx]Sent: Monday, 16 April 2001 7:43
PMTo: <A
href="">amibroker@xxxxxxxxxxxxxxxSubject:
[amibroker] guru commentary
Hi all in the absence of others posting there
guru commentary files here's one I have but together for a bit of fun trying
to learn how the afl language works.
Maybe other's haven't yet looked at the power
of guru commentary, very similar to ms
/* !guru commentary By David
Holzgrefeusing bits and pieces stolen for others
:)15.04.2001*/"Review of " + fullname() + " (" + name() + ")" +
"\nas of " + date();
"The current market condition for "+ name() + "
is: ";
avgcond1 = ( c > ema( close, 200)) + 0.1 *
( close > ema( close, 90) ) + 0.1 * ( close > ema( close , 30 )
);avgcond2 = -( c < ema( close, 200) ) - 0.1 * ( close < ema(
close, 90) ) - 0.1 * ( close < ema( close , 30 ) );
WriteIf( avgcond1 == 1.2,"Very
Bullish",WriteIf( avgcond1 == 1.1,"Bullish",WriteIf( avgcond1 ==
1.0,"Mildly Bullish", "") ) ) +
WriteIf( avgcond2 == -1.2,"Very
Bearish",WriteIf( avgcond2 == -1.1,"Bearish",WriteIf( avgcond2
== -1.0,"Mildly Bearish", "") ) );
buy=cross( macd(), signal() );sell = cross( signal(), macd()
);
roc2weekreturn = roc( close, 5 * 2 );
"\nCurrent Statistics\n";"Close: " +
WriteVal(Close);bars=lastvalue(min( barssince( cross( macd(), signal()
)), barssince( cross( signal(), macd())) ));
prevclose=ref(Close,-bars);"Price has ranged from a high of
"+writeval(HHV(High,bars+1),6.3)+" to a low of
"+writeval(LLV(Low,bars+1),6.3);
"Price Change: " + WriteVal(Close - Ref( Close, -1 ) ) +
"
Over previous Days close";"MACD Value: " + WriteVal(MACD())+
"
Signal Line: " + WriteVal(SIGNAL());
"RSI Value: " + WriteVal(rsi(14)) +
"
ROC Value:"+ WriteVal(roc2weekreturn)+"%"+" over 10
periods .";"CCI Value:" + WriteVal(CCI());
"";"";
"The Current moving averages are :";"5 Day moving av :"
+ writeval(ema(close,5)) +
" 150 Day moving av:" +
writeval(ema(close,150));"13 Day moving av:" +
writeval(ema(close,13))+
" 200 Day moving av:"
+ writeval(ema(close,200));"30 Day moving av:" +
writeval(ema(close,30));
"\nThe MACD can provide buy/sell indications in three ways, signalline
crossovers, overbought/oversold conditions, and divergences.\n";
"Crossovers:\n";"Currently the MACD is "+writeif(macd() >
signal(),"bullish","bearish")+" since it is trading "+writeif(macd()
> signal(),"above","below")+" its signal line.";
"The MACD crossed "+writeif(macd() >
signal(),"above","below")+" its signal line "+writeval( min(
barssince( cross( macd(), signal() )), barssince( cross( signal(),
macd()))), 0.0)+" period(s) ago.";
"Since the MACD crossed its moving average, "+name()+"'s pricehas
"+writeif(close>prevclose,"increased ","decreased
")+writeval(100*(close-prevclose)/prevclose) + "%";
"\nOverbought/Oversold\n";Osc = OscP( 12, 26 );Osc1 = Ref(
Osc, -1 );Osc5 = Ref( Osc, -5 );
writeif( Osc <= -3 AND ( Osc - Osc5 ) == -Sum( Abs( Osc -Osc1 ), 5
),"The MACD is in an oversold range. Prices may continue to move lower
for some time. Wait for prices to move higher before considering any
long positions.", writeif( Osc >= 3 AND ( Osc - Osc5 ) == Sum(
Abs( Osc - Osc1 ), 5 ), "The MACD is in an overbought range.
Prices may continue to move higher for some time. Wait for pricesto
move lower before considering any short positions.", "The MACD is not in
an Overbought/Oversold range."));
"\nDivergence\n";temp = Trough(LOW, 2, 1) < 0.96 * Ref(
Trough(LOW, 2, 1), -1) AND ValueWhen( Trough(LOW, 2, 1) != Ref( Trough(LOW,
2, 1), -1 ), MACD(), 1 ) >= 0.90 * ValueWhen( Trough( LOW, 2, 1) != Ref(
Trough( LOW, 2, 1), -1 ), MACD(), 2 ) AND MACD() < 0;
temp2= Peak( HIGH,2, 1) > 1.04 * Ref( Peak( HIGH, 2, 1), -1)
AND ValueWhen( Peak( HIGH, 2, 1) != Ref( Peak( HIGH, 2, 1), -1 ), MACD(), 1
) <= 0.90 * ValueWhen( Peak( HIGH, 2, 1) != Ref( Peak( HIGH,
2, 1), -1 ), MACD(), 2 ) AND MACD() > 0;
writeif( hhv( temp, 5 ) == 1,"A bullish divergence occurred " +
writeval( barssince( temp ), 1.0 ) + " period(s) ago. Wait for upward
price movement for confirmation before considering any long
positions.",writeif( hhv( temp2,5) == 1,"A bearish divergence
occurred " +writeval( barssince( temp2 ), 1.0 ) +" period(s)
ago. Wait for downward price movement for confirmation before
considering any short positions.","There have been no divergence signals
within the last 5 periods." ) );
buy=cross( cci(), -100 );sell = cross( 100, cci() );
"\nCurrent Statistics\n";"\nOrdinarily, CCI ranges in value
from +100 to -100. The rules are to buy and golong when CCI crosses
above +100 and close the long when CCI falls back below +100. Conversely,
sell short when CCI crosses below -100 and close the short when CCI crosses
back above -100.\n";
"\nCCI is now in "+writeif( cci() < -100, "oversold",
writeif( cci() > 100, "overbought", "neutral" )) +"
range";
bsbuy = barssince( buy );bssell = barssince( sell );
"\nCCI has generated "+writeif( bsbuy > 10 AND bssell > 10,
"no signals during last 10 periods.",writeif( bsbuy < bssell, "buy
signal " + writeval( bsbuy, 3.0 ),"sell signal " + writeval(
bssell, 3.0) ) + " periods ago.");
Your
use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
|