Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Tams

Trendline (EasyLanguage)

Recommended Posts

Thats odd AAA the code you posted should run once a day! It should not slow things down.

 

It's OK over 1 mn chart (5, 15 etc...)

 

Could you try on a 1 mn chart, wait 1 hour and resize the graph multiple times and let me know if it' OK ?

 

Multicharts rasterisation had always been snotbag slow,

 

I'm new with MC and it's true that resizing is not as fluent as other softwares

 

I use 2 screens 1920 x 1200 and I thought it was hard for GPU to manage all pixels

 

The best is that nevere ever I crashed MC eventho it turns 10 hours a day

Share this post


Link to post
Share on other sites

I've just status on the indicator

 

resizing 3 times with the mouse on the price scale and moved down 4 times with the pad

 

and now the screen is frozen during 10 seconds each time I move up or down

 

Now status off

 

And it's OK with a "normal" 1-2 seconds delay resizing

Share this post


Link to post
Share on other sites

I think that I've found

 

I recompile the indicator and now it's OK

 

May be the last compilation crashed ?

 

Anyway, thank you for your patience

Share this post


Link to post
Share on other sites

For those interested with problems with MC

 

(If I'm out of subject, please send me a private message and I will ask to the moderator to erase them)

 

I've made a 2 weeks ghost and now MC is quicker to redraw rasters/screen

 

As a detective I'm wondering if these upgrades programms since my ghost was guilty

 

IE8

Office2007 SP2

ATI driver

 

IE8 was in conflit with a soft

Office SP2 crashed badly and I had to reinstall from the CD

ATI drives the rasters...

 

Yesterday I had 280 Mo free space left on my C: with a 1 Mo pagefile

 

After "ghosting" I had 2.2 Go free space

 

What happened with the 1,92 Go ?

 

 

I am ghosting, (with a diary of EVERY changed done) since 8 years and it's a nice way to keep a computer safe and resolve problems.

 

I hope that I've helped with this message

Share this post


Link to post
Share on other sites

How to change the width of a trendline

 

 

TL_SetSize

 

Assigns the specified width to a trendline with the specified ID number;

returns a value of 0 if the line width was successfully assigned,

and a value of -2 if the specified trendline ID number is invalid.

 

 

Usage

 

TL_SetSize( TL_ID, LineWidth )

 

Where:

TL_ID - a numerical expression specifying the trendline ID number

LineWidth - a numerical expression specifying the trendline width;

trendline width can range from 0 to 6

 

 

Note

 

A trendline-specific ID number is returned by TL_New when the trendline is created.

 

 

Example

 

Assign the width of 5 to the trendline with an ID number of 3:

 

Value1 = TL_SetSize( 3, 5 );

Share this post


Link to post
Share on other sites

This example is from the Trendline Automatic indicator.

 

I have added user configurable trendline width.

The added code is highlighted by: {<--- added line}

 

Enjoy!

 

 

 

{ 
This indicator:
(1) INSERTS DnTL's/UpTL's connecting each new SwingHi/SwingLo with the next most 
   recent higher/lower SwingHi/SwingLo within the last 10 SwingHi's/SwingLo's; 
(2) EXTENDS each new TL to the right and SETS it's color and alert type; 
(3) TRUNCATES a DnTL/UpTL on the right when the next new DnTL/UpTL is drawn (if the 
   History input is set to "Yes"), or BarsPast bars after it has been breached, 
   whichever comes first.
(4) DELETES a DnTL/UpTL when the next new DnTL/UpTL is drawn, if the History input 
   is set to "No".

NOTE: This indicator may not work well with low-count tick bars, such as 10-tick bars, 
etc., because the time resolution of the bars may not be high enough for each bar to 
have a distinct time stamp.
}

inputs: 
SwHiStrength( 4 ), 
SwLoStrength( 4 ), 
BarsPast( 10 ), 
History( "Yes" ), 
DnTLColor( Red ), 
UpTLColor( Cyan ), 
AlertType( "IntraBar" ) ,

width(1); {<--- added line}

variables: 
DnTLRef( -1 ), 
DnTLEndBar( 0 ), 
DnTLBreak( false ), 
DnTLColorNum( DnTLColor ), 

UpTLRef( -1 ), 
UpTLEndBar( 0 ), 
UpTLBreak( false ), 
UpTLColorNum( UpTLColor ), 

Index( 0 ), 
BarNum( 0 ), 
HistoryTF( false ), 
AlertTypeCAPS( UpperStr( AlertType ) ) ;

arrays: 
SwHiDate[10]( 0 ), 
SwHiTime[10]( 0 ), 
SwHiVal[10]( -1000000 ), 
SwLoDate[10]( 0 ), 
SwLoTime[10]( 0 ), 
SwLoVal[10]( 1000000 ) ;

if CurrentBar = 1 then 
HistoryTF = UpperStr( History ) = "YES" or UpperStr( History ) = "Y" ;
{ should also be able to do this via declaration above }

BarNum = BarNumber ;

if SwingHighBar( 1, High, SwHiStrength, SwHiStrength + 1 ) = SwHiStrength then 
{ ie, if just confirmed SwHi }
begin

{ push arrays back }
for Value1 = 9 downto 0 
	begin
	SwHiDate[ Value1 + 1 ] = SwHiDate[Value1] ;
	SwHiTime[ Value1 + 1 ] = SwHiTime[Value1] ;
	SwHiVal[ Value1 + 1 ] = SwHiVal[Value1] ;
	end ;

{ read in parameters of new SwHi into 0-elements of arrays }
SwHiDate[0] = Date[swHiStrength] ;
SwHiTime[0] = Time[swHiStrength] ;
SwHiVal[0] = High[swHiStrength] ;

{ find and save the index of the next-most-recent higher SwHi if it exists }
for Value2 = 1 to 10 
	begin
	if SwHiVal[Value2] > SwHiVal[0] then 
		begin
		Index = Value2 ;
		Value2 = 11 ; { short circuit the looping with 11 instead of 10; the 11
		 will become 12 in the final pass }
		end ;
	end ;

if Value2 = 12 then { ie, if next-most-recent higher SwHi exists }
	begin
	if DnTLRef >= 0 then  { ie, if previous DnTL exists }
		begin
		if HistoryTF and DnTLBreak = false then 
			{ if history reqd and most recent DnTL not already truncated 
			  elsewhere, truncate it now }
			begin
			TL_SetEnd( DnTLRef, Date, Time, TL_GetValue( DnTLRef, Date, Time ) ) ;
			TL_SetExtRight( DnTLRef, false ) ;
			end
		else if HistoryTF = false then
			{ if history not reqd, delete most recent DnTL }
			TL_Delete( DnTLRef ) ;
		end ;
	{ draw new DnTL, reset break flag, save endbar, set extents/color/alert }
	DnTLRef = TL_New( SwHiDate[index], SwHiTime[index], SwHiVal[index], 
	 SwHiDate[0], SwHiTime[0], SwHiVal[0] ) ;

	TL_SetSize( DnTLRef, width ); {<--- added line}

	if DnTLBreak = true then 
		DnTLBreak = false ;
	DnTLEndBar = BarNum - SwHiStrength ;
	TL_SetExtLeft( DnTLRef, false ) ;
	TL_SetExtRight( DnTLRef, true ) ;
	if DnTLColorNum <> 99 then 
		TL_SetColor( DnTLRef, DnTLColorNum ) ;
	if AlertTypeCAPS = "ONCLOSE" then 
		TL_SetAlert( DnTLRef, 2 )
	else if AlertTypeCAPS = "INTRABAR" then 
		TL_SetAlert( DnTLRef, 1 )
	else
		TL_SetAlert( DnTLRef, 0 ) ;
	end ;
end ;

if SwingLowBar( 1, Low, SwLoStrength, SwLoStrength + 1 ) = SwLoStrength then 
{ ie, if just confirmed SwLo }
begin

{ push arrays back }
for Value1 = 9 downto 0 
	begin
	SwLoDate[Value1+1] = SwLoDate[Value1] ;
	SwLoTime[Value1+1] = SwLoTime[Value1] ;
	SwLoVal[Value1+1] = SwLoVal[Value1] ;
	end ;

{ read in parameters of new SwLo into 0-elements of arrays }
SwLoDate[0] = Date[swLoStrength] ;
SwLoTime[0] = Time[swLoStrength] ;
SwLoVal[0] = Low[swLoStrength] ;

{ find and save the index of the next-most-recent lower SwLo if it exists }
for Value2 = 1 to 10 
	begin
	if SwLoVal[Value2] < SwLoVal[0] then 
		begin
		Index = Value2 ;
		Value2 = 11 ;{ short circuit the looping with 11 instead of 10; the 11
		 will become 12 in the final pass }
		end ;
	end ;

if Value2 = 12 then  { ie, if next-most-recent lower SwLo exists }
	begin
	if UpTLRef >= 0 then { ie, if previous UpTL exists }
		begin
		if HistoryTF and UpTLBreak = false then 
			{ if history reqd and most recent UpTL not already truncated 
			  elsewhere, truncate it now }
			begin
			TL_SetEnd( UpTLRef, Date, Time, TL_GetValue( UpTLRef, Date, Time ) ) ;
			TL_SetExtRight( UpTLRef, false ) ;
			end
		else if HistoryTF = false then
			{ if history not reqd, delete most recent UpTL }
			TL_Delete( UpTLRef ) ;
		end ;
	{ draw new UpTL, reset break flag, save endbar, set extents/color/alert }
	UpTLRef = TL_New( SwLoDate[index], SwLoTime[index], SwLoVal[index], 
	 SwLoDate[0], SwLoTime[0], SwLoVal[0] ) ;

	TL_SetSize( UPTLRef, width ); {<--- added line}

	if UpTLBreak = true then
		UpTLBreak = false ;
	UpTLEndBar = BarNum - SwLoStrength ;
	TL_SetExtLeft( UpTLRef, false ) ;
	TL_SetExtRight( UpTLRef, true ) ;
	if UpTLColorNum <> 99 then 
		TL_SetColor( UpTLRef, UpTLColorNum ) ;
	if AlertTypeCAPS = "ONCLOSE" then 
		TL_SetAlert( UpTLRef, 2 )
	else if AlertTypeCAPS = "INTRABAR" then 
		TL_SetAlert( UpTLRef, 1 )
	else
		TL_SetAlert( UpTLRef, 0 ) ;
	end ;
end ;

{ if most recent DnTL/UpTL exists AND has not yet been truncated here AND was drawn 
 at least BarsPast ago AND was breached BarsPast bars ago THEN truncate it here and 
 set break flag }

if DnTLRef >= 0 
and DnTLBreak = false
and BarNum > DnTLEndBar + SwHiStrength + BarsPast 
and ( Close > TL_GetValue( DnTLRef, Date, Time ) )[barsPast]
then 
begin
TL_SetEnd( DnTLRef, Date, Time, TL_GetValue( DnTLRef, Date, Time ) ) ;
TL_SetExtRight( DnTLRef, false ) ;
DnTLBreak = true ;
end ;

if UpTLRef >= 0 
and UpTLBreak = false
and BarNum > UpTLEndBar + SwLoStrength + BarsPast 
and ( Close < TL_GetValue( UpTLRef, Date, Time ) )[barsPast]
then 
begin
TL_SetEnd( UpTLRef, Date, Time, TL_GetValue( UpTLRef, Date, Time ) ) ;
TL_SetExtRight( UpTLRef, false ) ;
UpTLBreak = true ;
end ;


{ ** Copyright (c) 1991-2003 TradeStation Technologies, Inc. All rights reserved. ** 
 ** TradeStation reserves the right to modify or overwrite this analysis technique 
    with each release. ** }

Share this post


Link to post
Share on other sites

Trend line related keywords

 

TL_SetAlert

 

TL_SetBegin

TL_SetEnd

 

TL_SetColor

 

TL_SetExtLeft

TL_SetExtRight

 

TL_SetSize

TL_SetStyle

 

 

.

Edited by Tams

Share this post


Link to post
Share on other sites

Hi all,

 

I am fairly new to the forum and I am appreciating all of the great solutions already posted here. I have spent quite a few hours working on a trendline study and I am at a place where I am stuck. Attached screenshot explains what I am attempting to do. I have placed horizontal trendlines on a chart based on the last 10 pivots (number of pivots is not relevant). Some of the pivots have been "taken out" by a higher high and are not relevant. I wish to retain and draw lines only on the relevant pivots.

 

What is the best way to accomplish this? I have tried - to write a formula comparing a new pivot to the previous 10, and adding a 2nd array that would store the relevant pivots. the 2nd method works OK, but requires the array to be cleared out each time a new value is added and I have no idea how to do that.

 

I appreciate any assistance on this and thanks in advance.

 

WT

5aa71030784dd_arraytrendlines.thumb.png.56aad3459c945b903db3c1edfddd973e.png

Share this post


Link to post
Share on other sites
didn't you ask this question before with another handle?

 

 

 

heh, not that i am aware of.

 

thanks for the tip. i will search more to see if that question has been asked before. my apologies if it has been duplicated.

Share this post


Link to post
Share on other sites
This example is from the Trendline Automatic indicator.

 

I have added user configurable trendline width.

The added code is highlighted by: {<--- added line}

 

Enjoy!

 

 

 

{ 
This indicator:
(1) INSERTS DnTL's/UpTL's connecting each new SwingHi/SwingLo with the next most 
   recent higher/lower SwingHi/SwingLo within the last 10 SwingHi's/SwingLo's; 
(2) EXTENDS each new TL to the right and SETS it's color and alert type; 
(3) TRUNCATES a DnTL/UpTL on the right when the next new DnTL/UpTL is drawn (if the 
   History input is set to "Yes"), or BarsPast bars after it has been breached, 
   whichever comes first.
(4) DELETES a DnTL/UpTL when the next new DnTL/UpTL is drawn, if the History input 
   is set to "No".

NOTE: This indicator may not work well with low-count tick bars, such as 10-tick bars, 
etc., because the time resolution of the bars may not be high enough for each bar to 
have a distinct time stamp.
}

inputs: 
SwHiStrength( 4 ), 
SwLoStrength( 4 ), 
BarsPast( 10 ), 
History( "Yes" ), 
DnTLColor( Red ), 
UpTLColor( Cyan ), 
AlertType( "IntraBar" ) ,

width(1); {<--- added line}

variables: 
DnTLRef( -1 ), 
DnTLEndBar( 0 ), 
DnTLBreak( false ), 
DnTLColorNum( DnTLColor ), 

UpTLRef( -1 ), 
UpTLEndBar( 0 ), 
UpTLBreak( false ), 
UpTLColorNum( UpTLColor ), 

Index( 0 ), 
BarNum( 0 ), 
HistoryTF( false ), 
AlertTypeCAPS( UpperStr( AlertType ) ) ;

arrays: 
SwHiDate[10]( 0 ), 
SwHiTime[10]( 0 ), 
SwHiVal[10]( -1000000 ), 
SwLoDate[10]( 0 ), 
SwLoTime[10]( 0 ), 
SwLoVal[10]( 1000000 ) ;

if CurrentBar = 1 then 
HistoryTF = UpperStr( History ) = "YES" or UpperStr( History ) = "Y" ;
{ should also be able to do this via declaration above }

BarNum = BarNumber ;

if SwingHighBar( 1, High, SwHiStrength, SwHiStrength + 1 ) = SwHiStrength then 
{ ie, if just confirmed SwHi }
begin

{ push arrays back }
for Value1 = 9 downto 0 
	begin
	SwHiDate[ Value1 + 1 ] = SwHiDate[Value1] ;
	SwHiTime[ Value1 + 1 ] = SwHiTime[Value1] ;
	SwHiVal[ Value1 + 1 ] = SwHiVal[Value1] ;
	end ;

{ read in parameters of new SwHi into 0-elements of arrays }
SwHiDate[0] = Date[swHiStrength] ;
SwHiTime[0] = Time[swHiStrength] ;
SwHiVal[0] = High[swHiStrength] ;

{ find and save the index of the next-most-recent higher SwHi if it exists }
for Value2 = 1 to 10 
	begin
	if SwHiVal[Value2] > SwHiVal[0] then 
		begin
		Index = Value2 ;
		Value2 = 11 ; { short circuit the looping with 11 instead of 10; the 11
		 will become 12 in the final pass }
		end ;
	end ;

if Value2 = 12 then { ie, if next-most-recent higher SwHi exists }
	begin
	if DnTLRef >= 0 then  { ie, if previous DnTL exists }
		begin
		if HistoryTF and DnTLBreak = false then 
			{ if history reqd and most recent DnTL not already truncated 
			  elsewhere, truncate it now }
			begin
			TL_SetEnd( DnTLRef, Date, Time, TL_GetValue( DnTLRef, Date, Time ) ) ;
			TL_SetExtRight( DnTLRef, false ) ;
			end
		else if HistoryTF = false then
			{ if history not reqd, delete most recent DnTL }
			TL_Delete( DnTLRef ) ;
		end ;
	{ draw new DnTL, reset break flag, save endbar, set extents/color/alert }
	DnTLRef = TL_New( SwHiDate[index], SwHiTime[index], SwHiVal[index], 
	 SwHiDate[0], SwHiTime[0], SwHiVal[0] ) ;

	TL_SetSize( DnTLRef, width ); {<--- added line}

	if DnTLBreak = true then 
		DnTLBreak = false ;
	DnTLEndBar = BarNum - SwHiStrength ;
	TL_SetExtLeft( DnTLRef, false ) ;
	TL_SetExtRight( DnTLRef, true ) ;
	if DnTLColorNum <> 99 then 
		TL_SetColor( DnTLRef, DnTLColorNum ) ;
	if AlertTypeCAPS = "ONCLOSE" then 
		TL_SetAlert( DnTLRef, 2 )
	else if AlertTypeCAPS = "INTRABAR" then 
		TL_SetAlert( DnTLRef, 1 )
	else
		TL_SetAlert( DnTLRef, 0 ) ;
	end ;
end ;

if SwingLowBar( 1, Low, SwLoStrength, SwLoStrength + 1 ) = SwLoStrength then 
{ ie, if just confirmed SwLo }
begin

{ push arrays back }
for Value1 = 9 downto 0 
	begin
	SwLoDate[Value1+1] = SwLoDate[Value1] ;
	SwLoTime[Value1+1] = SwLoTime[Value1] ;
	SwLoVal[Value1+1] = SwLoVal[Value1] ;
	end ;

{ read in parameters of new SwLo into 0-elements of arrays }
SwLoDate[0] = Date[swLoStrength] ;
SwLoTime[0] = Time[swLoStrength] ;
SwLoVal[0] = Low[swLoStrength] ;

{ find and save the index of the next-most-recent lower SwLo if it exists }
for Value2 = 1 to 10 
	begin
	if SwLoVal[Value2] < SwLoVal[0] then 
		begin
		Index = Value2 ;
		Value2 = 11 ;{ short circuit the looping with 11 instead of 10; the 11
		 will become 12 in the final pass }
		end ;
	end ;

if Value2 = 12 then  { ie, if next-most-recent lower SwLo exists }
	begin
	if UpTLRef >= 0 then { ie, if previous UpTL exists }
		begin
		if HistoryTF and UpTLBreak = false then 
			{ if history reqd and most recent UpTL not already truncated 
			  elsewhere, truncate it now }
			begin
			TL_SetEnd( UpTLRef, Date, Time, TL_GetValue( UpTLRef, Date, Time ) ) ;
			TL_SetExtRight( UpTLRef, false ) ;
			end
		else if HistoryTF = false then
			{ if history not reqd, delete most recent UpTL }
			TL_Delete( UpTLRef ) ;
		end ;
	{ draw new UpTL, reset break flag, save endbar, set extents/color/alert }
	UpTLRef = TL_New( SwLoDate[index], SwLoTime[index], SwLoVal[index], 
	 SwLoDate[0], SwLoTime[0], SwLoVal[0] ) ;

	TL_SetSize( UPTLRef, width ); {<--- added line}

	if UpTLBreak = true then
		UpTLBreak = false ;
	UpTLEndBar = BarNum - SwLoStrength ;
	TL_SetExtLeft( UpTLRef, false ) ;
	TL_SetExtRight( UpTLRef, true ) ;
	if UpTLColorNum <> 99 then 
		TL_SetColor( UpTLRef, UpTLColorNum ) ;
	if AlertTypeCAPS = "ONCLOSE" then 
		TL_SetAlert( UpTLRef, 2 )
	else if AlertTypeCAPS = "INTRABAR" then 
		TL_SetAlert( UpTLRef, 1 )
	else
		TL_SetAlert( UpTLRef, 0 ) ;
	end ;
end ;

{ if most recent DnTL/UpTL exists AND has not yet been truncated here AND was drawn 
 at least BarsPast ago AND was breached BarsPast bars ago THEN truncate it here and 
 set break flag }

if DnTLRef >= 0 
and DnTLBreak = false
and BarNum > DnTLEndBar + SwHiStrength + BarsPast 
and ( Close > TL_GetValue( DnTLRef, Date, Time ) )[barsPast]
then 
begin
TL_SetEnd( DnTLRef, Date, Time, TL_GetValue( DnTLRef, Date, Time ) ) ;
TL_SetExtRight( DnTLRef, false ) ;
DnTLBreak = true ;
end ;

if UpTLRef >= 0 
and UpTLBreak = false
and BarNum > UpTLEndBar + SwLoStrength + BarsPast 
and ( Close < TL_GetValue( UpTLRef, Date, Time ) )[barsPast]
then 
begin
TL_SetEnd( UpTLRef, Date, Time, TL_GetValue( UpTLRef, Date, Time ) ) ;
TL_SetExtRight( UpTLRef, false ) ;
UpTLBreak = true ;
end ;


{ ** Copyright (c) 1991-2003 TradeStation Technologies, Inc. All rights reserved. ** 
 ** TradeStation reserves the right to modify or overwrite this analysis technique 
    with each release. ** }

 

u are trying to sell something here

Share this post


Link to post
Share on other sites
...

What is the best way to accomplish this? I have tried - to write a formula comparing a new pivot to the previous 10, and adding a 2nd array that would store the relevant pivots. the 2nd method works OK, but requires the array to be cleared out each time a new value is added and I have no idea how to do that.

 

I appreciate any assistance on this and thanks in advance.

 

WT

 

this thread might help you on the array:

http://www.traderslaboratory.com/forums/f56/array-easylanguage-5785.html

 

 

14751d1257019257-array-easylanguage-2d_array.gif

 

14758d1257052126-array-easylanguage-array-address.jpg

Share this post


Link to post
Share on other sites
... the 2nd method works OK, but requires the array to be cleared out each time a new value is added and I have no idea how to do that.

...

 

try this idea:

 

// musical chair

if barstatus = 2 and condition1 = true then
begin
   arr[1,3] = arr[1,2];
   arr[1,2] = arr[1,1];
   arr[1,1] = variable1;
end;

Edited by Tams

Share this post


Link to post
Share on other sites

Here is a TradeStation help code example:

 

Variable: ID(-1);

If Low < Low[1] AND Close > High[1] Then Begin
 ID = TL_New(Date[1], Time[1], Low, Date, Time, Low);
 Value1 = TL_SetExtRight(ID, True);
End;

 

The above code adds multiple trendlines to my chart. Every time the conditions are met, a new trendline is added to the chart. Each trendline is extended all the way to the current right hand edge of the chart. The reserved word "TL_SetExtRight" causes the trendline to extend continuously from the starting point to the right.

 

So, this means that multiple trend lines can be created from one trendline variable. A trendline variable is not confined to only having one trendline.

Share this post


Link to post
Share on other sites

I add some code to label the line in the chart (from day 1 to day 4 from today ) but I find that some letters is missed after it is enabled. For example, d2H = day 2 high, it display d2 without H. After a while, it will show up all. Any idea?

 

 

===============================

 

input:

lookback( 4 ),

Line.size ( 1 ),

Line.style ( 2 ),

color.h1( blue ),

color.l1( blue ),

color.h2( red ),

color.l2( red ),

color.h3( darkgreen ),

color.l3( darkgreen ),

color.h4( cyan ),

color.l4( cyan ),

hori_txdisp(10); {horizontal distance}

 

vars: d1Htid(0), d1Ltid(0),

d2Htid(0), d2Ltid(0),

d3Htid(0), d3Ltid(0),

d4Htid(0), d4Ltid(0);

 

// 1

if date <> date[1] and lookback = 1 then begin

value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 ));

