candel lines
Posted: Tue Jun 16, 2009 5:32 pm
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 ;
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 ;