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

    • CORZ Core Scientific stock watch, pull back to 14.04 support area with high trade quality at https://stockconsultant.com/?CORZ
    • SGHC Super Group stock watch, pullback to 6.17 support area with bullish indicators at https://stockconsultant.com/?SGHC
    • BOX stock, hold the 31.75 support area or breakdown? at https://stockconsultant.com/?BOX
    • Date: 2nd January 2025. The USD Retraces But Can The AUDUSD Correct To 0.62320?   The AUDUSD trades at a 27-month low as the Australian Dollar struggled to maintain momentum in December and the Dollar has risen since the US elections. However, the Australian Dollar is increasing in value during this morning’s Asian Session due to positive Chinese Manufacturing data. Will the AUDUSD hold its bullish momentum to the mean (0.62340) of the most recent price range? AUDUSD - The Australian Dollar continues to struggle for sustained momentum! The primary reason for the increase in the Australian Dollar is the positive Manufacturing Data from China. The performance of China is known to be closely linked to the performance of Asian currencies such as the JPY but also the AUD and NZD. The Australian Dollar is the best performing currency of the day and is increasing in value against all currencies except against the JPY where it moves sideways.   The US Dollar on the other hand is performing relatively poorly, and is retracing after yesterday’s gains. However, traders should note that the bearish price movement is relatively weak compared to the recent Dollar trend. The US Dollar Index rose in value for 4 consecutive weeks before retracing this morning. Therefore traders need to be cautious that the Dollar potentially may regain momentum. However, if the Dollar continues to decline a potential target may be seen at the average price of the previous range. The previous range formed between the 19th to the 30th December with an average price of 0.62320. The US Dollar Index reached its highest level since November 6th, 2022 Experts anticipate that Trump will reinforce protectionist policies, potentially reigniting active trade wars as he has done in the past. He previously announced plans to raise import tariffs on goods from China, Mexico, and Canada, while excluding European imports. Shifts in foreign trade are also expected to influence the US Federal Reserve's rhetoric. The December median interest rate forecasts indicate only two 25 basis point cuts in 2025, with any easing of policy not expected to begin before June. The hawkish Federal Reserve is able to support the US Dollar in the longer term and potentially tariffs may trigger a lower risk sentiment. The lower risk sentiment also may trigger a higher demand for the US Dollar. However, this would depend on the upcoming Trump policies. In the short-term, the US Dollar will also be influenced by this afternoon’s US Weekly Unemployment Claims release and the Final Manufacturing PMI. However, higher volatility is not likely to return until tomorrow’s trading sessions. AUDUSD - Technical Analysis In terms of technical analysis, the price of the AUDUSD is trading within a retracement of the day’s impulse wave. However, the price continues to remain at a lower high and lower low. In addition to this, the AUDUSD is also trading below the main Moving Averages and below the neutral level on most oscillators. Therefore, if bullish momentum is regained, traders potentially may focus on a correction to 0.62320 at first. If the price rises above 0.62142, the price will see stronger signals indicating a correction to this level.   Conclusion: The US Dollar Index rose to its highest price since November 6th 2022 before the markets closed for New Years Day. The Australian Dollar is the top-performing currency in this morning's Asian session, recovering from its decline in December. Positive Chinese Manufacturing data boosts Asian currencies including the AUD, NZD If the price rises above 0.62142, it will signal a stronger correction to this level. 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.
    • COCO Vita Coco stock, watch for a narrow range breakout above 37.18 at https://stockconsultant.com/?COCO
×
×
  • Create New...

Important Information

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