value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1));

 

tl_setcolor( value1, color.h1 );

TL_SetSize( value1, Line.size );

TL_SetStyle( value1, Line.style );

 

tl_setcolor( value2 , color.l1 );

TL_SetSize( value2, Line.size );

TL_SetStyle( value2, Line.style );

end;

 

if lookback = 1 then begin

tl_setend_s(value1, d , time_s , highd(1) );

tl_setend_s(value2, d , time_s , lowd(1) );

end;

 

// 2

if date <> date[1] and lookback = 2 then begin

value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 ));

value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1));

value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 ));

value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2));

 

tl_setcolor( value1, color.h1 );

TL_SetSize( value1, Line.size );

TL_SetStyle( value1, Line.style );

 

tl_setcolor( value2 , color.l1 );

TL_SetSize( value2, Line.size );

TL_SetStyle( value2, Line.style );

 

tl_setcolor( value3, color.h2 );

TL_SetSize( value3, Line.size );

TL_SetStyle( value3, Line.style );

 

tl_setcolor( value4 , color.l2 );

TL_SetSize( value4, Line.size );

TL_SetStyle( value4, Line.style );

end;

if lookback = 2 then begin

tl_setend_s(value1, d , time_s , highd(1) );

tl_setend_s(value2, d , time_s , lowd(1) );

