Page 1 of 1

candel lines

Posted: Tue Jun 16, 2009 5:32 pm
by werner
hi tro,

i have a candle line code for tradestation. but I like too set a change in color and style and maybe an alert on the lines, is this posible?

[/code]
inputs:
TLOpenColor( darkgreen) ,
TLHighColor( red) ,
TLLowColor( red) ,
TLCloseColor( Darkgreen) ,
Decimals( 2) ;

variables:
TextOpen( 0 ),
TextHigh( 0 ),
TextLow( 0 ),
TextClose( 0 ),
TLOpen( 0 ) ,
TLHigh( 0 ) ,
TLLow( 0 ) ,
TLClose( 0 ) ,
LeftDateTime( 0 ) ;

once begin
TextOpen = Text_New( Date, Time, Close, " " ) ;
TextHigh = Text_New( Date, Time, Close, " " ) ;
TextLow = Text_New( Date, Time, Close, " " ) ;
TextClose = Text_New( Date, Time, Close, " " ) ;
Text_SetStyle( TextOpen, 0, 1 ) ;
Text_SetStyle( TextHigh, 0, 1 ) ;
Text_SetStyle( TextLow, 0, 1 ) ;
Text_SetStyle( TextClose, 0, 1 ) ;
Text_SetColor( TextOpen, TLOpenColor ) ;
Text_SetColor( TextHigh, TLHighColor ) ;
Text_SetColor( TextLow, TLLowColor ) ;
Text_SetColor( TextClose, TLCloseColor ) ;
TLOpen = TL_New( Date[1], Time, Close, Date, Time, Close ) ;
TLHigh = TL_New( Date[1], Time, Close, Date, Time, Close ) ;
TLLow = TL_New( Date[1], Time, Close, Date, Time, Close ) ;
TLClose = TL_New( Date[1], Time, Close, Date, Time, Close ) ;
TL_SetExtRight( TLOpen, True ) ;
TL_SetExtRight( TLHigh, True ) ;
TL_SetExtRight( TLLow, True ) ;
TL_SetExtRight( TLClose, True ) ;
TL_SetExtLeft( TLOpen, True ) ;
TL_SetExtLeft( TLHigh, True ) ;
TL_SetExtLeft( TLLow, True ) ;
TL_SetExtLeft( TLClose, True ) ;
TL_SetColor( TLOpen, TLOpenColor ) ;
TL_SetColor( TLHigh, TLHighColor ) ;
TL_SetColor( TLLow, TLLowColor ) ;
TL_SetColor( TLClose, TLCloseColor ) ;
end ;


if BarStatus(1) = 2 then
begin
LeftDateTime = GetAppInfo( aiLeftDispDateTime ) ;
Text_SetLocation( TextOpen, JulianToDate( IntPortion( LeftDateTime ) ), MinutesToTime( FracPortion( LeftDateTime ) * 60 * 24 ), Open ) ;
Text_SetLocation( TextHigh, JulianToDate( IntPortion( LeftDateTime ) ), MinutesToTime( FracPortion( LeftDateTime ) * 60 * 24 ), High ) ;
Text_SetLocation( TextLow, JulianToDate( IntPortion( LeftDateTime ) ), MinutesToTime( FracPortion( LeftDateTime ) * 60 * 24 ), Low ) ;
Text_SetLocation( TextClose, JulianToDate( IntPortion( LeftDateTime ) ), MinutesToTime( FracPortion( LeftDateTime ) * 60 * 24 ), Close ) ;
Text_SetString( TextOpen, NumToStr( Open, Decimals ) ) ;
Text_SetString( TextHigh, NumToStr( High, Decimals ) ) ;
Text_SetString( TextLow, NumToStr( Low, Decimals ) ) ;
Text_SetString( TextClose, NumToStr( Close, Decimals ) ) ;
TL_SetEnd( TLOpen, Date, Time, Open ) ;
TL_SetEnd( TLHigh, Date, Time, High ) ;
TL_SetEnd( TLLow, Date, Time, Low ) ;
TL_SetEnd( TLClose, Date[1], Time[1], Close ) ;
TL_SetBegin( TLOpen, Date[1], Time[1], Open ) ;
TL_SetBegin( TLHigh, Date[1], Time[1], High ) ;
TL_SetBegin( TLLow, Date[1], Time[1], Low ) ;
TL_SetBegin( TLClose, Date[1], Time[1], Close ) ;
end ;

Posted: Sun Jun 21, 2009 7:03 pm
by koolbreeze
Werner,

Yes it is possible to make the changes you mentioned. I'm not clear if you are asking for the color and style to change dynamically on the chart or if you just want to change them once to your desired settings. You may have already figured out how to achieve the above modifications. If not please be more specific in what you are trying to accomplish. I'll try to help.

format settings

Posted: Wed Jun 24, 2009 2:06 pm
by werner
Hi koolbreez,

thanks for your interest.

the code that i send you, i can set only in de format-inputs.
And i also like to set the alerts ,style and the color in the format.

thanks in regards ,
werner

Posted: Wed Jun 24, 2009 4:07 pm
by koolbreeze
werner,

The code for the candle lines uses trendlines not plots. So you will have to edit the EL code to achieve the color and style changes you want.

I modified the code for you to do this. I placed comments in the area where you can modify these settings.

You would have to add the EL code for the alert. Not sure what your parameters are for the alert, more info needed.

I'm a novice EL programmer. Someone else may have a better way to achieve your goals. If not this should help you.

Posted: Mon Jul 06, 2009 1:49 pm
by werner
thanks koolbreeze