Indicators with alerts/signal - page 337

a1arunner
13
a1arunner  

alerts every tick

I found a very good Money Flow Index indicator with alerts and email. The only problem is it alerts/emails on every tick. Does anyone know how to make it just alert once when it crosses into oversold/overbought at the end of the bar? I could not attach for some reason so here is code. (sorry!) Thanks for any help!

Regards,

Mike

//+------------------------------------------------------------------+

//| Money Flow Index.mq4 |

//|Modified by nlenz 2010 Copyright © 2005, MetaQuotes Software Corp.|

//| MetaTrader 5 Trading Platform / MetaQuotes Software Corp. |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2005, MetaQuotes Software Corp."

#property link "http://www.metaquotes.net/"

#property indicator_separate_window

#property indicator_minimum 0

#property indicator_maximum 100

#property indicator_level1 49

#property indicator_level2 51

#property indicator_buffers 1

#property indicator_color1 Blue

//---- input parameters

extern int ExtMFIPeriod=14;

extern double Oversold=49;

extern double Overbought=51;

extern bool alert=true;

extern bool emailAlert=false;

//---- buffers

double ExtMFIBuffer[];

bool alreadyalerted=false;

string alertstr;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

string sShortName;

//----

SetIndexBuffer(0,ExtMFIBuffer);

//---- indicator line

SetIndexStyle(0,DRAW_LINE);

//---- name for DataWindow and indicator subwindow label

sShortName="MFI("+ExtMFIPeriod+")";

IndicatorShortName(sShortName);

SetIndexLabel(0,sShortName);

//---- first values aren't drawn

SetIndexDrawBegin(0,ExtMFIPeriod);

//----

return(0);

}

//+------------------------------------------------------------------+

//| Money Flow Index |

//+------------------------------------------------------------------+

int start()

{

int i,j,nCountedBars;

double dPositiveMF,dNegativeMF,dCurrentTP,dPreviousTP;

//---- insufficient data

if(Bars<=ExtMFIPeriod) return(0);

//---- bars count that does not changed after last indicator launch.

nCountedBars=IndicatorCounted();

//----

i=Bars-ExtMFIPeriod-1;

if(nCountedBars>ExtMFIPeriod)

i=Bars-nCountedBars-1;

while(i>=0)

{

dPositiveMF=0.0;

dNegativeMF=0.0;

dCurrentTP=(High+Low+Close)/3;

for(j=0; j<ExtMFIPeriod; j++)

{

dPreviousTP=(High+Low+Close)/3;

if(dCurrentTP>dPreviousTP)

dPositiveMF+=Volume*dCurrentTP;

else

{

if(dCurrentTP<dPreviousTP)

dNegativeMF+=Volume*dCurrentTP;

}

dCurrentTP=dPreviousTP;

}

//----

if(dNegativeMF!=0.0)

ExtMFIBuffer=100-100/(1+dPositiveMF/dNegativeMF);

else

ExtMFIBuffer=100;

//----

i--;

}

//----

if (ExtMFIBuffer[0] >= Overbought && alreadyalerted == false) {

alertstr = StringConcatenate("MFI is High for ", Symbol(), " M", Period());

if (alert == true)

Alert(alertstr);

if (emailAlert == true)

SendMail("MT4 Chart Alert", alertstr);

alreadyalerted = true;

}

else if (ExtMFIBuffer[0] <= Oversold && alreadyalerted == false) {

alertstr = StringConcatenate("MFI is Low for ", Symbol(), " M", Period());

if (alert == true)

Alert(alertstr);

if (emailAlert == true)

SendMail("MT4 Chart Alert", alertstr);

alreadyalerted = true;

}

else if (alreadyalerted == true) {

if (emailAlert == true) {

alertstr = StringConcatenate("MFI is back to Middle for ", Symbol(), " M", Period());

SendMail("MT4 Chart Alert", alertstr);

}

alreadyalerted = false;

}

return(0);

}

//+------------------------------------------------------------------+

void doAlert(string doWhat)

{

static string previousAlert="nothing";

static datetime previousTime;

string message;

if (previousAlert != doWhat || previousTime != Time[0]) {

previousAlert = doWhat;

previousTime = Time[0];

//

//

//

//

//

message = StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," ma cross ",doWhat);

if (alert) Alert(message);

if (emailAlert) SendMail(StringConcatenate(Symbol()," ma cross "),message);

}

}

johnny2pips
46
johnny2pips  

Can you code a alert into this indicator (Heiken Ashi Exit)

This indicator is vary helpful especially when used with heiken ashi smoothed. It confirms a longer term trade is ready. If someone could code a signal to it I'd really appreciate your help.

heiken_ashi_exit.ex4

Files:
gpociejewski
57
gpociejewski  
johnny2pips:
This indicator is vary helpful especially when used with heiken ashi smoothed. It confirms a longer term trade is ready. If someone could code a signal to it I'd really appreciate your help. heiken_ashi_exit.ex4

Hi johny,

Please show us .mq4 file instead of .ex4.

Cheers,

Grzesiek

emmany4
130
emmany4  

Help to adjust this indicator

Pls i don't know if anyone can help with an indicator that was posted on this thread. The name is INDICATOR. I have been using it successfully with 3 different settings of 21,25, 27 that is 3 different windows. I need an alert when the 3 Settings agree. Thanks in advance. Pls note that it is the same with the fisher trade indicator.

dahmy
7
dahmy  

would you help me to code an EA just say the word and i well explain it

rapal
17
rapal  

Could somebody make this EA?

Fractal Pending Order:

1. Pending order buy stop will be putted at the last upper fractal. SL at the low bar of upper fractal. TP is ratio number from stop loss.

2. Pending order sell stop will be putted at the last lower fractal. SL at the high bar of lower fractal. TP is ratio number from stop loss.

If pending order is not executed & new fractal shows, previous pending order will be deleted.

thanks

Klarix
10
Klarix  

[langtitle=de]Universial E-mail[/langtitle]

[lang=de]Hi,

this is my first post.

I ´ve been looking for a EA/ script for my idea:

there are many good indis, but they often only have a alert function. ( pop up)

My idea is:

Is it possible to creat a ea/script which can change all alerts into an e-mail ?

perhaps here is already this EA, but i did´t found it.

Sorry for bad english, hope you unterstand my idea anyway.[/lang]

William Snyder
9493
William Snyder  
Klarix:
[lang=de]Hi,

this is my first post.

I ´ve been looking for a EA/ script for my idea:

there are many good indis, but they often only have a alert function. ( pop up)

My idea is:

Is it possible to creat a ea/script which can change all alerts into an e-mail ?

perhaps here is already this EA, but i did´t found it.

Sorry for bad english, hope you unterstand my idea anyway.[/lang]

Hi Klarix,

Welcome here, moved your post to this section, there are a lot of indicators here with alert (including email) built in, if you don't find what your looking for here just ask more than likely someone will code it for you.

RIKI OLIVIER SR
256
RIKI OLIVIER SR  

Please add simple email alert to this indicator.

Can a coder please add an email alert this bolli indicator and have it show the TF and currency when email is sent. I would greatly appreciate it. Thank you.

Riki

Files:
William Snyder
9493
William Snyder  
rikiolivier:
Can a coder please add an email alert this bolli indicator and have it show the TF and currency when email is sent. I would greatly appreciate it. Thank you. Riki

Rikioliver this is a version i have, did it for myself awhile back.

updated version here: https://www.mql5.com/en/forum/180648