NEW SLOT MACHINE INDICATOR - _SMAA_TRIX_2Line

post your indicators here

Moderator: moderators

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

NEW SLOT MACHINE INDICATOR - _SMAA_TRIX_2Line

Postby TheRumpledOne » Wed Jul 19, 2006 11:24 am




Someone on my yahoo board asked for this.

ELD attached.

Code: Select all

{ _SMAA_TRIX_2Line  }
   

{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.}


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

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

{ 2-Line TRIX indicator for Jongseon Kim's TAOSC article
"When and When Not To Trade", TAOSC - Jan. 2004 }

inputs:
   TRIXLength( 5 ),
   SigLineXMALen( 3 ) ;
   
Inputs:
 
iMsgLong("LONG"),

iMsgShort("SHORT"),

iMsgFlat("FLAT"),


iMsgXAbove("XA"),

iMsgXBelow("XB"),

iDecimals(2);
 
 
variables:
   EMA1( 0 ),
   EMA2( 0 ),
   EMA3( 0 ),
   TRIXLine( 0 ),
   SignalLine( 0 ) ;

variables:
 
xPeriods(60),
xInterval(0),

sFirstPass(true),
 
xBars(0),

xInd(0),
tMsg(""),
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:

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;

tMsg   = "";
tAlert  = "";

xDate   = Date ;

xTime   = Time ;

xOpen    =  Open;

xClose   =  Close;

xHigh    =  High;

xLow    =  Low;

{ PROCESSING }
 


EMA1 = XAverage( Close, TRIXLength ) ;
EMA2 = XAverage( EMA1, TRIXLength ) ;
EMA3 = XAverage( EMA2, TRIXLength ) ;

if EMA3[1] <> 0
   then TRIXLine = 10 * ( EMA3 - EMA3[1] ) / EMA3[1] ;

SignalLine = XAverage( TRIXLine, SigLineXMALen ) ;


{ Alert criteria }



If TRIXLine CROSSES ABOVE SignalLine
then begin
   xBars = 1;
   Fg3 = BLACK;
   Bg3 = yellow;
   tMsg = iMsgXAbove ;
end
else
If TRIXLine CROSSES below SignalLine
then begin
   xBars = 1;
   Fg3 = red;
   Bg3 = yellow;
   tMsg = iMsgXBelow ;
end
else
If TRIXLine > SignalLine
then begin
   xBars = xBars + 1;
   Fg3 = BLACK;
   Bg3 = green;
   tMsg = iMsgLong ;
end
else
If TRIXLine < SignalLine
then begin
   xBars = xBars + 1;
   Fg3 = BLACK;
   Bg3 = red;
   tMsg = iMsgShort ;
end
else  begin
   xBars = xBars + 1;
   Fg3 = white;
   Bg3 = BLACK;
   tMsg = iMsgFlat;
end;


tAlert = tMsg ;




If TRIXLine CROSSES ABOVE 0
then begin
   Fg1 = BLACK;
   Bg1 = yellow;
end
else
If TRIXLine CROSSES below 0
then begin
   Fg1 = red;
   Bg1 = yellow;
end
else
If TRIXLine > 0
then begin
   Fg1 = BLACK;
   Bg1 = green;
end
else
If TRIXLine < 0
then begin
   Fg1 = BLACK;
   Bg1 = red;
end
else  begin
   Fg1 = white;
   Bg1 = BLACK;
end;



If SignalLine CROSSES ABOVE 0
then begin
   Fg2 = BLACK;
   Bg2 = yellow;
end
else
If SignalLine CROSSES below 0
then begin
   Fg2 = red;
   Bg2 = yellow;
end
else
If SignalLine > 0
then begin
   Fg2 = BLACK;
   Bg2 = green;
end
else
If SignalLine < 0
then begin
   Fg2 = BLACK;
   Bg2 = red;
end
else  begin
   Fg2 = white;
   Bg2 = BLACK;
end;
                



{ Alert }

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


{ PLOT }

Plot1( TRIXLine, "TRIXLine", fg1 ) ;
SetPlotBGColor( 1, bg1);


Plot2( SignalLine, "SignalLine" , fg2 ) ;
SetPlotBGColor( 2, bg2);


Plot3( tMsg , "Msg", fg3 ) ;
SetPlotBGColor( 3, bg3 );

Plot4( xBars , "Trend", fg3 ) ;
SetPlotBGColor( 4, bg3 );
 



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 ) );

}
Attachments
SMAA_TRIX_2LINE.ELD
(9 KiB) Downloaded 542 times

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

sharpshooter
rank: <50 posts
rank: <50 posts
Posts: 1
Joined: Fri Jul 21, 2006 9:08 pm
Reputation: 0
Location: Georgia
Gender: Male

TRIX2LINE

Postby sharpshooter » Fri Jul 21, 2006 9:32 pm

TRO, YOU THE MAN !!!!!!!!!!!!!!!! CAN'T WAIT TO TEST DRIVE.

THANKS AGAIN.
SHARPSHOOTER

ph7
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Sun Jul 16, 2006 6:02 am
Reputation: 0
Gender: Male

trix 2 line

Postby ph7 » Tue Jul 25, 2006 5:10 pm

hello everyone,
I found this trix 2 line very helpful. thanks TRO. I have a newb question. is it possible to do something similar to the Williams % R indicator? what I mean is to smooth it out like that. maybe it's already been done but I can't find any reference to it. any help will be greatly appreciated. btw, great forum! good trading...

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

Postby TheRumpledOne » Wed Jul 26, 2006 12:35 am

Yes, you could use the code and put the Williams %R in there.
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.

ph7
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Sun Jul 16, 2006 6:02 am
Reputation: 0
Gender: Male

Postby ph7 » Thu Jul 27, 2006 4:08 am

tried this and it looks good so far. thanks Mr. TRO. another request...does anyone know where I can find a tick countdown in eld format? don't know if that is even possible. i'm not using tradestation but can import eld files. thanks again.

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

forest
rank: <50 posts
rank: <50 posts
Posts: 16
Joined: Fri Jun 16, 2006 12:58 am
Reputation: 0
Gender: Male

Postby forest » Tue Oct 03, 2006 9:32 pm

This is one of my favorite indicators. Was glad to find you have incorporated it into the SlotMachine.

Thanks,
Forest

Ali Son
rank: 150+ posts
rank: 150+ posts
Posts: 179
Joined: Sun May 28, 2006 1:30 am
Reputation: 0
Location: Boston, MA
Gender: None specified

Postby Ali Son » Thu Oct 05, 2006 11:48 am

How does one use this thing? Looking at the above picture, doesn't seem to be doing anything? Is it better on other timeframes? What timeframes do people use it on it? How are you using it...anybody???

forest
rank: <50 posts
rank: <50 posts
Posts: 16
Joined: Fri Jun 16, 2006 12:58 am
Reputation: 0
Gender: Male

Postby forest » Thu Oct 05, 2006 8:44 pm

Ali Son wrote:How does one use this thing? Looking at the above picture, doesn't seem to be doing anything? Is it better on other timeframes? What timeframes do people use it on it? How are you using it...anybody???


Trix is a triple smoothed exponential moving average "TRIX". When you have a signal included with it, you look for trade opportunities when they cross.

It is good for eliminating whipsaws and doesn't have too much lag.

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


Return to “Tradestation indicators”