Simple Trend Line Break

 
 

you'd better post a picture of what are you trying to create.

 

Just your basic Trendline Break

Except I don't want auto trading, just to be alerted when trendline is touched or broken.

Picture borrowed from ykimyego https://www.mql5.com/en/forum/173123

Thanks ykimyego

Files:
 

If you draw TLs manualy on a price chart then you may set up standard MT alerts on correspondent levels and adjust them again by hand.

If you want an automatic TLs drawing then you have to define the way they will appear on the chart. It can be either fractals or DeMark points.

Have no idea how to set alerts on TLs drawn on indicator.

Jacob must be more competent on this issue

 
 

From Metaquotes forum

This was taken from the Metaquotes forum. It doesn't give the exact details, but hopefully somebody can take the info and create "something" out of it.

QUESTION:

How Can I: alert when price cross a drawn trendline?

Hello

Is it possible to create an alert to jump out when a price cross a previously drawn trend line?

What I mean is: I have a pattern and appropriate trendline already existing on the chart. I'd like to be alerted when this trendline is broken. Is it possible? How or any hints about?

If I get subsequent high/lows to draw a line it won't be streight, but rather zig-zag. I want 1st to drow the streight line and then ti lock for a break. I hope I've explained clear the idea . . .

Thank you

Ivo

RESPONSE:

Martin Cooney

Ivo,

I have an expert which does essentially this. To be able to query the trendline though, I've had to ensure each different trendline has a specific label.

price_top=NormalizeDouble(ObjectGetValueByShift("TrendlineTop", 1),MarketInfo(Symbol(),MODE_DIGITS))

The trendline in this case has the name "TrendlineTop"

Hope this helps you out - certainly works for me.

Cheers

Martin

Hope this helps. Here's the direct link: http://www.metaquotes.net/forum/493/

 

Thank you very much

For your time and effort.

I'll have to dissect the line and figure out how to adapt it to my needs. I guess there is no easy way around learning code but thanks to codersguru it can be done. I was just lazy to spend the time. You have given me a place to start and thats good enough.

Thank you.

 
 

hmmmm

heres my kama

or should I rephrase that to the copy I have of KaufmanI dont use it

hope this helps

Files:
kaufman2.mq4  4 kb
 

trend line help

Hi guys,

I'm really new to coding/scripting in general so i'm going to have lots of noob questions *bear with me please!*

in any case. I was trying to create a simple "indicator". I was trying to write an expert advisor to identify trend line points (you need two points for trend lines)

pls correct me if i'm wrong here:

1. if say i wanted to two highest highs from the last 100 bars. do i assign all the highs from 100 bars and do a sort on the array values?

2. is it possible to keep drawing trend lines from the 2 highest highs (for example). bearing in mind i'm trying to keep only one trend line on the main window at all times. meaning i have to delete the old one. also that means i have to draw a trend line by defining to variables as the 2 defined coordinates, is that even possible?

i will appreciate any help at all on that matter because i've only just picked up mql a couple of weeks ago. so i'm quite sure everyone else is more experienced than me haha.

thanks in advance everyone.

Regards,

Joseph aka Mr. Writer

 

Good avatar

Reason: