PureBytes Links
Trading Reference Links
|
sure her it is
*******************************************************************
Study : Stochastic - Slow
Last Edit : 1/19/96
Provided By : Omega Research, Inc. (c) Copyright 1996
********************************************************************}
Input: Length(8),BuyZone(20),SellZone(80);
Vars : LongTermTrend(0), ShortTermTrend(0), nocommentary(TRUE),
String1("");
plot1(SlowK(3),"SlowK");
plot2(SlowD(3),"SlowD");
plot3(BuyZone,"BuyZone");
plot4(SellZone,"SellZon");
#BeginCmtryOrAlert
{ Set LongTermTrend Variable }
if Average(Close,45) >= Average(Close,45)[1] and Close >=
Average(Close,45) then
LongTermTrend = 1;
if Average(Close,45) < Average(Close,45)[1] and Close <
Average(Close,45) then
LongTermTrend = -1;
{ Build commentary }
if AtCommentaryBar or CheckAlert
then begin
String1="";
String1=String1+"Conventional Interpretation: "; { Conventional
Interpretation }
nocommentary = TRUE;
if plot1 crosses above plot2
then begin
String1=String1+"The \hbSlowK\he line crossed above the \hbSlowD\he
line; ";
String1=String1+"this indicates a buy signal. ";
nocommentary = FALSE;
end;
if plot1 crosses below plot2
then begin
String1=String1+"The \hbSlowK\he line crossed below the \hbSlowD\he
line; ";
String1=String1+"this indicates a sell signal. ";
nocommentary = FALSE;
end;
if plot1 > plot4
then begin
String1=String1+"The stochastic is in \hboverbought\he territory
(\hbSlowK\he is at "+NumToStr(plot1,2)+"); " ;
String1=String1+"this indicates a possible market drop is coming. ";
nocommentary = FALSE;
end;
if plot1 < plot3
then begin
String1=String1+"The stochastic is in \hboversold\he territory
(\hbSlowK\he is at "+NumToStr(plot1,2)+"); " ;
String1=String1+"this indicates a possible market rise is coming. ";
nocommentary = FALSE;
end;
if plot1 > plot2 and plot1[1] > plot2[1] and plot1 < plot4
then begin
String1=String1+"The stochastic is \hbbullish\he because the
\hbSlowK\he line ";
String1=String1+"is above \hbSlowD\he line. ";
nocommentary = FALSE;
end;
if plot1 < plot2 and plot1[1] < plot2[1] and plot1 > plot3
then begin
String1=String1+"The stochastic is \hbbearish\he because the
\hbSlowK\he line ";
String1=String1+"is below the \hbSlowD\he line. ";
nocommentary = FALSE;
end;
if nocommentary then
String1=String1+"The stochastic is inconclusive on this bar. ";
String1=String1+NewLine;
String1=String1+NewLine;
{ end of Conventional Interpretation }
{ Build Market Analyst commentary }
String1=String1+"Additional Analysis: ";
if LongTermTrend = 1
then begin
ShortTermTrend = 1; { initialize variable every bar to Up }
if LongTermTrend[1] <> 1
then begin
String1=String1+"CAUTION: The \hblong term trend\he has changed
direction. ";
String1=String1+"Now the \hblong term trend\he is UP! ";
alert = TRUE;
end
else
String1=String1+"The \hblong term trend\he is UP. ";
if plot1 < 50 and plot1 < plot1[1] and plot1[1] < plot1[2]
then begin
String1=String1+"The \hbshort term trend\he is down. ";
ShortTermTrend = -1;
end;
if plot1 < 20
then begin
String1=String1+"\hbSlowK\he is showing the market is oversold. Look
for a \hbbottom\he soon. ";
alert = TRUE;
end
else if plot1 < 25
then begin
String1=String1+"\hbSlowK\he is starting to show the market is
\hboversold\he. A \hbbottom\he ma";
String1=String1+"y not be far off. ";
alert = TRUE;
end;
if plot1 < 40 and plot1 > plot1[1] and plot1[1] < plot1[2] and
plot1[2] < plot1[3]
then begin
String1=String1+"The \hbshort term trend\he is UP. ";
String1=String1+"\hbSlowK\he was up this bar for the ";
String1=String1+"first time in a while. Its possible that we may see
an up move here. ";
String1=String1+"if next bar's \hbSlowK\he is also up, then a
possible \hbbottom\he may ";
String1=String1+"have been established. ";
alert = TRUE;
end;
if plot1[1] < 40 and plot1 > plot1[1] and plot1[1] > plot1[2] and
plot1[2] < plot1[3] and plot1[3] < plot1[4] and ShortTermTrend = 1
then begin
String1=String1+"The \hbshort term trend\he is UP. ";
String1=String1+"\hbSlowK\he was up this bar for the second bar in a
row. We may have ";
String1=String1+"seen the \hbbottom\he of the down move for a while.
";
alert = TRUE;
end;
if (plot1[1] > 70 or plot1[2] > 70) and plot1 < 70
then begin
String1=String1+"The \hbshort term trend\he looks a little toppy. ";
String1=String1+" A possible short term down move may occur. ";
ShortTermTrend = -1;
alert = TRUE;
end
else if plot1 < 70 and plot1 > 30 and plot1 < plot1[1] and plot1[1] <
plot1[2] and plot1[2] < plot1[3] and CLose < Close[1]
then begin
String1=String1+"The \hbshort term trend\he looks a little toppy. ";
String1=String1+"The fact that we've had three down bars of
\hbSlowK\he and we're trading ";
String1=String1+"in a high area of the stochastic is a little
\hbbearish\he short term. ";
String1=String1+"A possible short term down move may occur. ";
ShortTermTrend = -1;
alert = TRUE;
end
else
if plot1 < 80 and plot1 > 30 and plot1 < plot1[1] and plot1[1] <
plot1[2] and Close < Close[1]
then begin
String1=String1+"The \hbshort term trend\he looks a little toppy. ";
String1=String1+"The fact that the last two bars of \hbSlowK\he are
down and we are trading ";
String1=String1+"in a very high area of the stochastic is a little
\hbbearish\he short term. ";
String1=String1+"A possible short term down move may occur. ";
alert = TRUE;
ShortTermTrend = -1;
end;
if plot1 > plot1[1] and plot1 >= 25 and plot1 < 70 and ShortTermTrend
= 1
then begin
String1=String1+"The market looks strong both long term and short
term. The \hbSlowK\he is at ";
String1=String1+"("+NumToStr(plot1,2)+"). A good upward move is
possible without \hbSlowK\he being \hboverbought\he.";
end
else
if plot1[1] > plot1[2] and plot1 >= 30 and plot1 < 70
then begin
String1=String1+"A good upward move is possible without \hbSlowK\he
being \hboverbought\he. ";
String1=String1+"However, a down move in \hbSlowK\he for this bar is
a little concerning short t";
String1=String1+"erm. ";
end;
if plot1 > 70 and ShortTermTrend = 1
then begin
String1=String1+"The \hbshort term trend\he is UP. Even though the
stochastic is signaling that ";
String1=String1+"the market is \hboverbought\he, don't be fooled
looking for a \hbtop\he here ";
String1=String1+"because of this indicator. ";
String1=String1+"The stochastic indicator is only good at picking
tops in a \hbBear Market\he ";
String1=String1+"(in which we are not). Exit long position only if
some other ";
String1=String1+"indicator tells you to.";
end;
end;
if LongTermTrend = -1
then begin
ShortTermTrend = -1;
if LongTermTrend[1] <> -1
then begin
String1=String1+"CAUTION: The \hblong term trend\he has changed
direction. ";
String1=String1+"Now the long term trend is DOWN! ";
alert = TRUE;
end
else
String1=String1+"The \hblong term trend\he is DOWN. ";
if plot1 > 50 and plot1 > plot1[1] and plot1[1] > plot1[2]
then begin
String1=String1+"The \hbshort term trend\he is up. ";
ShortTermTrend = 1;
end;
if plot1 > 80
then begin
String1=String1+"\hbSlowK\he is showing the market is
\hboverbought\he. Look for a \hbtop\he soo";
String1=String1+"n. ";
alert = TRUE;
end
else if plot1 > 75
then begin
String1=String1+"\hbSlowK\he is starting to show the market is
\hboverbought\he. A \hbtop\he may";
String1=String1+" not be far off";
alert = TRUE;
end;
if plot1 > 60 and plot1 < plot1[1] and plot1[1] > plot1[2] and
plot1[2] > plot1[3]
then begin
String1=String1+"The \hbshort term trend\he is DOWN. ";
String1=String1+"\hbSlowK\he was down this bar for the ";
String1=String1+"first time in a while. Its possible that we may see
a down move here. ";
String1=String1+"if next bar's \hbSlowK\he is also down, then a
possible \hbtop\he may have been";
String1=String1+" established. ";
alert = TRUE;
end;
if plot1[1] > 60 and plot1 < plot1[1] and plot1[1] < plot1[2] and
plot1[2] > plot1[3] and plot1[3] > plot1[4] and ShortTermTrend = -1
then begin
String1=String1+"The \hbshort term trend\he is DOWN. ";
String1=String1+"\hbSlowK\he was down this bar for the second bar in
a row. We may have ";
String1=String1+"seen the \hbtop\he of the up move for a while. ";
alert = TRUE;
end;
if (plot1[1] < 30 or plot1[2] < 30) and plot1 > 30
then begin
String1=String1+"The \hbshort term trend\he looks a little bottomy.
";
String1=String1+"A possible short term up move may occur. ";
ShortTermTrend = 1;
alert = TRUE;
end
else
if plot1 > 30 and plot1 < 70 and plot1 > plot1[1] and plot1[1] >
plot1[2] and plot1[2] > plot1[3] and Close > Close[1]
then begin
String1=String1+"The \hbshort term trend\he looks a little bottomy.
";
String1=String1+"The fact that we've had three up bars of
\hbSlowK\he and we're trading ";
String1=String1+"in a low area of the stochastic is a little
\hbbullish\he short term. ";
String1=String1+"A possible short term up move may occur. ";
ShortTermTrend = 1;
alert = TRUE;
end
else if plot1 > 20 and plot1 < 70 and plot1 > plot1[1] and plot1[1] >
plot1[2] and Close > Close[1]
then begin
String1=String1+"The \hbshort term trend\he looks a little bottomy.
";
String1=String1+"The fact that the last two bars of \hbSlowK\he are
up and we are trading ";
String1=String1+"in a low area of the stochastic is a little
\hbbullish\he short term. ";
String1=String1+"A possible short term up move may occur. ";
ShortTermTrend = 1;
alert = TRUE;
end;
if plot1 < plot1[1] and plot1 < 75 and plot1 > 30 and ShortTermTrend
= -1
then begin
String1=String1+"The market looks weak both long term and short
term. The \hbSlowK\he is at ";
String1=String1+"("+NumToStr(plot1,2)+"). A good downward move is
possible without \hbSlowK\he being \hboversold\he.";
end
else if plot1[1] < plot1[2] and plot1 < 70 and plot1 > 30
then begin
String1=String1+"A good downward move is possible without
\hbSlowK\he being \hboversold\he. ";
String1=String1+"However, an upmove in \hbSlowK\he for this bar is
a little concerning short te";
String1=String1+"rm. ";
end;
if plot1 < 30 and ShortTermTrend = -1
then begin
String1=String1+"The \hbshort term trend\he is DOWN. Don't be fooled
looking for a \hbbottom\he";
String1=String1+" here because of this indicator. ";
String1=String1+" The stochastic indicator is only good at picking
bottoms in a ";
String1=String1+"\hbBull Market\he (in which we are not). Exit
\hbshort\he positions only ";
String1=String1+"if some other indicator tells you to.";
end;
end;
commentary(String1);
End;
#End;
Gary Funck wrote:
> would you please also post the ascii form of the ELA file? I read
> mail on a computer other than where Tradestation is running, and
> it would me (perhaps others) to be able to see the EL code without
> having to open it in TS. Thanks.
|