TRO_DYNAMIC_FIBSSR

post your indicators here

Moderator: moderators

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

TRO_DYNAMIC_FIBSSR

Postby TheRumpledOne » Thu Jul 19, 2007 11:05 pm

TRO_DYNAMIC_FIBSSR - ENHANCEMENT





I added an enhancement to TRO_DYNAMIC_FIBSSR.

The iPlotTrade input, when = TRUE, will place a white dot behind the dynamic support/resistance dots. This is your TRADE ENTRY TRIGGER!

Notice how many winners and the amount you could have made per share. Lots of "MILK" in that RIMM cow!!

ELD and Workspace attached.

I also included a surprise "treasure" showme indicator.
Attachments
STOCKS_AfterHours.tsw
(48 KiB) Downloaded 478 times
TRO_DYNAMIC_FIBSSR.ELD
(18.45 KiB) Downloaded 813 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.

cvax
rank: 50+ posts
rank: 50+ posts
Posts: 83
Joined: Sun May 13, 2007 12:45 am
Reputation: 0
Gender: None specified

Postby cvax » Fri Jul 20, 2007 12:58 am

Can you post the algorithm you are using to plot the iPlotTrade dots for us without Tradestation?

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

Postby TheRumpledOne » Fri Jul 20, 2007 1:09 am

Here's the code:


Code: Select all

{ _TRO_Dynamic_FibsSR - draw fibs between the Support/Resistance lines }
   