tl_setend_s(value3, d , time_s , highd(2) );

tl_setend_s(value4, d , time_s , lowd(2) );

end;

 

// 3

if date <> date[1] and lookback = 3 then begin

value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 ));

value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1));

value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 ));

value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2));

value5 = tl_new_s(d , time_s , highd(3), d , time_s, highd(3 ));

value6 = tl_new_s(d , time_s, lowd(3), d , time_s, lowd(3 ));

 

tl_setcolor( value1, color.h1 );

TL_SetSize( value1, Line.size );

TL_SetStyle( value1, Line.style );

 

tl_setcolor( value2 , color.l1 );

TL_SetSize( value2, Line.size );

TL_SetStyle( value2, Line.style );

 

tl_setcolor( value3, color.h2 );

TL_SetSize( value3, Line.size );

TL_SetStyle( value3, Line.style );

 

tl_setcolor( value4 , color.l2 );

TL_SetSize( value4, Line.size );

TL_SetStyle( value4, Line.style );

 

tl_setcolor( value5, color.h3 );

TL_SetSize( value5, Line.size );

TL_SetStyle( value5, Line.style );

 

tl_setcolor( value6 , color.l3 );

TL_SetSize( value6, Line.size );

TL_SetStyle( value6, Line.style );

end;

 

