Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 2
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
Not to call from another indicator :)
Or show how you do it.
I call it from this function
int n=0;
for(int i=shift; i<count_find; i++) {
//double price_fractal=iFractals(symbol,timeframe,mode_fractal,i);
double price_fractal=NormalizeDouble(iCustom(symbol,timeframe,"X-bars",InpLeftSide,InpRightSide,mode_fractal,i),Digits);
if(price_fractal>0) {
n++;
if(n==number_fractal) {
bar_fractal=i;
return(price_fractal);
}
}
}
return(EMPTY_VALUE);
}
And it in its turn from this
if(count_fractals<1) return(false);
double pt=SymbolInfoDouble(symbol,SYMBOL_POINT);
int n=1, dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
for(int i=n; i<=count_fractals; i++) {
double price_fractal=GetPriceFractal(symbol,timeframe,mode_fractal,count_find,n,bar_fractal,shift);
double result_compare=fabs(NormalizeDouble(price_fractal-match_price,dg));
if(result_compare<delta_points*pt) {
if(mode_fractal==0) BufferFractalUp[bar_fractal]=price_fractal;
else BufferFractalDn[bar_fractal]=price_fractal;
/// Print("Цена бара с фракталом ",n," совпала с проверяемой ценой, возвращаем true");
return(true);
}
n++;
}
return(false);
}
This is it in OnCalculate()
Calling from this function
int n=0;
for(int i=shift; i<count_find; i++) {
//double price_fractal=iFractals(symbol,timeframe,mode_fractal,i);
double price_fractal=NormalizeDouble(iCustom(symbol,timeframe,"X-bars",InpLeftSide,InpRightSide,mode_fractal,i),Digits);
if(price_fractal>0) {
n++;
if(n==number_fractal) {
bar_fractal=i;
return(price_fractal);
}
}
}
return(EMPTY_VALUE);
}
Well... you don't call it correctly - it only has two parameters in the settings, and you put 3 after the name.
And why are you normalizing it? There's no need for it.
I call it from this function
int n=0;
for(int i=shift; i<count_find; i++) {
//double price_fractal=iFractals(symbol,timeframe,mode_fractal,i);
double price_fractal=NormalizeDouble(iCustom(symbol,timeframe,"X-bars",InpLeftSide,InpRightSide,mode_fractal,i),Digits);
if(price_fractal>0) {
n++;
if(n==number_fractal) {
bar_fractal=i;
return(price_fractal);
}
}
}
return(EMPTY_VALUE);
}
Note, that in mode_fractal you have to write the buffer number of this custom indicator - for the upper 0, for the lower 1. Otherwise, in the standard fractals, the identifier values for fractals do not coincide with buffer values of this custom indicator:
Standard fractals:
Constant
Value
Description
MODE_UPPER
1
Upper line
MODE_LOWER
2
Bottom line
Buffers of the custom indicator:
0 Upper line
1 Bottom line
Well... you don't call it correctly - it only has two parameters in the settings and you put 3 after the name.
And why are you normalising it? You don't need it here.
mode_fractal is upper or lower fractal, you can't do without it.
The zero is written after the period
mode_fractal is upper or lower fractal, as without it.
zero is inscribed after the period
I wrote above that the values for the standard indicator and your custom one do not match.
Why is there no Fibonacci in Meta Trader 4 but in the description?
What do you mean, no? There is: "Insert" menu item --> "Fibonacci"
MetaTrader4 from PlayMarket