Jump to content

REQ - Looking for a coding Guru - Price Patterns.mq4 quickfix :-)


morgb

Recommended Posts

Calling all mq4 guru's :-)

 

I've tried myself to modify this indicator to include email alerts, the only problem is :-

 

1. As soon as you add it to a chart it fires off 20+ emails

2. If you change timeframe it fires off 20+ emails

 

and last but not least,

 

3. When the variables are met and a new price pattern is formed it sends out 20+ emails.

 

You've probably figured out im only looking to send 1 email :-). I have to admit im no coder, but at least i've tried lol, I have messed around with :-

 

 

if (EmailON) SendMail("Inside Bar", "Inside Bar, Date="+TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime())+" Symbol="+Symbol()+" Period="+Period());

 

Can anyone fix this for me, it would be very much appreciated, thanks in advance :-).

 

Link to the full mq4 source file.

 

http://www.filefactory.com/file/b1eg84d/n/Price_Patterns3.mq4

 

Many Thanks.

Link to comment
Share on other sites

Hi morgb

I don't know if it works, I didn't really check how the indie works.

Before you have it sending email, up, there are two functions "for("

They are like loops and on that look the condition "if((L1 >= L2) && (O1 <= H2) && (C1 <= O1) && (H1 > H2 + ((H1 - L1)/3)))" must happen more than once.

I didn't test, but what I did was creating a integrer (int aaaa=0;) with the value 0. Then the loops start and when the condition if is true I put it sending an email and making aaaa=1;

I also changed the email on condition to "if (EmailON && aaaa == 0) "

 

So what happens is it says aaaa=0. Then the loops start. Then if the condition verifies, and if email is on and aaaa=0,it sends the email and changes aaaa to 1 and it doesn't send more emails on that loop. If it sends more then is after a whole new cicle, or so it should. Give it a try and let me know what happens.

-----------------------------------------------

http://www.multiupload.com/J01RLKCYT6

-----------------------------------------------

Link to comment
Share on other sites

Thanks for the help, its nearly working, now it only sends one email which is great.

 

However it sends the same email after every new bar, so when its tested on a 1 min chart and it posted an alert 4 bars ago, it then sends the same alert every new 1 min bar for the alert that took place 4 bars ago.

 

So a new email every 1 min.

Link to comment
Share on other sites

Hi morgb.

Could elucidate me better about how the indicator works and when you want it to send an email?

You said it now sends an email or every bar.

Is it every bar as soon as you start the indicator or is it every bar after the condition verifies?

And to better understand, when do you want it to send an email to you, is it every time some condition verifies or only one time since you start the indicator?

Link to comment
Share on other sites

Actually, try this first:

http://www.easy-share.com/1910517461/Price_Patterns3[1]_aaaa2.mq4

I read a bit into the code and it seems that the indicator recalculated the whole graphic all the time, instead of doing it once and calculating every time there is a new bar. I don't know about you, but it is pushing hard from my cpu.

I didn't fix that, but what I did was, I try to tell it to only send an email if the most recent bar verifies the condition, as opposed to before, that it was sending an email every time the condition verified, even if it was in the past.

Another thing is, if you don't wanna bother checking your email all the time I also put it showing a message saying "Email sent" on the experts tab. Just click there and if it says that than it sent an email to you.

Edited by dinj
Link to comment
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.

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.

×
×
  • Create New...