if lookback = 3 then

begin

tl_setend_s(value1, d , time_s , highd(1) );

tl_setend_s(value2, d , time_s , lowd(1) );

tl_setend_s(value3, d , time_s , highd(2) );

tl_setend_s(value4, d , time_s , lowd(2) );

tl_setend_s(value5, d , time_s , highd(3) );

tl_setend_s(value6, d , time_s , lowd(3) );

 

if lastbaronchart then

begin

tl_setextright(value1, true);

tl_setextright(value2, true);

tl_setextright(value3, true );

tl_setextright(value4, true);

tl_setextright(value5, true);

tl_setextright(value6, true);

end;

end;

 

 

// 4

if date <> date[1] and lookback = 4 then begin

value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 ));

value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1));

value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 ));

value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2));

value5 = tl_new_s(d , time_s , highd(3), d , time_s, highd(3 ));

value6 = tl_new_s(d , time_s, lowd(3), d , time_s, lowd(3 ));

value7 = tl_new_s(d , time_s , highd(4), d , time_s, highd(4 ));

value8 = tl_new_s(d , time_s, lowd(4), d , time_s, lowd(4 ));

 

tl_setcolor( value1, color.h1 );

TL_SetSize( value1, Line.size );

TL_SetStyle( value1, Line.style );

