# Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 2

Artyom Trishkin:

Not to call from another indicator :)

Or show how you do it.

I call it from this function

double GetPriceFractal(string symbol, ENUM_TIMEFRAMES timeframe, int mode_fractal, int count_find, int number_fractal, int &bar_fractal, int shift) {
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

bool CheckOnePrices(string symbol, ENUM_TIMEFRAMES timeframe, int mode_fractal, int count_find, int count_fractals, int bar_fractal, double match_price, int delta_points, int shift) {
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()

if(CheckOnePrices(Symbol(),PERIOD_CURRENT,0,rates_total,numFractals,bar,low[i],delta,i+1)) { BufferPointDn[i]=low[i]-distanc*Point;}

mila.com:

Calling from this function

double GetPriceFractal(string symbol, ENUM_TIMEFRAMES timeframe, int mode_fractal, int count_find, int number_fractal, int &bar_fractal, int shift) {
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.

mila.com:

I call it from this function

double GetPriceFractal(string symbol, ENUM_TIMEFRAMES timeframe, int mode_fractal, int count_find, int number_fractal, int &bar_fractal, int shift) {
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

Artyom Trishkin:

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

mila.com:

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.

Artyom Trishkin:
I wrote above that the values for the standard indicator and your custom one do not match.
Wrong - they do. You need to look deeper...

Why is there no Fibonacci in Meta Trader 4 but in the description?

SLANDOV:
Why is there no Fibonacci in Meta Trader 4 but in the description?
How come it is not there? There is: Insert menu item --> Fibonacci

Artyom Trishkin:
What do you mean, no? There is: "Insert" menu item --> "Fibonacci"