NexusFi: Find Your Edge


Home Menu

 





AGet XTL Candle


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one curleta with 4 posts (0 thanks)
    2. looks_two prouser with 2 posts (1 thanks)
    3. looks_3 cory with 1 posts (0 thanks)
    4. looks_4 amon with 1 posts (3 thanks)
    1. trending_up 3,725 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
Search this Thread

AGet XTL Candle

  #1 (permalink)
amon
Bucharest Romania
 
Posts: 5 since Oct 2014
Thanks Given: 0
Thanks Received: 22

XTL = eXpert Trend Locator. A beautiful code to identify the current trend.

Attached Files
Elite Membership required to download: AGet XTL Candle.txt
Reply With Quote
The following 3 users say Thank You to amon for this post:

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - April 2024
Feedback and Announcements
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
51 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
31 thanks

  #2 (permalink)
 curleta 
Olivos, Buenos Aires, _Argentina
 
Experience: Intermediate
Platform: ninjatrader
Trading: futures
Posts: 52 since Nov 2014
Thanks Given: 14
Thanks Received: 2


amon View Post
XTL = eXpert Trend Locator. A beautiful code to identify the current trend.

thanks ..

There is a version for NinjaTrader?

Reply With Quote
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


looks about the same as some other ninja trend indicators
Download AGet XTL Candle For Amibroker (AFL)

Reply With Quote
  #4 (permalink)
 curleta 
Olivos, Buenos Aires, _Argentina
 
Experience: Intermediate
Platform: ninjatrader
Trading: futures
Posts: 52 since Nov 2014
Thanks Given: 14
Thanks Received: 2


cory View Post
looks about the same as some other ninja trend indicators
Download AGet XTL Candle For Amibroker (AFL)


this version is for AmiBroker ..
just looking for NinjaTrader.

thanks

Reply With Quote
  #5 (permalink)
 curleta 
Olivos, Buenos Aires, _Argentina
 
Experience: Intermediate
Platform: ninjatrader
Trading: futures
Posts: 52 since Nov 2014
Thanks Given: 14
Thanks Received: 2

this is not the formula of XTL.
XTL has originally bars filled or unfilled.
this indicator does not serve as XTL.

thanks

Reply With Quote
  #6 (permalink)
 prouser 
Zurich/Switzerland
 
Posts: 79 since Oct 2014

Do you mean the candles fill?

Try this one

 
Code
_SECTION_BEGIN( "XTL" );
// https://nexusfi.com/amibroker/33770-aget-xtl-candle.html
// mod. by prouser
BKcolor = ParamColor( "Outer panel color ", colorBlack );
SetChartBkColor( BKcolor );
SetChartBkGradientFill( BKcolor, BKcolor, colorBlack, Null, Null );
SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );

GraphXSpace = 8;

tgt = 35;
a = CCI( 20 ) < -tgt;
b = CCI( 20 ) > tgt;
state = IIf( a > b, -1, IIf( a == b, 0, 1 ) );
statecolor1 = IIf( state == 0, GetChartBkColor(), 
              IIf( state == 1, colorDarkBlue, 
              IIf( state == -1, colorDarkRed, 0 ) ) );
statecolor2 = IIf( state == 0, GetChartBkColor(), 
              IIf( state == 1, colorBlue, 
              IIf( state == -1, colorRed, 0 ) ) );                         
//
//Plot(state, "", statecolor2, styleHistogram | styleOwnScale | styleNoLabel, Null, Null, 0, -10, 0 );
gps = GetPriceStyle();
SetBarFillColor( IIf( gps == styleCandle, statecolor1, statecolor2 ) );
Plot( C, "Close", statecolor2, styleNoTitle | GetPriceStyle(), Null, Null, xshift = 0, zshift = 0, width = -20 );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol %1.0f {{VALUES}}",
                       O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
_SECTION_END();

_SECTION_BEGIN( "SwingN&&R" );
//Franck LAMOTTE - 01/2010
n1 = Param( "n1", 3, 2, 4, 1 );
n2 = Param( "n2", 4, 3, 7, 1 );

//SWING FORMULA//
function HiLo_HL( no ) {
    res = HHV( H, no );
    sup = LLV( L, no );
    avd = IIf( C > Ref( res, -1 ), 1, IIf( C < Ref( sup, -1 ), -1, 0 ) );
    avn = ValueWhen( avd != 0, avd, 1 );
    tsl = IIf( avn == 1, sup, res );
    return tsl;
}
Plot( HiLo_HL( n1 ), "HiLo_HL", colorYellow, styleStaircase );
Buy = Cross( C, HiLo_HL( n1 ) ) AND H > Ref( H, -1 ) AND L > Ref( L, -1 );
Sell = Cross( HiLo_HL( n1 ), C );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

if( ParamToggle( "Shape System 1", "NO|YES", 0 ) ) {
    PlotShapes( shape, IIf( Buy, colorBrightGreen, colorRed ), 0, IIf( Buy, Low, High ) );
}
_SECTION_END();

_SECTION_BEGIN( "end 6&4" );
Type = ParamList( "Type", "Simple,Exponential,Double Exponential,Tripple Exponential,Wilders,Weighted" );
Periods = Param( "Periods", 6, 2, 300 );
Displacement = Param( "Displacement", 4, -50, 50 );

switch( type ) {
	case "Exponential":
		m1 = EMA( H, Periods );
		m2 = EMA( L, Periods );
		break;
	case "Double Exponential":
		m1 = DEMA( H, Periods );
		m2 = DEMA( L, Periods );
		break;
	case "Tripple Exponential":
		m1 = TEMA( H, Periods );
		m2 = TEMA( L, Periods );
		break;
	case "Wilders":
		m1 = Wilders( H, Periods );
		m2 = Wilders( L, Periods );
		break;
	case "Weighted":
		m1 = WMA( H, Periods );
		m2 = WMA( L, Periods );
		break;
	case "Simple":
	default:
		m1 = MA( H, Periods );
		m2 = MA( L, Periods );
		break;
}

Plot( m1, _DEFAULT_NAME(), ParamColor( "ColorTop", colorGreen ), ParamStyle( "Style" ), 0, 0, Displacement );
Plot( m2, _DEFAULT_NAME(), ParamColor( "ColorBottom", colorRed ), ParamStyle( "Style" ), 0, 0, Displacement );
PlotOHLC( m1, m1, m2, m2, "DMACloud", ParamColor( "ColorChannel", colorLightGrey ), styleCloud, Null, Null, Displacement, -10 );
// Uncomment line below to plot price if Indicator is not overlaid a Price chart
//Plot( C, "Close", colorBlack, styleCandle );
_SECTION_END();

_SECTION_BEGIN( "Pivots" );
Version( 5.90 );

ppl = ParamToggle( "Plot Pivot Levels", "OFF|ON", 1 );

/* This code calculates the previous days high, low and close */
Hi = TimeFrameGetPrice( "H", inDaily, -1 );
Lo = TimeFrameGetPrice( "L", inDaily, -1 );
C1 = TimeFrameGetPrice( "C", inDaily, -1 );

/* This code calculates Daily Piovts */
rg = ( Hi - Lo );
bp = ( Hi + Lo + C1 ) / 3;
r1 = ( bp * 2 ) - Lo;
s1 = ( bp * 2 ) - Hi;
r2 = bp + r1 - s1;
s2 = bp - r1 + s1;
r3 = bp + r2 - s1;
s3 = bp - r2 + s1;
r4 = bp + r2 - s2;
s4 = bp - r2 + s2;

if( ppl ) {	
	Plot( bp, "", colorBlue, styleLine | styleLine | styleNoRescale );
	Plot( s1, "", colorRed, styleLine | styleNoRescale );
	//Plot(s2,"",colorRed,styleLine|styleNoRescale);
	//Plot(s3,"",colorRed,styleLine|styleNoRescale);
	//Plot(s4,"",colorRed,styleLine|styleNoRescale);
	Plot( r1, "", colorGreen, styleLine | styleNoRescale );
	//Plot(r2,"",colorGreen,styleLine|styleNoRescale);
	//Plot(r3,"",colorGreen,styleLine|styleNoRescale);
	//Plot(r4,"",colorGreen,styleLine|styleNoRescale);
	PlotTextSetFont( StrFormat( "PP: %g", bp ), "Arial", 8, xshift = BarCount + 2, LastValue(bp), colorBlue, colorDefault, yshift = -4 );
	PlotText( StrFormat( "R1: %g", r1 ), xshift, LastValue(r1), colorGreen, colorDefault, yshift );
	PlotText( StrFormat( "S1: %g", s1 ), xshift, LastValue(s1), colorRed, colorDefault, yshift );
	//PlotText(StrFormat( R2: %g", bp ), xshift, LastValue(r2), colorGreen, colorDefault, yshift );
	//PlotText(StrFormat( S2: %g", bp ), xshift, LastValue(s2), colorRed, colorDefault, yshift );
	//PlotText(StrFormat( R3: %g", bp ), xshift, LastValue(r3), colorGreen, colorDefault, yshift );
	//PlotText(StrFormat( S3: %g", bp ), xshift, LastValue(s3), colorRed, colorDefault, yshift );
	////PlotText(StrFormat( R4: %g", bp ), xshift, LastValue(r4), colorGreen, colorDefault, yshift );
	//PlotText(StrFormat( S4: %g", bp ), xshift, LastValue(s4), colorRed, colorDefault, yshift );
}
_SECTION_END();

Reply With Quote
  #7 (permalink)
 curleta 
Olivos, Buenos Aires, _Argentina
 
Experience: Intermediate
Platform: ninjatrader
Trading: futures
Posts: 52 since Nov 2014
Thanks Given: 14
Thanks Received: 2


prouser View Post
Do you mean the candles fill?

Try this one

 
Code
_SECTION_BEGIN( "XTL" );
// https://nexusfi.com/amibroker/33770-aget-xtl-candle.html
// mod. by prouser
BKcolor = ParamColor( "Outer panel color ", colorBlack );
SetChartBkColor( BKcolor );
SetChartBkGradientFill( BKcolor, BKcolor, colorBlack, Null, Null );
SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );

GraphXSpace = 8;

tgt = 35;
a = CCI( 20 ) < -tgt;
b = CCI( 20 ) > tgt;
state = IIf( a > b, -1, IIf( a == b, 0, 1 ) );
statecolor1 = IIf( state == 0, GetChartBkColor(), 
              IIf( state == 1, colorDarkBlue, 
              IIf( state == -1, colorDarkRed, 0 ) ) );
statecolor2 = IIf( state == 0, GetChartBkColor(), 
              IIf( state == 1, colorBlue, 
              IIf( state == -1, colorRed, 0 ) ) );                         
//
//Plot(state, "", statecolor2, styleHistogram | styleOwnScale | styleNoLabel, Null, Null, 0, -10, 0 );
gps = GetPriceStyle();
SetBarFillColor( IIf( gps == styleCandle, statecolor1, statecolor2 ) );
Plot( C, "Close", statecolor2, styleNoTitle | GetPriceStyle(), Null, Null, xshift = 0, zshift = 0, width = -20 );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol %1.0f {{VALUES}}",
                       O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
_SECTION_END();

_SECTION_BEGIN( "SwingN&&R" );
//Franck LAMOTTE - 01/2010
n1 = Param( "n1", 3, 2, 4, 1 );
n2 = Param( "n2", 4, 3, 7, 1 );

//SWING FORMULA//
function HiLo_HL( no ) {
    res = HHV( H, no );
    sup = LLV( L, no );
    avd = IIf( C > Ref( res, -1 ), 1, IIf( C < Ref( sup, -1 ), -1, 0 ) );
    avn = ValueWhen( avd != 0, avd, 1 );
    tsl = IIf( avn == 1, sup, res );
    return tsl;
}
Plot( HiLo_HL( n1 ), "HiLo_HL", colorYellow, styleStaircase );
Buy = Cross( C, HiLo_HL( n1 ) ) AND H > Ref( H, -1 ) AND L > Ref( L, -1 );
Sell = Cross( HiLo_HL( n1 ), C );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

if( ParamToggle( "Shape System 1", "NO|YES", 0 ) ) {
    PlotShapes( shape, IIf( Buy, colorBrightGreen, colorRed ), 0, IIf( Buy, Low, High ) );
}
_SECTION_END();

_SECTION_BEGIN( "end 6&4" );
Type = ParamList( "Type", "Simple,Exponential,Double Exponential,Tripple Exponential,Wilders,Weighted" );
Periods = Param( "Periods", 6, 2, 300 );
Displacement = Param( "Displacement", 4, -50, 50 );

