TRO TRAILING STOP

post your indicators here

Moderator: moderators

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

TRO TRAILING STOP

Postby TheRumpledOne » Thu Aug 16, 2007 2:18 am

TRO TRAILING STOP



Too funny, I just realized today that TradeStation doesn't have a trailing stop INDICATOR. There's the Stops & Targets strategy for auto trading but I don't think there's an indicator. So I wrote one TRO TRAILING STOP to alert you when your stop is hit.

White "+" is the entry price.

Yellow "+" is the stop price.

ELD attached.
Attachments
TRO_TRAILINGSTOP.ELD
(9.97 KiB) Downloaded 640 times
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.

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

rebkwez
rank: <50 posts
rank: <50 posts
Posts: 8
Joined: Thu Jan 25, 2007 7:24 am
Reputation: 0
Gender: None specified

Postby rebkwez » Thu Aug 16, 2007 5:35 pm

Any chance of being able to write this indicator for eSignal as well.

Thanks.
Elliot

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

Postby TheRumpledOne » Thu Aug 16, 2007 9:55 pm

Not anytime soon.
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.

rebkwez
rank: <50 posts
rank: <50 posts
Posts: 8
Joined: Thu Jan 25, 2007 7:24 am
Reputation: 0
Gender: None specified

TS Code

Postby rebkwez » Tue Aug 21, 2007 8:18 pm

Avery,

Would you be able to post the TS code so I can convert it to eSignal?

Thanks,
Elliot

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

Postby TheRumpledOne » Tue Aug 21, 2007 8:44 pm

Code: Select all

{ _TRO_TrailingStop  }
   

{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 2007 Avery T. Horton, Jr.}



Inputs:
 
iDecimals(4),
iStartDate( 1070815),
iStartTime( 1705),
 
iTradeLong(false),
iEntryColor(white),
iStopColor(yellow),
iPrice( 1.9874),
iTrailing( .0007);
 
variables:
 

xStartDate( iStartDate ),
xStartTime( iStartTime ),
xPrice( iPrice ),

xTrail(0),   
xMinPL(0),

   

xPeriods(60),
xInterval(0),

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

variables:
 
FG1(iStopColor),
BG1(black),

fg2(iEntryColor),
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:
xELDateToString(" "),
xDate(0),
xTime(0),         
xOpen(0),   
xClose(0),
xHigh(0),
xLow(0);

   



{ INITIALIZE }

tInd   = "";
tAlert  = "";


{ PROCESSING }
 
If Date = xStartDate
and Time = xStartTime
then begin   

if iTradeLong
   then xTrail = xPrice - iTrailing
    else xTrail = xPrice + iTrailing ;
end;
    

If Date > xStartDate
or ( Date = xStartDate and Time >= xStartTime )
then begin   
   
if iTradeLong
then begin
   value9 = High - iTrailing ;
   If value9 > xTrail
      then xTrail = value9 ;
   if close <= xTrail
      then tAlert  = "Long Stop Hit";
end;


if iTradeLong = false
then begin
   value9 = Low + iTrailing ;
   If value9 < xTrail
      then xTrail = value9 ;
   if close >= xTrail
      then tAlert  = "Short Stop Hit";
end;
    

{ Alert }

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


{ PLOT }



Plot1( xTrail , "Stop Price", fg1 ) ;
SetPlotBGColor( 1, bg1);

Plot2( xPrice , "Entry Price", fg2 ) ;
SetPlotBGColor( 2, bg2);
end ;



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


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


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

xELDateToString = ELDateToString(xStartDate);

CommentaryCl( "xStartDate: ",  xELDateToString  );
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.

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

zeller4
rank: 150+ posts
rank: 150+ posts
Posts: 152
Joined: Sat Jul 29, 2006 9:16 pm
Reputation: 0
Location: Geneva, FL
Gender: None specified

Re: TS /Esig Code

Postby zeller4 » Wed Aug 22, 2007 2:25 am

rebkwez wrote:Avery,

Would you be able to post the TS code so I can convert it to eSignal?

Thanks,
Elliot


Elliot,

please post the .efs when you're done.

Thanks,
Kirk

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


Return to “Tradestation indicators”