{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:

   iAlert(false),
   iStartDate(1070101),  // if not intraday, date to start counting
   iPlotFibs(true),
   iPlotSR(true),
   iPlotTrade(false),
   iPrice( Close ),
   iDecimals(2),
   iPeriods(5),
//   iHigh( HighD(0) ),
//   iLow( LowD(0) ),

   iFibPlot("R"),         // "P" = projections, "R" = retracements
iFib1(.24),
iFib2(.38),
iFib3(.50),
iFib4(.62),
iFib5(.76),
iFib1Color(darkcyan ),
iFib2Color(darkbrown),
iFib3Color(darkgray),
iFib4Color(darkbrown ),
iFib5Color(darkcyan  ),
   HighColor(  red),
   LowColor(  blue),

   idummy("");

variables:

fg8(white),
bg8(black),


xAppType(0),
sFirstPass(true),
 
tInd(""),
tAlert(""),

xFib1(iFib1),
xFib2(iFib2),
xFib3(iFib3),
xFib4(iFib4),
xFib5(iFib5),

tFib(""),

xLowestLow(0),
xHighestHigh(0),
xRange(0),

xPosition(0),
   
oExtremeVal( 0 ),
oExtremeBar( 0 ) ;


variables:

xBars( 0 ),
xPeriods(05),
xOldPeriods(0),

   Dynamic_R( 0 ),
   Dynamic_S( 0 ),
   OldDynamic_R( 0 ),
   OldDynamic_S( 0 ),
   PrevDynamic_R( 0 ),
   PrevDynamic_S( 0 ) ;


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



{first time through}

if sFirstPass
then begin
   
sFirstPass = false;


{ APP TYPE TEST }
 
sFirstPass = false;

xAppType = GetAppInfo(aiApplicationType);        // cUnknown = 0 cChart = 1  cRadarScreen = 2 cOptionStation = 3


end; {if sFirstPass}


{ INITIALIZE }


tInd   = "";
tAlert  = "";
      

{ CALCULATIONS }
         



If date this bar >= iStartDate
then begin

{save old values}
   
If Dynamic_R <> PrevDynamic_R
   then OldDynamic_R = PrevDynamic_R;
      
If Dynamic_S <> PrevDynamic_S
   then OldDynamic_S  = PrevDynamic_S ;
   
OldDynamic_R = PrevDynamic_R ;
OldDynamic_S = PrevDynamic_S ;

PrevDynamic_R = Dynamic_R ;
PrevDynamic_S = Dynamic_S ;



{ high / low for period }
   


xBars = xBars + 1;




oExtremeVal = Extremes( L, iPeriods, -1, Dynamic_S , oExtremeBar ) ; // lowest low

oExtremeVal = Extremes( H, iPeriods, 1, Dynamic_R , oExtremeBar ) ; // highest high



If Dynamic_R <> H
and Dynamic_R < PrevDynamic_R
   then if PrevDynamic_R <> 0
      then Dynamic_R = PrevDynamic_R;
   
If Dynamic_S <> L
and Dynamic_S > PrevDynamic_S       
   then if PrevDynamic_S <> 0
      then Dynamic_S = PrevDynamic_S;

{
If iLow <> iLow[1]
Or iHigh <> iHigh[1]
then begin
}
If iFibPlot = "R"
Or iFibPlot = "r"
then begin
 

xLowestLow =  Dynamic_S ;

xRange        = Dynamic_R -  Dynamic_S ;

xFib1      = iFib1 * xRange + xLowestLow;
xFib2      = iFib2 * xRange + xLowestLow;
xFib3      = iFib3 * xRange + xLowestLow;
xFib4      = iFib4 * xRange + xLowestLow;
xFib5      = iFib5 * xRange + xLowestLow;
end // If iFibPlot = "R"...
else Begin

// oExtremeVal = Extremes( iLow[iPeriods], iPeriods, -1, xLowestLow , oExtremeBar ) ; // lowest low

// oExtremeVal = Extremes( iHigh[iPeriods], iPeriods, 1, xHighestHigh , oExtremeBar ) ; // highest high

xLowestLow   = Dynamic_S ;

xHighestHigh = Dynamic_R ;

xRange        = xHighestHigh - xLowestLow;

If close > OpenD(0)
then begin
xFib1      = iFib1 * xRange + xHighestHigh;  // high projections
xFib2      = iFib2 * xRange + xHighestHigh;
xFib3      = iFib3 * xRange + xHighestHigh;
xFib4      = iFib4 * xRange + xHighestHigh;
xFib5      = iFib5 * xRange + xHighestHigh;
end
else begin
xFib1      = xLowestLow - iFib1 * xRange ;  // low projections
xFib2      = xLowestLow - iFib2 * xRange ;
xFib3      = xLowestLow - iFib3 * xRange ;
xFib4      = xLowestLow - iFib4 * xRange ;
xFib5      = xLowestLow - iFib5 * xRange ;
end;

end;

// end; { If iLow <> iLow[1]... }



{ Alert criteria }

If high >= Dynamic_R
then begin
   Fg8 = red;
   Bg8 = white;
   tAlert = "Price touched Resistance" ;
end
else
If Low   <= Dynamic_S
then begin
   Fg8 = blue;
   Bg8 = white;
   tAlert = "Price touched Support" ;
end;



{ Alert }

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


if iPlotFibs   
then begin
   
Plot1(xFib1 , "fib1", iFib1Color ) ;

Plot2(xFib2 , "fib2", iFib2Color ) ;

Plot3(xFib3 , "fib3", iFib3Color ) ;

Plot4(xFib4 , "fib4", iFib4Color ) ;

Plot5(xFib5 , "fib5", iFib5Color ) ;

end; // iPlotFibs

if iPlotSR   
then begin

Plot6(Dynamic_R , "Resistance",    HighColor ) ;

Plot7(Dynamic_S , "Support",   LowColor ) ;

end; // iPlotSR

if iPlotTrade
then begin
   if Low[1] = Dynamic_S
   and Close[1] > Low[1]
      then Plot9 (Dynamic_S , "go long",   white ) ;
   
   if High[1] = Dynamic_R
   and Close[1] < High[1]
      then Plot10 (Dynamic_R , "go short",   white ) ;
end ; // iPlotTrade

end; // If date >= xStartDate



               

if xAppType = 2   
then begin
   
if close = xFib1
   then SetPlotBGColor( 1, white );

if close = xFib2
   then SetPlotBGColor( 2, white );

if close = xFib3
   then SetPlotBGColor( 3, white );

if close = xFib4
   then SetPlotBGColor( 4, white );

if close = xFib5
   then SetPlotBGColor( 5, white );

if close = Dynamic_R
   then SetPlotBGColor( 6, white );

if close = Dynamic_S
   then SetPlotBGColor( 7, white );

   Plot8(tAlert , "Alert", yellow ) ;
end;

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

CommentaryCl( "Dynamic_S: ", NumToStr( Dynamic_S , iDecimals) );
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.

tradecrazy
rank: <50 posts
rank: <50 posts
Posts: 17
Joined: Sun Aug 13, 2006 6:26 am
Reputation: 0
Gender: Male

Postby tradecrazy » Fri Jul 20, 2007 2:10 am

Are you sure youare spleeling the file correctly? Is it TRO_DYNAMIC_FIBSSR or TRO_DYNAMIC_FIBSR with only 1 S?

tnx

cvax
rank: 50+ posts
rank: 50+ posts
Posts: 83
Joined: Sun May 13, 2007 12:45 am
Reputation: 0
Gender: None specified

Postby cvax » Fri Jul 20, 2007 9:34 am

If you only want to capture 10cents per stock


5cents per stock


just breakeven

This one tells us just 9% of trades will go sour instantly upon entry and never provide profit opportunities.

Wow there truly is tons of milk. Don't be too greedy and fill the milk jugs all day!
Last edited by cvax on Fri Jul 20, 2007 10:57 am, edited 1 time in total.

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

vittorio
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Thu Feb 15, 2007 4:09 pm
Reputation: 0
Location: Italy
Gender: Male

Postby vittorio » Fri Jul 20, 2007 10:19 am

If you only want to capture 10cents per stock


Hi,

What stop loss do you set in your statistic and
what is your entry level ?

cvax
rank: 50+ posts
rank: 50+ posts
Posts: 83
Joined: Sun May 13, 2007 12:45 am
Reputation: 0
Gender: None specified

Postby cvax » Fri Jul 20, 2007 10:34 am

No no. The stats I generated here are not that sophisticated. It is just a very simple win-to-total trades ratio and win is defined by how many trades hit your scalping target.

Basically the first case is if you required yourself to scalp at least $0.10 you would achieve this target 59% of the time. Lets just keep our analysis simple.

Long trades=3909
Percent Win=59.79% -> Win Trades=3909*59.79%=2337.1911
Percent Loss=40.21% -> Loss Trades=3909*40.21%=1571.8089
1000 sh per trade@$0.10 per share=$100
Stop@$0.10=-$100
2337.1911*$100+1571.8089*-$100=$76538.22
Cost basis=$234.20*1000=$234200
Margin 4:1 -> Equity=$58550
ROE=76538.22/58550=130.72% in one year. Actual returns will be much lower if you calculate in commissions but you get the idea. Also keep in mind that the % wins do not take into account real-time possibilities like your stop being hit before rebounding to hit your target. It just assumes if there was a runup that hit your target it was a winning trade.


Entry is the open of the bars with the dots.
Last edited by cvax on Fri Jul 20, 2007 10:50 am, edited 1 time in total.

vittorio
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Thu Feb 15, 2007 4:09 pm
Reputation: 0
Location: Italy
Gender: Male

Postby vittorio » Fri Jul 20, 2007 10:44 am

cvax wrote:
Entry is the open of the bars with the dots.


thank you .
Last edited by vittorio on Fri Jul 20, 2007 12:13 pm, edited 1 time in total.

cvax
rank: 50+ posts
rank: 50+ posts
Posts: 83
Joined: Sun May 13, 2007 12:45 am
Reputation: 0
Gender: None specified

Postby cvax » Fri Jul 20, 2007 10:52 am

The trigger was the bar before the bar with the dot. You should be prepared to enter on the bar with the dot before that bar starts building.

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

Postby TheRumpledOne » Fri Jul 20, 2007 12:58 pm

CVAX:

Rerun the calcs for only the FIRST HOUR of trading, and see what happens!

The real profit target is the 50% fib retrace level. The real stop loss is .01 above resistance or .01 below support.
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.


Return to “Tradestation indicators”