Please edit/re-write your post and use SRC button to post the code. That way you code is much easier to read.
Please use forum search and search for one per bar discussion in forum https://www.mql4.com/search#!keyword=one%20per%20bar&module=mql4_module_forum
winbig:
I am using an EA
I dont understand code about counting bars, i just want ..
int counted_bars=IndicatorCounted();
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am using an EA as an alert indicator, that also adds an arrow on chart, when conditions are met signal is given.
I dont understand code about counting bars, i just want the alert given at the tick by tick instance, then not repeating, so wait to next bar or 1 signal per bar.
I can post the file if easier...Here is the code snippet containing about Bars and some info on orders that is irrelevant:
int start()
{
double visualAddition= 3*_pipsMultiplyer*Point;
int counted_bars=IndicatorCounted();
if(Bars<=100) {return(0);}
int i=Bars-counted_bars-1;
while(i>=0)
{
_buySignal[i]=EMPTY_VALUE;
_sellSignal[i]=EMPTY_VALUE;
_lotSize[i]=_lotSizeDefault;
if(IsBuySignal(i)){
_buySignal[i]=iLow(Symbol(),Period(),i)-visualAddition;
if(_enableAlert){
if(i==1){
Alert("BUY "+Symbol()+" "+Period()+" bluebreeze");
SendMail("bluebreeze Long"+Symbol()+" "+Period(),"bluebreeze Long"+Symbol()+" "+Period());
}
}
}
if(IsSellSignal(i)){
_sellSignal[i]=iHigh(Symbol(),Period(),i)+visualAddition;
if(_enableAlert){
if(i==1){
Alert("SELL "+Symbol()+" "+Period()+" bluebreeze");
SendMail("bluebreeze Short"+Symbol()+" "+Period(),"bluebreeze Short"+Symbol()+" "+Period());
}
}
}
i--;
}
return(0);
}