//piv1tid = Text_New(date, Minlist(Time + hori_txdisp, SessionEndTime(0, 1) + hori_txdisp), highd(1) - (textscale * MinMove/PriceScale), "d1H");

d1Htid = Text_New(date, currenttime+hori_txdisp , highd(1), "d1H");

 

tl_setcolor( value2 , color.l1 );

TL_SetSize( value2, Line.size );

TL_SetStyle( value2, Line.style );

d1Ltid = Text_New(date, currenttime+hori_txdisp, lowd(1) , "d1L");

 

tl_setcolor( value3, color.h2 );

TL_SetSize( value3, Line.size );

TL_SetStyle( value3, Line.style );

d2Htid = Text_New(date, currenttime+hori_txdisp , highd(2), "d2H");

 

tl_setcolor( value4 , color.l2 );

TL_SetSize( value4, Line.size );

TL_SetStyle( value4, Line.style );

d2Ltid = Text_New(date, currenttime+hori_txdisp, lowd(2) , "d2L");

 

tl_setcolor( value5, color.h3 );

TL_SetSize( value5, Line.size );

TL_SetStyle( value5, Line.style );

d3Htid = Text_New(date, currenttime+hori_txdisp , highd(3), "d3H");

 

tl_setcolor( value6 , color.l3 );

