{
if(iClose(Symbol(),0,j)>=iFractals(Symbol(),0,MODE_LOWER,j) && iFractals(Symbol(),0,MODE_LOWER,j)!=0)
{
Alert("Resistenza su "+Symbol()+" a TF "+IntegerToString(Period(),0,0)) ;
r++;
}
if(iClose(Symbol(),0,j)<iFractals(Symbol(),0,MODE_UPPER,j) && iFractals(Symbol(),0,MODE_UPPER,j)!=0)
{
Alert("\nSupport su "+Symbol()+" a TF "+IntegerToString(Period(),0,0)+"al tempo " + Time[j]);
s++;
}
Comment("S: "+ s + "\nR:" + r );
}
return(0);
But I do not understand the reason why run the alert almost continuously at each "tick" and metatrader crashes instead should work so that each time it appears a support / resistance a allert appears to me,
- Print out your variables, and find out why.
- Create a test script that shows the crash. We can't do anything about that, show Metaquotes
- Can someone please advise where I send a Request for Support to Metaquotes. - MQL4 forum
- Get in touch with developers using Service Desk! - MQL5 forum
- Report it to the service desk. 'MQL5.community - User Memo' - an article about the algorithmic/automated trading in MetaTrader
- Report it to the Service Desk, not us users.
{
if(iClose(Symbol(),0,j)>=iFractals(Symbol(),0,MODE_LOWER,j) && iFractals(Symbol(),0,MODE_LOWER,j)!=0)
{
Alert("Resistenza su "+Symbol()+" a TF "+IntegerToString(Period(),0,0)) ;
r++;
}
if(iClose(Symbol(),0,j)<iFractals(Symbol(),0,MODE_UPPER,j) && iFractals(Symbol(),0,MODE_UPPER,j)!=0)
{
Alert("\nSupport su "+Symbol()+" a TF "+IntegerToString(Period(),0,0)+"al tempo " + Time[j]);
s++;
}
Comment("S: "+ s + "\nR:" + r );
}
return(0);
But I do not understand the reason why run the alert almost continuously at each "tick" and metatrader crashes instead should work so that each time it appears a support / resistance a allert appears to me,
You need to decide what you actually want to do.
It is no good comparing price to a fractal value, because fractal values are always higher or lower than the bar's high/low. This is so that the fractal does not obscure the bar.
for(int j=0; j<Bars; j++)
{
if(iFractals(Symbol(),0,MODE_LOWER,j)!=0)
{
Alert("Lower fractal found at bar ",j) ;
break;
}
if(iFractals(Symbol(),0,MODE_UPPER,j)!=0)
{
Alert("Upper fractal found at bar ",j) ;
break;
}
}
return(0);
The above code will find the most recent fractal. Build on that to do what you require. Code it so it is only checked when a new bar opens.
You may want to store the time, high or low of the fractal bar etc. You can store thes values in globally declared or static variables. Or even in an array, it all depends on what you will be doing with the results.
You need to decide what you actually want to do.
It is no good comparing price to a fractal value, because fractal values are always higher or lower than the bar's high/low. This is so that the fractal does not obscure the bar.
for(int j=0; j<Bars; j++)
{
if(iFractals(Symbol(),0,MODE_LOWER,j)!=0)
{
Alert("Lower fractal found at bar ",j) ;
break;
}
if(iFractals(Symbol(),0,MODE_UPPER,j)!=0)
{
Alert("Upper fractal found at bar ",j) ;
break;
}
}
return(0);
The above code will find the most recent fractal. Build on that to do what you require. Code it so it is only checked when a new bar opens.
You may want to store the time, high or low of the fractal bar etc. You can store thes values in globally declared or static variables. Or even in an array, it all depends on what you will be doing with the results.
texoro: I would like the allert only the candle comnpare support or resistance not every "tick" how it works now!
| So where is your new bar code and why haven't you put the call in there? |
I am afraid that this is gibberish. I have no idea what you are asking
I solved this way:
{
TempoSalvato=Time[0];
for(int j=0; j<Bars; j++)
{
if(iFractals(Symbol(),0,MODE_LOWER,j)!=0)
{
Alert("Lower fractal found at bar ",j) ;
break;
}
if(iFractals(Symbol(),0,MODE_UPPER,j)!=0)
{
Alert("\nUpper fractal found at bar ",j) ;
break;
}
}
}
Now I would like to make visible alerts only sound when you see a "support or resistance" and not every candle
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello to everyone, I am trying to do a function to "intercept" the candle where it "appears" the "fractals" of "the function “ifractals" this is the code:
{
if(iClose(NULL,0,j)>=iFractals(NULL,0,MODE_UPPER,j) && iFractals(NULL,0,MODE_UPPER,j)!=0)
{
r=r+1;
}
if(iClose(NULL,0,j)<iFractals(NULL,0,MODE_LOWER,j) && iFractals(NULL,0,MODE_LOWER,j)!=0)
{
s=s+1;
}
Comment("S: "+ s + "R:" + r );
}
return(0);
}
If something wrong in those who help me