Programming Alert on Trendlines

 

Hi all,

I would like to introduce a breakout system that is based on triagle or flag patterns.

One has to put the lines manually on those patterns. And that is not a problem because once the lines installed around +/- 14.30cet they stay in place till 23.00cet.

Because they make triangles or flags , those lines are descending and ascending. They function as entrys (when price breaks true those lines. BUT they function also as stoploss).

Because they are descending and ascending lines the value continiously changes. So is there someone who can programm something or indicator that one can draw descending or ascending lines that one can put an alert on it so one gets warned when the price is breaking true that line so one knows when to enter or when price breaks true it and one needs to execute his stoploss.

With horizontal lines there is no problem because one can use the alert settings of the MT4.0 platform. But with ascending or descending lines one has to change these values after every bar. That is not reasonable if one has to this every day from 14.30cet till 23.00cet.

TNX in advance for the help.....iGoR

 

I have something at home that should work for you. It isnt quite finished yet but it still works. Ill post it tonight if no one gets to you first

 

Hey Igor, I forgot about you yesterday. Anyway I have one indicator and two EA. The indicator i found somewhere and modified it. It will draw two TL's one high one low. You have the option to have a median line which is a trendline, and 2 horizontal lines for a breakout. You have to put how many pips away in the name you want the alert to happen. Once the alert is triggerd, it will strip the # from the name and you have to put it back in again for it to alert again. Take a look at the code and you will understand. With the EAs, I havent used them, just have it laying around.

The next step for the trendlinealerter was to use the code below to replace the stripping of the # and put in some extern's for the price away but I havent gotten around to it, and dont know when i will. Maybe someone can jump in here and do the mod to it. Possibly you can, I dont know. The reason it strips is it would alert every tick change in price from the # away parameter. Thats why I wanted to modify it for one alert Per bar. Someone may know an easier way to do it as well.

I hope this is helpful for you, if only to understand how to achieve what you want to do.

bool AlertOnce(string alert_msg, int ref)

{

static int LastAlert_1 = 0;

static int LastAlert_2 = 0;

static int LastAlert_3 = 0;

static int LastAlert_4 = 0;

switch(ref)

{

case 1:

if( LastAlert_1 == 0 || LastAlert_1 < Bars )

{

Alert(alert_msg);

LastAlert_1 = Bars;

return (1);

}

break;

case 2:

if( LastAlert_2 == 0 || LastAlert_2 < Bars )

{

Alert(alert_msg);

LastAlert_2 = Bars;

return (1);

}

break;

case 3:

if( LastAlert_3 == 0 || LastAlert_3 < Bars )

{

Alert(alert_msg);

LastAlert_3 = Bars;

return (1);

}

break;

case 4:

if( LastAlert_4 == 0 || LastAlert_4 < Bars )

{

Alert(alert_msg);

LastAlert_4 = Bars;

return (1);

}

break;

}

}

bool SendMailOnce(string subject, string mail_msg, int ref)

{

static int LastMail_1 = 0;

static int LastMail_2 = 0;

static int LastMail_3 = 0;

static int LastMail_4 = 0;

switch(ref)

{

case 1:

if( LastMail_1 == 0 || LastMail_1 < Bars )

{

SendMail(subject,mail_msg);

LastMail_1 = Bars;

return (1);

}

break;

case 2:

if( LastMail_2 == 0 || LastMail_2 < Bars )

{

SendMail(subject,mail_msg);

LastMail_2 = Bars;

return (1);

}

break;

case 3:

if( LastMail_3 == 0 || LastMail_3 < Bars )

{

SendMail(subject,mail_msg);

LastMail_3 = Bars;

return (1);

}

break;

case 4:

if( LastMail_4 == 0 || LastMail_4 < Bars )

{

SendMail(subject,mail_msg);

LastMail_4 = Bars;

return (1);

}

break;

}

}

 
iGoR:
Hi all,

I would like to introduce a breakout system that is based on triagle or flag patterns.

One has to put the lines manually on those patterns. And that is not a problem because once the lines installed around +/- 14.30cet they stay in place till 23.00cet.

Because they make triangles or flags , those lines are descending and ascending. They function as entrys (when price breaks true those lines. BUT they function also as stoploss).

Because they are descending and ascending lines the value continiously changes. So is there someone who can programm something or indicator that one can draw descending or ascending lines that one can put an alert on it so one gets warned when the price is breaking true that line so one knows when to enter or when price breaks true it and one needs to execute his stoploss.

With horizontal lines there is no problem because one can use the alert settings of the MT4.0 platform. But with ascending or descending lines one has to change these values after every bar. That is not reasonable if one has to this every day from 14.30cet till 23.00cet.

TNX in advance for the help.....iGoR

How about this

Be carefull with the version you download. Use the last posted by nD

Reason: