SMAA help

free & uncensored discussion arena for TheRumpledOne

Moderator: moderators

User avatar
johannmeya
rank: <50 posts
rank: <50 posts
Posts: 6
Joined: Tue May 23, 2006 6:58 pm
Reputation: 0
Location: Maui
Gender: Male
Contact:

SMAA help

Postby johannmeya » Wed May 24, 2006 8:45 pm

First, thanks to everyone for the help, advice and support. I may be "down" now, but I won't give up. Round#2 is next. Better planning, better strategy.

I have two questions right now. I loaded SMAA Compass - but I couldn't find ver5? The latest version I found was only a reference to ver3. (on the TREND) thread. Is ver5 available somewhere?

The other question is that maybe I am not sure how SMAA MACrossOver works. I tried to do a test and wanted to see the MA on a chart.

Both are 5min, and MA's are 5 & 20, for both radarscreen and chart. Usually it seemed to work, but on a couple stocks it indicates "OVER" when the fast MA is under the slow MA? I have attached a pic. This is a random pick - shouldn't FxS be "UNDER" here?
(Thick yellow line is 20MA, and dotted yellow line is 5MA)

Aloha,
Johann
Image

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15625
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3036
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Thu May 25, 2006 8:02 pm

{_SMAA_COMPASS_Ver5}


{Attn: TradeStation
if this indicator is posted on the TradeStation Forum, I, TheRumpledOne, did NOT post it there,
so I can't be blamed for this indicator having my contact info.}


{Programmer: Avery T. Horton, Jr. aka TheRumpledOne,
gifts and donations accepted, PO Box 43575, Tucson, AZ 85733 }

{ © Copyright 2006 Avery T. Horton, Jr.}



Inputs:

iPeriods(30),

iDecimals(2),

iMsgLong("LONG"),

iMsgShort("SHORT"),

iMsgFlat("FLAT"),


iMsgXAbove("XA"),

iMsgXBelow("XB"),


idummy("");


inputs:

Price( Close ),

iMode("Auto"),
iRSILength(2),

iFrequency(1),

iMROPeriods(200),

iEMAFast(5),
iEMAMed(13),
iEMASlow(26),

OverSold( 1 ),
OverSold2( 5 ),
OverBought( 90 ),
OverBought2( 95 ),


ISWINGDUMMY("");

variables:

xPlot1(""),
xPlot2(""),
xPlot3(""),
xPlot4(""),

xPeriods(60),
xInterval(0),

sFirstPass(true),

xInd(0),
tInd(""),
tAlert("");

variables:

FG1(white),
BG1(black),

fg2(white),
bg2(black),

fg3(white),
bg3(black),

fg4(white),
bg4(black);




{commentary variables}
variables:
xcomm(0),
oComm1( "" ),
oComm2( "" ),
oComm3( "" ),
oComm4( "" ),
oComm5( "" ),
oComm6( "" ),
oComm7( "" ),
oComm8( "" ),
oComm9( "" ),
oComm10( "" );



variables:

xBars(0),

DayTop( 0 ),
DayBottom( 0 ),
DayHigh( 0 ),
PrevDayMid( 0 ),
DayLow( 0 ),

xMROCLXAFAST(0),
xMROCLXBFAST(0),
xMROCLXFAST(0),

xMROMedXASlow(0),
xMROMedXBSlow(0),
xMROMedXSlow(0),


xFrequency(60),
xRSILength(2),


tSwing(""),

tTrade(""),
xEMAMed(0),
xEMASlow(0),


xDiff(0),

xOpen1(0),

xClose0(0),

xClose1(0),


xClose2(0),


xEMAFast(0),
xEMADiff(0),

xRSI(0),
sRSI(0),

Srt(0),

tPrice(""),
tPivot(""),
xdummy(0);



variables:

xDate(0),
xTime(0),
xOpen(0),
xClose(0),
xHigh(0),
xLow(0);



{first time through}

if sFirstPass
then begin

sFirstPass = false;

{bar test}

If bartype = 4
then xInterval = 94
else
If bartype = 3
then xInterval = 93
else
If bartype = 2
then xInterval = 92
else
If bartype = 1
then begin
xInterval = BarInterval;
end; { If bartype = 1 }

end; {if sFirstPass}


{ INITIALIZE }

FG1 = WHITE;
BG1 = BLACK;

fg2 = WHITE;
bg2 = BLACK;

fg3 = WHITE;
bg3 = BLACK;

fg4 = WHITE;
bg4 = BLACK;

tInd = "";
tAlert = "";

xDate = Date ;

xTime = Time ;

xOpen = Open;

xClose = Close;

xHigh = High;

xLow = Low;

{ PROCESSING }



DayHigh = HighD(0) ;
DayLow = LowD(0) ;

if xInterval < 92
then PrevDayMid = ( High[1] + Low[1] ) * .50
else PrevDayMid = ( HighD(1) + LowD(1) ) * .50 ;


If close crosses above PrevDayMid
or close crosses below PrevDayMid
then xBars = 1
else xBars = xBars + 1;

// xBars = _fBarsSinceXover( close, PrevDayMid, iPeriods) ;


{ AUTO MODE - ONLY PROCESS FOR 60 MINUTE OR DAILY CHARTS }

If bartype = 2
then Srt = 92;

If bartype = 1
then begin
Srt = BarInterval;
end; { If bartype = 1 }


xFrequency = iFrequency;
xRSILength = iRSILength;

{mode test}

If iMode = "Auto"
then begin
xFrequency = Srt;
If xFrequency < 15
then xRSILength = 10
else xRSILength = 2;
end; {If iMode = "Auto" }




{ Alert criteria }

xEMAFast = XAverage( Price , iEMAFast );
xEMAFast = round(xEMAFast,iDecimals);

xEMAMed = XAverage( Price , iEMAMed );
xEMAMed = round(xEMAMed,iDecimals);

xEMASlow = XAverage( Price , iEMASlow );
xEMASlow = round(xEMASlow,iDecimals);



xMROCLXFAST = _fBarsSinceXOver(CLOSE , xEMAFast , iMROPeriods );

xMROMedXSlow = _fBarsSinceXOver(xEMAMed , xEMASlow , iMROPeriods );

{ medium x slow criteria }


if xEMAMed > xEMASlow
then begin
tSwing = iMsgLong;
FG1 = BLACK;
BG1 = green;
end;

if xEMAMed < xEMASlow
then begin
tSwing = iMsgShort;
FG1 = BLACK;
BG1 = red;
end;


if xEMAMed = xEMASlow
then begin
tSwing = iMsgFlat;
FG1 = BLACK;
BG1 = YELLOW;
end;

if xEMAMed crosses above xEMASlow
then begin
tSwing = iMsgXAbove;
FG1 = darkgreen;
BG1 = white;
end;

if xEMAMed crosses BELOW xEMASlow
then begin
tSwing = iMsgXBelow;
FG1 = red;
BG1 = white;
end;

{close x fast criteria }

If close > xEMAFast
then begin
tTrade = iMsgLong;
Fg2 = BLACK;
Bg2 = green;
end;

If close < xEMAFast
then begin
tTrade = iMsgShort;
Fg2 = BLACK;
Bg2 = red;
end;

If close = xEMAFast
then begin
tTrade = iMsgFlat;
Fg2 = BLACK;
Bg2 = YELLOW;
end;


If close crosses above xEMAFast
then begin
tTrade = iMsgXAbove;
Fg2 = darkgreen;
Bg2 = white;
end;

If close crosses BELOW xEMAFast
then begin
tTrade = iMsgXBelow;
Fg2 = red;
Bg2 = white;
end;


{ RSI Alert criteria }

xRSI = RSI( CLOSE, xRSILength );


if xRSI <= OverSold
then begin
Fg3 = white;
Bg3 = darkblue;
end
else
if xRSI <= OverSold2
then begin
Fg3 = black;
Bg3 = cyan;
end;


if xRSI >= OverBought
then begin
Fg3 = WHITE;
Bg3 = DARKred;
end;



if xRSI >= OverBought2
then begin
Fg3 = WHITE;
Bg3 = red;
end;


{
iMsgLong("LONG"),

iMsgShort("SHORT"),

iMsgFlat("FLAT"),

iMsgXAbove("XA"),

iMsgXBelow("XB"),

}


If CLOSE CROSSES ABOVE PrevDayMid
then begin
tInd = iMsgXAbove ;
tAlert = tInd ;
Fg4 = BLACK;
Bg4 = yellow;
end
else
If CLOSE CROSSES below PrevDayMid
then begin
tInd = iMsgXBelow ;
tAlert = tInd ;
Fg4 = red;
Bg4 = yellow;
end
else
If CLOSE > PrevDayMid
then begin
tInd = iMsgLong ;
Fg4 = BLACK;
Bg4 = green;
end
else
If CLOSE < PrevDayMid
then begin
tInd = iMsgShort ;
Fg4 = BLACK;
Bg4 = red;
end
else begin
tInd = iMsgFlat ;
tAlert = tInd ;
Fg4 = magenta;
Bg4 = white;
end;


{ Alert }

if tAlert <> ""
and tAlert <> tAlert[1]
then Alert( tAlert ) ;


{ PLOT }


xPlot1 = tSwing + " " + numtostr(xMROMedXSlow , 0);

xPlot2 = tTrade + " " + numtostr(xMROCLXFAST , 0);

{
xPlot3(""),
}

xPlot4 = tInd + " " + numtostr(xBars , 0);


Plot1( xPlot1 , "MxS", fg1 ) ;
SetPlotBGColor( 1, bg1);

Plot2( xPlot2 , "CxF", fg2 ) ;
SetPlotBGColor( 2, bg2);

Plot3( xRSI, "RSI", fg3 ) ;
SetPlotBGColor( 3, bg3);

Plot4( xPlot4 , "Middle", fg4 ) ;
SetPlotBGColor( 4, bg4 );


xComm = _fCommentary(oComm1, oComm2, oComm3, oComm4, oComm5, oComm6, oComm7, oComm8, oComm9, oComm10);

CommentaryCl(oComm1 );

CommentaryCl(oComm2 );
CommentaryCl(oComm3 );
CommentaryCl(oComm4 );
CommentaryCl(oComm5 );
CommentaryCl(oComm6 );
CommentaryCl(oComm7 );
CommentaryCl(oComm8 );
CommentaryCl(oComm9 );
CommentaryCl(oComm10 );

{
CommentaryCl( "Open_AvgCost: ", NumToStr( Open_AvgCost , iDecimals) );


CommentaryCl( "xInd: ", NumToStr( xInd , iDecimals) );


CommentaryCl( "xFreeShares: ", NumToStr( xFreeShares , 0 ) );

}
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!

Please do NOT PM me with trading or coding questions, post them in a thread.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15625
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3036
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Thu May 25, 2006 8:03 pm

Make sure you have enough additional bars loaded.

I usually use 400 on 1 - 60 minute charts.

User avatar
dad8
rank: <50 posts
rank: <50 posts
Posts: 3
Joined: Mon Jul 17, 2006 10:02 pm
Reputation: 0
Gender: Male
Contact:

won't verify

Postby dad8 » Wed Jul 19, 2006 12:34 am

won't verify in TS 81

says word not recognised , see att

.


thanks for your help

dad8 :D

User avatar
christhlo2
rank: <50 posts
rank: <50 posts
Posts: 25
Joined: Thu May 18, 2006 7:03 am
Reputation: 0
Gender: None specified

Postby christhlo2 » Wed Jul 19, 2006 10:42 am

Hi dad8,

Take a look at the forum with the following heading, it should solve you problem:

kreslik.com - Traders Community Forum Index » strategy trading forums » indicators » SMAA_MIDDLE_TRADE - Enhancement


O:)

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “TheRumpledOne”