TL_SetSize( value6, Line.size );

TL_SetStyle( value6, Line.style );

d3Ltid = Text_New(date, currenttime+hori_txdisp, lowd(3) , "d3L");

 

tl_setcolor( value7, color.h4 );

TL_SetSize( value7, Line.size );

TL_SetStyle( value7, Line.style );

d4Htid = Text_New(date, currenttime+hori_txdisp , highd(4), "d4H");

 

tl_setcolor( value8 , color.l4 );

TL_SetSize( value8, Line.size );

TL_SetStyle( value8, Line.style );

d4Ltid = Text_New(date, currenttime+hori_txdisp, lowd(4) , "d4L");

end;

 

if lookback = 4 then begin

tl_setend_s(value1, d , time_s , highd(1) );

tl_setend_s(value2, d , time_s , lowd(1) );

tl_setend_s(value3, d , time_s , highd(2) );

tl_setend_s(value4, d , time_s , lowd(2) );

tl_setend_s(value5, d , time_s , highd(3) );

tl_setend_s(value6, d , time_s , lowd(3) );

tl_setend_s(value7, d , time_s , highd(4) );

tl_setend_s(value8, d , time_s , lowd(4) );

end;

1.thumb.png.0ffb4c79e1848d62e88f5013b1d5ec4b.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • Date: 21st February 2025.   European PMI Disappoint, Weighing on Euro Before German Elections   The Euro is the first currency to witness the volatility on this month’s PMI reports. The French, German and British PMI data have resulted in the Euro being the worst-performing currency of the European Session so far. However, will the Euro continue to decline throughout the day? European Purchasing Managers’ Indexes The French Purchasing Managers Index was the first European index to be made public. The release resulted in the Euro instantly declining 0.24%. The main concern from the French data was the Services PMI which fell from 48.2 to 44.5. Previously the market was expecting the data to remain more or less unchanged. The weak data triggered the decline which came to a halt after Germany’s PMI was released.     The German Manufacturing PMI read 0.5 points higher than previous expectations and the Services PMI was 0.2 points lower. The data from Germany was a relief for Euro investors and the price rose 0.12% higher. However, traders should note that the price of the EURUSD continues to remain 0.20% lower than yesterday’s close. The price of the EURUSD will now depend on the PMI data from the US. The value of the US Dollar will depend on its PMI release this afternoon and the Consumer Sentiment Index. Analysts expect both the US Services and Manufacturing PMI data to remain above the 50.00 level in the expansion zone. German Elections 2 Days Away Germany is set to hold a general election this Sunday, February 23rd, following the collapse of the coalition of social democrats, liberals, and greens. Given the country's highly proportional electoral system, German polls provide a strong indication of potential government formations post-election. The main concern for Germany is the AFD party who are Far-Right Nationalists. Currently, ahead in the polls are CDU (centre-right), and AFD (far right), followed by the SPD (centre-left). Traders should note that the results of the elections are likely to trigger strong volatility on Monday, but also influence volatility today. Economists may become further concerned if the far-right gains power for the first time due to uncertainty. If the government, similar to France, is unable to form a coalition, this would also be a concern for the Eurozone. Furthermore, the Euro this week is also under pressure from comments from members of the European Central Bank. ECB Governing Council member Fabio Panetta said to journalists that officials need not slow interest rate cuts, as January's 2.5% inflation is still expected to reach the 2.0% target this year. He also advised the European economy is weaker than previously expected. EURUSD - Technical Analysis and Indicators The EURUSD is trading above the 75-bar Exponential Moving Average and 100-bar Simple Moving Average on the 2-hour chart. However, the price is moving away from the key resistance level at 1.05058 indicating the price is losing momentum. The short-term volatility is indicating the price is retracing downwards. On the 5-minute timeframe, the price is trading below the 200-bar SMA and is also forming clear lower lows and highs. Simultaneously, the US Dollar Index is trading above the 200-bar SMA on the 5-minute chart confirming no current conflicts. Currently, the US Dollar is the best-performing currency of the day attempting to regain losses from the past 2 weeks. Watch today’s Live Analysis Session for more signals as they develop!   Key Takeaway Points: Weak French Services PMI triggered an initial Euro decline, but German PMI provide a slight relief. However, EURUSD remains lower than yesterday’s close. The Euro’s direction now depends on the US PMI reports, with analysts expecting US data to stay in expansion territory. Sunday's German election could drive volatility, especially if the far-right AFD gains power or if coalition formation proves difficult. ECB official Fabio Panetta suggested no need to slow rate cuts, citing weaker-than-expected economic performance and expected inflation decline. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Michalis Efthymiou HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • BE Bloom Energy stock, watch for a range breakout, target 34 area at https://stockconsultant.com/?BE
    • APLD Applied Digital stock. nice rally, watch for a top of range breakout at https://stockconsultant.com/?APLD
    • UAL United Airlines stock, watch for a narrow range breakout, target 122 area at https://stockconsultant.com/?UAL
    • WBD Warner Bros Discovery stock, watch for a range breakout at https://stockconsultant.com/?WBD
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.