switch( type ) {
	case "Exponential":
		m1 = EMA( H, Periods );
		m2 = EMA( L, Periods );
		break;
	case "Double Exponential":
		m1 = DEMA( H, Periods );
		m2 = DEMA( L, Periods );
		break;
	case "Tripple Exponential":
		m1 = TEMA( H, Periods );
		m2 = TEMA( L, Periods );
		break;
	case "Wilders":
		m1 = Wilders( H, Periods );
		m2 = Wilders( L, Periods );
		break;
	case "Weighted":
		m1 = WMA( H, Periods );
		m2 = WMA( L, Periods );
		break;
	case "Simple":
	default:
		m1 = MA( H, Periods );
		m2 = MA( L, Periods );
		break;
}

Plot( m1, _DEFAULT_NAME(), ParamColor( "ColorTop", colorGreen ), ParamStyle( "Style" ), 0, 0, Displacement );
Plot( m2, _DEFAULT_NAME(), ParamColor( "ColorBottom", colorRed ), ParamStyle( "Style" ), 0, 0, Displacement );
PlotOHLC( m1, m1, m2, m2, "DMACloud", ParamColor( "ColorChannel", colorLightGrey ), styleCloud, Null, Null, Displacement, -10 );
// Uncomment line below to plot price if Indicator is not overlaid a Price chart
//Plot( C, "Close", colorBlack, styleCandle );
_SECTION_END();

_SECTION_BEGIN( "Pivots" );
Version( 5.90 );

ppl = ParamToggle( "Plot Pivot Levels", "OFF|ON", 1 );

/* This code calculates the previous days high, low and close */
Hi = TimeFrameGetPrice( "H", inDaily, -1 );
Lo = TimeFrameGetPrice( "L", inDaily, -1 );
C1 = TimeFrameGetPrice( "C", inDaily, -1 );

/* This code calculates Daily Piovts */
rg = ( Hi - Lo );
bp = ( Hi + Lo + C1 ) / 3;
r1 = ( bp * 2 ) - Lo;
s1 = ( bp * 2 ) - Hi;
r2 = bp + r1 - s1;
s2 = bp - r1 + s1;
r3 = bp + r2 - s1;
s3 = bp - r2 + s1;
r4 = bp + r2 - s2;
s4 = bp - r2 + s2;

if( ppl ) {	
	Plot( bp, "", colorBlue, styleLine | styleLine | styleNoRescale );
	Plot( s1, "", colorRed, styleLine | styleNoRescale );
	//Plot(s2,"",colorRed,styleLine|styleNoRescale);
	//Plot(s3,"",colorRed,styleLine|styleNoRescale);
	//Plot(s4,"",colorRed,styleLine|styleNoRescale);
	Plot( r1, "", colorGreen, styleLine | styleNoRescale );
	//Plot(r2,"",colorGreen,styleLine|styleNoRescale);
	//Plot(r3,"",colorGreen,styleLine|styleNoRescale);
	//Plot(r4,"",colorGreen,styleLine|styleNoRescale);
	PlotTextSetFont( StrFormat( "PP: %g", bp ), "Arial", 8, xshift = BarCount + 2, LastValue(bp), colorBlue, colorDefault, yshift = -4 );
	PlotText( StrFormat( "R1: %g", r1 ), xshift, LastValue(r1), colorGreen, colorDefault, yshift );
	PlotText( StrFormat( "S1: %g", s1 ), xshift, LastValue(s1), colorRed, colorDefault, yshift );
	//PlotText(StrFormat( R2: %g", bp ), xshift, LastValue(r2), colorGreen, colorDefault, yshift );
	//PlotText(StrFormat( S2: %g", bp ), xshift, LastValue(s2), colorRed, colorDefault, yshift );
	//PlotText(StrFormat( R3: %g", bp ), xshift, LastValue(r3), colorGreen, colorDefault, yshift );
	//PlotText(StrFormat( S3: %g", bp ), xshift, LastValue(s3), colorRed, colorDefault, yshift );
	////PlotText(StrFormat( R4: %g", bp ), xshift, LastValue(r4), colorGreen, colorDefault, yshift );
	//PlotText(StrFormat( S4: %g", bp ), xshift, LastValue(s4), colorRed, colorDefault, yshift );
}
_SECTION_END();

Hello, I need to NinjaTrader ..
You've tried it?

thanks

Reply With Quote
  #8 (permalink)
 prouser 
Zurich/Switzerland
 
Posts: 79 since Oct 2014

I don't use NT myself.
And to my knowledge it is AmiBroker section here.
You might try here https://nexusfi.com/ninjatrader/

Reply With Quote





Last Updated on May 6, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts