Help: Calculating trend channels

 

Hi,

I am trying to program a channel line. The exact trend line channel you can draw on the metatrader chart.

I would like to have that trend line available programatically and signal a sell if the trend channel price falls below the trend line.

Any simple ways this is done or hints on how to program this?

Any help is appreciated!

Thanks in advance

 
kourvoisier wrote >>

Hi,

I am trying to program a channel line. The exact trend line channel you can draw on the metatrader chart.

I would like to have that trend line available programatically and signal a sell if the trend channel price falls below the trend line.

Any simple ways this is done or hints on how to program this?

Any help is appreciated!

Thanks in advance

I you want to place the trend line manually it is easy. You can find it from the code by looking for its unique name.

manual - draw the line

set the name

ea - check for object with the name

change the color - line accepted

check ObjGetvaluebyShift

if price below value open trade

if success delete line...

 
marynarz15 wrote >>

I you want to place the trend line manually it is easy. You can find it from the code by looking for its unique name.

manual - draw the line

set the name

ea - check for object with the name

change the color - line accepted

check ObjGetvaluebyShift

if price below value open trade

if success delete line...

Hi marynarz thanx for the response but I would actually like to draw the line programatically and not manually.

is that possible?

if so can point in the right direction in doing this.

 

Hello kourvoisier

.

Have look at Object Functions in ed's help.

eg, can create various object types, channels and trendlines,...

you can findout price relationship via objectgetshiftbyvalue or objectgetvaluebyshift

.

Have you looked at Articles and or the 'book' yet?

Much is there.

a simple search on 'objects' brings up many hits into book, docs, forum, articles, codebase...

The search bar is your friend - learn to use and much will be found.

.

regards

 
awesome... thanks alot.

i used the moveobject.mq4 example to draw my trend channel but i run into this issue.

the trend channel has 3 lines wieh i use the objectgetvaluebyshift i get the middle line but i cant seem to figure how to access the top or bottom line?

any additional help is appreciated.

Reason: