cvax, very cool work that you have done!
thank you very much.
airball
ps
i hope that ed gets a look at this. he was the one who first told me about the power of ninjatrader w/its superdom.
TRO Indicators for NinjaTrader
Moderator: moderators
- Gert Frobe
- rank: 150+ posts
- Posts: 177
- Joined: Fri Jun 30, 2006 9:51 pm
- Reputation: 0
- Location: Arlington, Texas
- Real name: ben arata
- Gender:
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
Not a problem. Watch out for the DynamicSRs and FibsSRs. At the moment they aren't plotting like TRO's. I will be uploading a new version that should fix the issues soon.
I also wanted to convert the latest version of Dynamic Fibs SR, but TRO isn't responding to my request for the code. Perhaps if you have TradeStation you could help me out by copy pasting the code? Thanks
I also wanted to convert the latest version of Dynamic Fibs SR, but TRO isn't responding to my request for the code. Perhaps if you have TradeStation you could help me out by copy pasting the code? Thanks
-
- rank: 150+ posts
- Posts: 152
- Joined: Sat Jul 29, 2006 9:16 pm
- Reputation: 0
- Location: Geneva, FL
- Gender:
TS code from TRO's other thread
cvax,
This was in another thread...
This was in another thread...
TheRumpledOne wrote: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(false),
iPlotSR(true),
iPlotTrade(false),
iPlotStop(true),
iEntryOffset(.01),
iStopOffset(.01),
iPrice( Close ),
iDecimals(2),
iPeriods(3),
// 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),
iShortStopColor(yellow),
iShortEntryColor(magenta),
iLongStopColor(yellow),
iLongEntryColor(cyan),
idummy("");
variables:
xLastTouch("S") ,
xShortStop(0),
xShortEntry(0),
xLongStop(0),
xLongEntry(0),
fg8(white),
bg8(black),
fg11(white),
bg11(black),
fg12(white),
bg12(black),
fg13(white),
bg13(black),
fg14(white),
bg14(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 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]... }
xShortStop = Dynamic_R + iStopOffset ;
xLongStop = Dynamic_S - iStopOffset ;
{ Alert criteria }
If high >= Dynamic_R
then begin
Fg8 = red;
Bg8 = white;
tAlert = "Price touched Resistance" ;
xShortEntry = low - iEntryOffset ;
end
else
If Low <= Dynamic_S
then begin
Fg8 = blue;
Bg8 = white;
tAlert = "Price touched Support" ;
xLongEntry = high + iEntryOffset ;
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[1]
and Close[1] > Low[1]
then Plot9 (Dynamic_S[1] , "go long", white ) ;
if High[1] = Dynamic_R[1]
and Close[1] < High[1]
then Plot10 (Dynamic_R[1] , "go short", white ) ;
end ; // iPlotTrade
end; // If date >= xStartDate
if iPlotStop
then begin
if low = Dynamic_S
then xLastTouch = "S"
else if high = Dynamic_R
then xLastTouch = "R" ;
If xLastTouch = "S"
and Dynamic_S = Dynamic_S[1]
then begin
FG14 = iLongEntryColor ; // long entry
FG12 = iLongStopColor ; // long stop
FG13 = black ; // short entry
FG11 = black ; // short stop
NoPlot(11) ;
Plot12 (xLongStop , "long stop", FG12 ) ;
NoPlot(13) ;
Plot14 (xLongEntry , "long entry", FG14 ) ;
end
else
if xLastTouch = "R"
and Dynamic_R = Dynamic_R[1]
then begin
FG14 = black ; // long entry
FG12 = black ; // long stop
FG13 = iShortEntryColor; // short entry
FG11 = iShortStopColor ; // short stop
Plot11 (xShortStop , "short stop", FG11 ) ;
NoPlot(12) ;
Plot13 (xShortEntry , "short entry", FG13 ) ;
NoPlot(14) ;
end;
end ; // iPlotStop
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) );
CommentaryCl( "Open[1]: ", NumToStr(Open[1] , iDecimals) );
CommentaryCl( "High[1]: ", NumToStr( High[1] , iDecimals) );
CommentaryCl( "Low[1]: ", NumToStr( Low[1] , iDecimals) );
CommentaryCl( "Close[1]: ", NumToStr( Close[1] , iDecimals) );
Yes zeller4. I am well aware of that version, but I am not looking for the TRO Dynamic Fibs SR - ENHANCEMENT code. I am looking for his latest TRO DYNAMIC FIBS SR2 - NEW code, the one with SR2U and SR2L. (http://kreslik.com/forums/viewtopic.php?t=848)
Thanks for the help though. It is appreciated. This would be so much easier if people could just view ELDs for free like they could EFSes.
Thanks for the help though. It is appreciated. This would be so much easier if people could just view ELDs for free like they could EFSes.
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
- Gert Frobe
- rank: 150+ posts
- Posts: 177
- Joined: Fri Jun 30, 2006 9:51 pm
- Reputation: 0
- Location: Arlington, Texas
- Real name: ben arata
- Gender:
- Gert Frobe
- rank: 150+ posts
- Posts: 177
- Joined: Fri Jun 30, 2006 9:51 pm
- Reputation: 0
- Location: Arlington, Texas
- Real name: ben arata
- Gender:
{ _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) );
DeleteReplyForwardSpamMove...
{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) );
DeleteReplyForwardSpamMove...
- Gert Frobe
- rank: 150+ posts
- Posts: 177
- Joined: Fri Jun 30, 2006 9:51 pm
- Reputation: 0
- Location: Arlington, Texas
- Real name: ben arata
- Gender:
1st one :
{ _TRO_DynamicFibsSR2L - Dynamic SR PMSM trade trigger }
{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.}
{Expressed in words, if the high of the current bar is equal to the highest high of the last iPeriods,
set the dynamic high to the current high;
otherwise just leave the dynamic high at whatever value it was before this bar.
Similarly for dynamic support.
The test of Dynamic_R equal to zero is there only to initialize dynamic support
and resistance at the left edge of the chart.
}
inputs:
iAlert(false),
iStartDate(1070101), // if not intraday, date to start counting
iPlotFibs(true),
iPlotSR(true),
iPlotTrade(false),
iPlotStop(true),
iEntryOffset(0),
iStopOffset(0),
iSROffset(.01),
iMaxStop(0),
iPrice( Close),
iDecimals(2),
iPeriods(5),
// iHigh( HighD(0) ),
// iLow( LowD(0) ),
iFibPlot("R"), // "P" = projections, "R" = retracements
iFib1(.24),
iFib2(.38),
iFib3(.5),
iFib4(.62),
iFib5(.76),
iFib1Color(darkcyan),
iFib2Color(darkbrown),
iFib3Color(darkgray),
iFib4Color(darkbrown),
iFib5Color(darkcyan),
HighColor( red),
LowColor( blue),
iShortStopColor(yellow),
iShortEntryColor(magenta),
iLongStopColor(yellow),
iLongEntryColor(cyan),
idummy("");
variables:
xMaxShortStop(0),
xMaxLongStop(0),
xLastTouch("S") ,
xShortStop(0),
xShortEntry(0),
xLongStop(0),
xLongEntry(0),
fg8(white),
bg8(black),
fg1(white),
bg1(black),
fg2(white),
bg2(black),
fg3(white),
bg3(black),
fg4(white),
bg4(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 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]... }
xShortStop = Dynamic_R + iStopOffset ;
xLongStop = Dynamic_S - iStopOffset ;
{ Alert criteria }
If high >= Dynamic_R - iSROffset
then begin
xShortEntry = low - iEntryOffset ;
end;
If Low <= Dynamic_S + iSROffset
then begin
xLongEntry = high + iEntryOffset ;
end;
{ Alert }
if iAlert
and tAlert <> ""
//and tAlert <> tAlert[1]
then Alert( tAlert ) ;
end; // If date >= xStartDate
FG1 = darkgray ;
FG2 = darkgray ;
FG3 = darkgray ;
FG4 = darkgray ;
if low = Dynamic_S
then xLastTouch = "S"
else if high = Dynamic_R
then xLastTouch = "R" ;
xMaxShortStop = xShortStop - xShortEntry ;
xMaxLongStop = xLongEntry - xLongStop ;
If xLastTouch = "S"
then begin
FG3 = black ;
FG4 = black ;
if ( iMaxStop > xMaxLongStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
if high >= xLongEntry[1]
and low <= xLongEntry[1]
and close >= open
then FG1 = iLongEntryColor ; // long entry
if high >= xLongStop[1]
and low <= xLongStop[1]
then FG2 = iLongStopColor ; // long stop
end;
end;
if xLastTouch = "R"
then begin
FG1 = black ;
FG2 = black ;
if ( iMaxStop > xMaxShortStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
if high >= xShortEntry[1]
and low <= xShortEntry[1]
and close <= open
then FG3 = iShortEntryColor; // short entry
if high >= xShortStop[1]
and low <= xShortStop[1]
then FG4 = iShortStopColor ; // short stop
end;
end;
Plot1 (1 , "long entry", FG1 ) ;
Plot2 (.5 , "long stop", FG2 ) ;
Plot3 (-.5 , "short entry", FG3 ) ;
Plot4 (-1 , "short stop", FG4 ) ;
CommentaryCl( "Dynamic_R: ", NumToStr( Dynamic_R , iDecimals) );
CommentaryCl( "Dynamic_S: ", NumToStr( Dynamic_S , iDecimals) );
CommentaryCl( "Open[1]: ", NumToStr(Open[1] , iDecimals) );
CommentaryCl( "High[1]: ", NumToStr( High[1] , iDecimals) );
CommentaryCl( "Low[1]: ", NumToStr( Low[1] , iDecimals) );
CommentaryCl( "Close[1]: ", NumToStr( Close[1] , iDecimals) );
CommentaryCl( " " );
CommentaryCl( "High: ", NumToStr( High , iDecimals) );
CommentaryCl( "Low: ", NumToStr( Low , iDecimals) );
CommentaryCl( "iMaxStop: ", NumToStr( iMaxStop , iDecimals) );
CommentaryCl( "xLongEntry: ", NumToStr( xLongEntry , iDecimals) );
CommentaryCl( "xMaxLongStop: ", NumToStr( xMaxLongStop , iDecimals) );
CommentaryCl( "xShortEntry: ", NumToStr( xShortEntry , iDecimals) );
CommentaryCl( "xMaxShortStop: ", NumToStr( xMaxShortStop , iDecimals) );
2nd one:
{ _TRO_DynamicFibsSR2U - 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.}
{Expressed in words, if the high of the current bar is equal to the highest high of the last iPeriods,
set the dynamic high to the current high;
otherwise just leave the dynamic high at whatever value it was before this bar.
Similarly for dynamic support.
The test of Dynamic_R equal to zero is there only to initialize dynamic support
and resistance at the left edge of the chart.
}
inputs:
iAlert(false),
iStartDate(1070101), // if not intraday, date to start counting
iPlotFibs(true),
iPlotSR(true),
iPlotTrade(false),
iPlotStop(true),
iEntryOffset(0),
iStopOffset(0),
iSROffset(.01),
iMaxStop(0),
iPrice( Close),
iDecimals(2),
iPeriods(5),
// iHigh( HighD(0) ),
// iLow( LowD(0) ),
iFibPlot("R"), // "P" = projections, "R" = retracements
iFib1(.24),
iFib2(.38),
iFib3(.5),
iFib4(.62),
iFib5(.76),
iFib1Color(darkcyan),
iFib2Color(darkbrown),
iFib3Color(darkgray),
iFib4Color(darkbrown),
iFib5Color(darkcyan),
HighColor( red),
LowColor( blue),
iShortStopColor(yellow),
iShortEntryColor(magenta),
iLongStopColor(yellow),
iLongEntryColor(cyan),
idummy("");
variables:
xMaxShortStop(0),
xMaxLongStop(0),
xLastTouch("S") ,
xShortStop(0),
xShortEntry(0),
xLongStop(0),
xLongEntry(0),
fg8(white),
bg8(black),
fg11(white),
bg11(black),
fg12(white),
bg12(black),
fg13(white),
bg13(black),
fg14(white),
bg14(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 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]... }
xShortStop = Dynamic_R + iStopOffset ;
xLongStop = Dynamic_S - iStopOffset ;
{ Alert criteria }
If high >= Dynamic_R - iSROffset
then begin
Fg8 = red;
Bg8 = white;
tAlert = "Price touched Resistance" ;
xShortEntry = low - iEntryOffset ;
end;
If Low <= Dynamic_S + iSROffset
then begin
Fg8 = blue;
Bg8 = white;
tAlert = "Price touched Support" ;
xLongEntry = high + iEntryOffset ;
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[1]
and Close[1] > Low[1]
then Plot9 (Dynamic_S[1] , "go long", white ) ;
if High[1] = Dynamic_R[1]
and Close[1] < High[1]
then Plot10 (Dynamic_R[1] , "go short", white ) ;
end ; // iPlotTrade
}
end; // If date >= xStartDate
if iPlotStop
then begin
{
if low = Dynamic_S
then xLastTouch = "S"
else if high = Dynamic_R
then xLastTouch = "R" ;
If xLastTouch = "S"
//and Dynamic_S = Dynamic_S[1]
then begin
xMaxShortStop = xShortStop - xShortEntry ;
xMaxLongStop = xLongEntry - xLongStop ;
if ( iMaxStop > xMaxLongStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG14 = iLongEntryColor ; // long entry
FG12 = iLongStopColor ; // long stop
FG13 = black ; // short entry
FG11 = black ; // short stop
Plot12 (xLongStop , "long stop", FG12 ) ;
Plot14 (xLongEntry , "long entry", FG14 ) ;
end
else begin
NoPlot(12) ;
NoPlot(14) ;
end;
NoPlot(11) ;
NoPlot(13) ;
end;
if xLastTouch = "R"
//and Dynamic_R = Dynamic_R[1]
then begin
if ( iMaxStop > xMaxShortStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG14 = black ; // long entry
FG12 = black ; // long stop
FG13 = iShortEntryColor; // short entry
FG11 = iShortStopColor ; // short stop
Plot11 (xShortStop , "short stop", FG11 ) ;
Plot13 (xShortEntry , "short entry", FG13 ) ;
end
else begin
NoPlot(11) ;
NoPlot(13) ;
end;
NoPlot(12) ;
NoPlot(14) ;
end;
}
if low = Dynamic_S
then xLastTouch = "S"
else if high = Dynamic_R
then xLastTouch = "R" ;
xMaxShortStop = xShortStop - xShortEntry ;
xMaxLongStop = xLongEntry - xLongStop ;
If xLastTouch = "S"
then begin
if ( iMaxStop > xMaxLongStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG14 = iLongEntryColor ; // long entry
FG12 = iLongStopColor ; // long stop
Plot12 (xLongStop , "long stop", FG12 ) ;
Plot14 (xLongEntry , "long entry", FG14 ) ;
end;
end;
if xLastTouch = "R"
then begin
if ( iMaxStop > xMaxShortStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG13 = iShortEntryColor; // short entry
FG11 = iShortStopColor ; // short stop
Plot11 (xShortStop , "short stop", FG11 ) ;
Plot13 (xShortEntry , "short entry", FG13 ) ;
end;
end;
end ; // iPlotStop
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) );
CommentaryCl( "Open[1]: ", NumToStr(Open[1] , iDecimals) );
CommentaryCl( "High[1]: ", NumToStr( High[1] , iDecimals) );
CommentaryCl( "Low[1]: ", NumToStr( Low[1] , iDecimals) );
CommentaryCl( "Close[1]: ", NumToStr( Close[1] , iDecimals) );
CommentaryCl( " " );
CommentaryCl( "High: ", NumToStr( High , iDecimals) );
CommentaryCl( "Low: ", NumToStr( Low , iDecimals) );
CommentaryCl( "iMaxStop: ", NumToStr( iMaxStop , iDecimals) );
CommentaryCl( "xMaxLongStop: ", NumToStr( xMaxLongStop , iDecimals) );
CommentaryCl( "xMaxShortStop: ", NumToStr( xMaxShortStop , iDecimals) );
3rd one:
{ _TRO_DynamicFibsSR2L - Dynamic SR PMSM trade trigger }
{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.}
{Expressed in words, if the high of the current bar is equal to the highest high of the last iPeriods,
set the dynamic high to the current high;
otherwise just leave the dynamic high at whatever value it was before this bar.
Similarly for dynamic support.
The test of Dynamic_R equal to zero is there only to initialize dynamic support
and resistance at the left edge of the chart.
}
inputs:
iAlert(false),
iStartDate(1070101), // if not intraday, date to start counting
iPlotFibs(true),
iPlotSR(true),
iPlotTrade(false),
iPlotStop(true),
iEntryOffset(0),
iStopOffset(0),
iSROffset(.01),
iMaxStop(0),
iPrice( Close),
iDecimals(2),
iPeriods(5),
// iHigh( HighD(0) ),
// iLow( LowD(0) ),
iFibPlot("R"), // "P" = projections, "R" = retracements
iFib1(.24),
iFib2(.38),
iFib3(.5),
iFib4(.62),
iFib5(.76),
iFib1Color(darkcyan),
iFib2Color(darkbrown),
iFib3Color(darkgray),
iFib4Color(darkbrown),
iFib5Color(darkcyan),
HighColor( red),
LowColor( blue),
iShortStopColor(yellow),
iShortEntryColor(magenta),
iLongStopColor(yellow),
iLongEntryColor(cyan),
idummy("");
variables:
xMaxShortStop(0),
xMaxLongStop(0),
xLastTouch("S") ,
xShortStop(0),
xShortEntry(0),
xLongStop(0),
xLongEntry(0),
fg8(white),
bg8(black),
fg1(white),
bg1(black),
fg2(white),
bg2(black),
fg3(white),
bg3(black),
fg4(white),
bg4(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 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]... }
xShortStop = Dynamic_R + iStopOffset ;
xLongStop = Dynamic_S - iStopOffset ;
{ Alert criteria }
If high >= Dynamic_R - iSROffset
then begin
xShortEntry = low - iEntryOffset ;
end;
If Low <= Dynamic_S + iSROffset
then begin
xLongEntry = high + iEntryOffset ;
end;
{ Alert }
if iAlert
and tAlert <> ""
//and tAlert <> tAlert[1]
then Alert( tAlert ) ;
end; // If date >= xStartDate
FG1 = darkgray ;
FG2 = darkgray ;
FG3 = darkgray ;
FG4 = darkgray ;
if low = Dynamic_S
then xLastTouch = "S"
else if high = Dynamic_R
then xLastTouch = "R" ;
xMaxShortStop = xShortStop - xShortEntry ;
xMaxLongStop = xLongEntry - xLongStop ;
If xLastTouch = "S"
then begin
FG3 = black ;
FG4 = black ;
if ( iMaxStop > xMaxLongStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
if high >= xLongEntry[1]
and low <= xLongEntry[1]
and close >= open
then FG1 = iLongEntryColor ; // long entry
if high >= xLongStop[1]
and low <= xLongStop[1]
then FG2 = iLongStopColor ; // long stop
end;
end;
if xLastTouch = "R"
then begin
FG1 = black ;
FG2 = black ;
if ( iMaxStop > xMaxShortStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
if high >= xShortEntry[1]
and low <= xShortEntry[1]
and close <= open
then FG3 = iShortEntryColor; // short entry
if high >= xShortStop[1]
and low <= xShortStop[1]
then FG4 = iShortStopColor ; // short stop
end;
end;
Plot1 (1 , "long entry", FG1 ) ;
Plot2 (.5 , "long stop", FG2 ) ;
Plot3 (-.5 , "short entry", FG3 ) ;
Plot4 (-1 , "short stop", FG4 ) ;
CommentaryCl( "Dynamic_R: ", NumToStr( Dynamic_R , iDecimals) );
CommentaryCl( "Dynamic_S: ", NumToStr( Dynamic_S , iDecimals) );
CommentaryCl( "Open[1]: ", NumToStr(Open[1] , iDecimals) );
CommentaryCl( "High[1]: ", NumToStr( High[1] , iDecimals) );
CommentaryCl( "Low[1]: ", NumToStr( Low[1] , iDecimals) );
CommentaryCl( "Close[1]: ", NumToStr( Close[1] , iDecimals) );
CommentaryCl( " " );
CommentaryCl( "High: ", NumToStr( High , iDecimals) );
CommentaryCl( "Low: ", NumToStr( Low , iDecimals) );
CommentaryCl( "iMaxStop: ", NumToStr( iMaxStop , iDecimals) );
CommentaryCl( "xLongEntry: ", NumToStr( xLongEntry , iDecimals) );
CommentaryCl( "xMaxLongStop: ", NumToStr( xMaxLongStop , iDecimals) );
CommentaryCl( "xShortEntry: ", NumToStr( xShortEntry , iDecimals) );
CommentaryCl( "xMaxShortStop: ", NumToStr( xMaxShortStop , iDecimals) );
2nd one:
{ _TRO_DynamicFibsSR2U - 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.}
{Expressed in words, if the high of the current bar is equal to the highest high of the last iPeriods,
set the dynamic high to the current high;
otherwise just leave the dynamic high at whatever value it was before this bar.
Similarly for dynamic support.
The test of Dynamic_R equal to zero is there only to initialize dynamic support
and resistance at the left edge of the chart.
}
inputs:
iAlert(false),
iStartDate(1070101), // if not intraday, date to start counting
iPlotFibs(true),
iPlotSR(true),
iPlotTrade(false),
iPlotStop(true),
iEntryOffset(0),
iStopOffset(0),
iSROffset(.01),
iMaxStop(0),
iPrice( Close),
iDecimals(2),
iPeriods(5),
// iHigh( HighD(0) ),
// iLow( LowD(0) ),
iFibPlot("R"), // "P" = projections, "R" = retracements
iFib1(.24),
iFib2(.38),
iFib3(.5),
iFib4(.62),
iFib5(.76),
iFib1Color(darkcyan),
iFib2Color(darkbrown),
iFib3Color(darkgray),
iFib4Color(darkbrown),
iFib5Color(darkcyan),
HighColor( red),
LowColor( blue),
iShortStopColor(yellow),
iShortEntryColor(magenta),
iLongStopColor(yellow),
iLongEntryColor(cyan),
idummy("");
variables:
xMaxShortStop(0),
xMaxLongStop(0),
xLastTouch("S") ,
xShortStop(0),
xShortEntry(0),
xLongStop(0),
xLongEntry(0),
fg8(white),
bg8(black),
fg11(white),
bg11(black),
fg12(white),
bg12(black),
fg13(white),
bg13(black),
fg14(white),
bg14(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 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]... }
xShortStop = Dynamic_R + iStopOffset ;
xLongStop = Dynamic_S - iStopOffset ;
{ Alert criteria }
If high >= Dynamic_R - iSROffset
then begin
Fg8 = red;
Bg8 = white;
tAlert = "Price touched Resistance" ;
xShortEntry = low - iEntryOffset ;
end;
If Low <= Dynamic_S + iSROffset
then begin
Fg8 = blue;
Bg8 = white;
tAlert = "Price touched Support" ;
xLongEntry = high + iEntryOffset ;
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[1]
and Close[1] > Low[1]
then Plot9 (Dynamic_S[1] , "go long", white ) ;
if High[1] = Dynamic_R[1]
and Close[1] < High[1]
then Plot10 (Dynamic_R[1] , "go short", white ) ;
end ; // iPlotTrade
}
end; // If date >= xStartDate
if iPlotStop
then begin
{
if low = Dynamic_S
then xLastTouch = "S"
else if high = Dynamic_R
then xLastTouch = "R" ;
If xLastTouch = "S"
//and Dynamic_S = Dynamic_S[1]
then begin
xMaxShortStop = xShortStop - xShortEntry ;
xMaxLongStop = xLongEntry - xLongStop ;
if ( iMaxStop > xMaxLongStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG14 = iLongEntryColor ; // long entry
FG12 = iLongStopColor ; // long stop
FG13 = black ; // short entry
FG11 = black ; // short stop
Plot12 (xLongStop , "long stop", FG12 ) ;
Plot14 (xLongEntry , "long entry", FG14 ) ;
end
else begin
NoPlot(12) ;
NoPlot(14) ;
end;
NoPlot(11) ;
NoPlot(13) ;
end;
if xLastTouch = "R"
//and Dynamic_R = Dynamic_R[1]
then begin
if ( iMaxStop > xMaxShortStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG14 = black ; // long entry
FG12 = black ; // long stop
FG13 = iShortEntryColor; // short entry
FG11 = iShortStopColor ; // short stop
Plot11 (xShortStop , "short stop", FG11 ) ;
Plot13 (xShortEntry , "short entry", FG13 ) ;
end
else begin
NoPlot(11) ;
NoPlot(13) ;
end;
NoPlot(12) ;
NoPlot(14) ;
end;
}
if low = Dynamic_S
then xLastTouch = "S"
else if high = Dynamic_R
then xLastTouch = "R" ;
xMaxShortStop = xShortStop - xShortEntry ;
xMaxLongStop = xLongEntry - xLongStop ;
If xLastTouch = "S"
then begin
if ( iMaxStop > xMaxLongStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG14 = iLongEntryColor ; // long entry
FG12 = iLongStopColor ; // long stop
Plot12 (xLongStop , "long stop", FG12 ) ;
Plot14 (xLongEntry , "long entry", FG14 ) ;
end;
end;
if xLastTouch = "R"
then begin
if ( iMaxStop > xMaxShortStop and iMaxStop <> 0 )
or iMaxStop = 0
then begin
FG13 = iShortEntryColor; // short entry
FG11 = iShortStopColor ; // short stop
Plot11 (xShortStop , "short stop", FG11 ) ;
Plot13 (xShortEntry , "short entry", FG13 ) ;
end;
end;
end ; // iPlotStop
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) );
CommentaryCl( "Open[1]: ", NumToStr(Open[1] , iDecimals) );
CommentaryCl( "High[1]: ", NumToStr( High[1] , iDecimals) );
CommentaryCl( "Low[1]: ", NumToStr( Low[1] , iDecimals) );
CommentaryCl( "Close[1]: ", NumToStr( Close[1] , iDecimals) );
CommentaryCl( " " );
CommentaryCl( "High: ", NumToStr( High , iDecimals) );
CommentaryCl( "Low: ", NumToStr( Low , iDecimals) );
CommentaryCl( "iMaxStop: ", NumToStr( iMaxStop , iDecimals) );
CommentaryCl( "xMaxLongStop: ", NumToStr( xMaxLongStop , iDecimals) );
CommentaryCl( "xMaxShortStop: ", NumToStr( xMaxShortStop , iDecimals) );
3rd one:
Re: Ninja
Thank you Gert Frobe. I really appreciate that. I will begin work on seeing what I can make from these new indicators for all of us soon.
Like you jstockman, I too am a bit disappointed in my purchase of NeoTicker. Creating indicators/strategies is not simple and straightforward like it is in NinjaTrader and their support is somewhat on the lacking side. From my experience, trying to get assistance in programming with their support is like pulling teeth. Their email support is slow and unresponsive. There have been times where I would make the same email request 3-4 times and finally get a reply after ~two weeks. Just about the only thing I use NeoTicker for now is the simulation feed into NinjaTrader because I do not have enough replay files for NinjaTrader, but after I record more there will come a time when I can completely ditch NeoTicker.
Anyways enough about my gripes with NeoTicker. I hope you find something suited for your needs jstockman. If you find any superb platform out there mind filling us in? Cheers.
jstockman wrote:cvax,
Nice work,
I justt took a look at Ninja and have downloaded it. I have not been very unhappy with Neoticker. It is just too complex and does not work as expected. I will be testing Ninja out.
jstockman
Like you jstockman, I too am a bit disappointed in my purchase of NeoTicker. Creating indicators/strategies is not simple and straightforward like it is in NinjaTrader and their support is somewhat on the lacking side. From my experience, trying to get assistance in programming with their support is like pulling teeth. Their email support is slow and unresponsive. There have been times where I would make the same email request 3-4 times and finally get a reply after ~two weeks. Just about the only thing I use NeoTicker for now is the simulation feed into NinjaTrader because I do not have enough replay files for NinjaTrader, but after I record more there will come a time when I can completely ditch NeoTicker.
Anyways enough about my gripes with NeoTicker. I hope you find something suited for your needs jstockman. If you find any superb platform out there mind filling us in? Cheers.
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.