Plot halfback

Questions about MultiCharts and user contributed studies.
paulc
Posts: 59
Joined: 26 Sep 2012
Has thanked: 13 times
Been thanked: 2 times

Plot halfback

Postby paulc » 05 Feb 2015

Hi,

I am trying to plot the halfback line (mid of high and low) of each bar and each day.

I have the halfback of each bar and the day halfback as a short line across each bar.

However I want the day halfback to be a continuous horizontal line across the days bars reflecting the latest value. Does anyone know how to do this? I can only find details on line width and not how to make the line stretch the daily bars.

I also only want the daily halfback to reference the session time and not the extended hours as well.

Thanks for any guidance.

Code: Select all

variables:
Barhalfback( 0 ),
barhigh( 0 ),
barlow( 0 ),
Dayhalfback( 0 );



barhigh = high;
if high > barhigh then barhigh = high;
barlow = low;
if low < barlow then barlow = low;
Barhalfback = (barhigh + barlow ) / 2;
Dayhalfback = (dailyhigh + dailylow) /2 ;




Plot1( Barhalfback, "Bar halfback", Yellow ) ;
Plot2( Dayhalfback, "Day halfback", Magenta ) ;

paulc
Posts: 59
Joined: 26 Sep 2012
Has thanked: 13 times
Been thanked: 2 times

Re: Plot halfback

Postby paulc » 05 Feb 2015

Ok so i realised the above could be much simpler. But i still have the issue on the daily halfback.

Code: Select all

variables:
Barhalfback( 0 ),
barhigh( 0 ),
barlow( 0 ),
Dayhalfback( 0 );


Dayhalfback = (dailyhigh + dailylow) /2 ;

Plot1( (high+low)/2, "Bar halfback", Yellow ) ;
Plot2( Dayhalfback, "Day halfback", Magenta ) ;

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Plot halfback

Postby TJ » 05 Feb 2015

Look up the following functions:

HighD
LowD




Look up the following keywords:

TL_NEW
TL_SetEnd
TL_SetBegin
TL_SetExtLeft
TL_SetExtRight




Google for one of the EasyLanguage manuals if you have never tried to draw Trendlines.

paulc
Posts: 59
Joined: 26 Sep 2012
Has thanked: 13 times
Been thanked: 2 times

Re: Plot halfback

Postby paulc » 05 Feb 2015

HighD is not in the wiki?

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Plot halfback

Postby TJ » 05 Feb 2015

HighD is not in the wiki?
No, it is a function, not a keyword.

Google is your best friend.

paulc
Posts: 59
Joined: 26 Sep 2012
Has thanked: 13 times
Been thanked: 2 times

Re: Plot halfback

Postby paulc » 12 Feb 2015

For those who wish to learn here is the link to google http://www.google.com

For those who just want the answer:

Code: Select all

variables:
Dayhalfback( 0 );


Dayhalfback = (HighD(0) + LowD(0)) /2 ;

Plot1( (high+low)/2, "Bar halfback", Yellow ) ;
Plot2( Dayhalfback, "Day halfback", Magenta ) ;


Return to “MultiCharts”