PureBytes Links
Trading Reference Links
|
/* !guru commentary
By David Holzgrefe
using 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, signal line 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 price has "+
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 prices to 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 go
long 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.");
------=_NextPart_001_0064_01C0C6AD.788FB660
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4611.1300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#00ffff>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2>Maybe other's haven't yet looked at the power
of guru commentary, very similar to ms </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>/* !guru commentary <BR>By David
Holzgrefe<BR>using bits and pieces stolen for others
:)<BR>15.04.2001<BR>*/<BR>"Review of " + fullname() + " (" + name() + ")" +
"\nas of " + date();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>"The current market condition for "+ name() + " is:
";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>avgcond1 = ( c > ema( close, 200) ) +0.1 * (
close > ema( close, 90) ) + 0.1 * ( close > ema( close , 30 )
);<BR>avgcond2 = -( c < ema( close, 200) ) - 0.1 * ( close < ema( close,
90) ) - 0.1 * ( close < ema( close , 30 ) );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>WriteIf( avgcond1 == 1.2,<BR>"Very
Bullish",<BR>WriteIf( avgcond1 == 1.1,<BR>"Bullish",<BR>WriteIf( avgcond1 ==
1.0,<BR>"Mildly Bullish", "") ) ) +</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>WriteIf( avgcond2 == -1.2,<BR>"Very
Bearish",<BR>WriteIf( avgcond2 == -1.1,<BR>"Bearish",<BR>WriteIf( avgcond2 ==
-1.0,<BR>"Mildly Bearish", "") ) );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>buy=cross( macd(), signal() );<BR>sell = cross( signal(), macd()
);</DIV>
<DIV> </DIV>
<DIV><BR>roc2weekreturn = roc( close, 5 * 2 );</DIV>
<DIV> </DIV>
<DIV>"\nCurrent Statistics\n";<BR>"Close: " +
WriteVal(Close);<BR>bars=lastvalue(min( barssince( cross( macd(), signal() )),
barssince( cross( signal(), macd())) ));</DIV>
<DIV> </DIV>
<DIV>prevclose=ref(Close,-bars);<BR>"Price has ranged from a high of
"+<BR>writeval(HHV(High,bars+1),6.3)+<BR>" to a low of
"+<BR>writeval(LLV(Low,bars+1),6.3);</DIV>
<DIV> </DIV>
<DIV>"Price Change: " + WriteVal(Close - Ref( Close, -1 ) ) +
"
Over previous Days close";<BR>"MACD Value: " + WriteVal(MACD())+
"
Signal Line: " + WriteVal(SIGNAL());</DIV>
<DIV> </DIV>
<DIV>"RSI Value: " + WriteVal(rsi(14)) +
"
ROC Value:"+ WriteVal(roc2weekreturn)+"%"+" over 10
periods .";<BR>"CCI Value:" + WriteVal(CCI());</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>"";<BR>"";</DIV>
<DIV> </DIV>
<DIV>"The Current moving averages are :";<BR>"5 Day moving av :" +
writeval(ema(close,5)) +
" 150 Day moving av:" +
writeval(ema(close,150));<BR>"13 Day moving av:" +
writeval(ema(close,13))+
" 200 Day moving av:"+
writeval(ema(close,200));<BR>"30 Day moving av:" +
writeval(ema(close,30));</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>"\nThe MACD can provide buy/sell indications in three ways, signal line
crossovers, overbought/oversold conditions, and divergences.\n";</DIV>
<DIV> </DIV>
<DIV>"Crossovers:\n";<BR>"Currently the MACD is "+<BR>writeif(macd() >
signal(),"bullish","bearish")+<BR>" since it is trading "+<BR>writeif(macd()
> signal(),"above","below")+<BR>" its signal line.";</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>"The MACD crossed "+<BR>writeif(macd() > signal(),"above","below")+<BR>"
its signal line "+<BR>writeval( min( barssince( cross( macd(), signal() )),
barssince( cross( signal(), macd()))), 0.0)+<BR>" period(s) ago.";</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>"Since the MACD crossed its moving average, "+<BR>name()+"'s price has
"+<BR>writeif(close>prevclose,"increased ","decreased
")+<BR>writeval(100*(close-prevclose)/prevclose) + "%";</DIV>
<DIV> </DIV>
<DIV><BR>"\nOverbought/Oversold\n";<BR>Osc = OscP( 12, 26 );<BR>Osc1 = Ref( Osc,
-1 );<BR>Osc5 = Ref( Osc, -5 );</DIV>
<DIV> </DIV>
<DIV>writeif( Osc <= -3 AND ( Osc - Osc5 ) == -Sum( Abs( Osc - Osc1 ), 5
),<BR>"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.", <BR>writeif( Osc >= 3 AND ( Osc - Osc5 ) == Sum( Abs( Osc
- Osc1 ), 5 ), <BR>"The MACD is in an overbought range. Prices may
continue to move higher for some time. Wait for prices to move lower
before considering any short positions.", <BR>"The MACD is not in an
Overbought/Oversold range."));</DIV>
<DIV> </DIV>
<DIV>"\nDivergence\n";<BR>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;</DIV>
<DIV> </DIV>
<DIV>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;</DIV>
<DIV> </DIV>
<DIV>writeif( hhv( temp, 5 ) == 1,"A bullish divergence occurred " + writeval(
barssince( temp ), 1.0 ) + <BR>" period(s) ago. Wait for upward price movement
for confirmation before considering any long positions.",<BR>writeif( hhv(
temp2,5) == 1,<BR>"A bearish divergence occurred " +<BR>writeval( barssince(
temp2 ), 1.0 ) +<BR>" period(s) ago. Wait for downward price movementfor
confirmation before considering any short positions.",<BR>"There have been no
divergence signals within the last 5 periods." ) );</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR>buy=cross( cci(), -100 );<BR>sell = cross( 100, cci() );</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR>"\nCurrent Statistics\n";<BR>"\nOrdinarily, CCI ranges in value from
+100 to -100. The rules are to buy and go<BR>long 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";</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>"\nCCI is now in "+<BR>writeif( cci() < -100, "oversold", <BR>writeif(
cci() > 100, "overbought", "neutral" )) +<BR>" range";</DIV>
<DIV> </DIV>
<DIV>bsbuy = barssince( buy );<BR>bssell = barssince( sell );</DIV>
<DIV> </DIV>
<DIV>"\nCCI has generated "+<BR>writeif( bsbuy > 10 AND bssell > 10, "no
signals during last 10 periods.",<BR>writeif( bsbuy < bssell, "buy signal " +
writeval( bsbuy, 3.0 ),<BR>"sell signal " + writeval( bssell, 3.0) ) + "
periods ago.");</DIV>
<DIV> </DIV>
<DIV> <BR></FONT></DIV></BODY></HTML>
------=_NextPart_001_0064_01C0C6AD.788FB660--
Attachment:
Attachment:
Description: "Description: Binary data"
|