[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 215

 
artmedia70:

Cycle:




Through integers, the calculation speed will increase by an order of magnitude. And you can use standard functions to search
 
Vinin:

If necessary, a solution can be found. For example, go to an integer ordered array. Search for the desired value in it.
Thank you.
 
artmedia70:

Cycle:



Thank you.
 
solnce600:
Please tell me the name of the default functions to search for the right value of an array element.

In the array function group, I don't seem to have found any.


Take a close look at this function
 
Vinin:

Take a close look at this feature
OK. Thank you.
 
Hi, could you please tell me how to write an expression? If Bar2 has an opening price lower than the closing one, assign the value of Bar2b, and if the opposite is true, assign the value of Bar2m. Thank you!
 
art-gan:
Hello, could you please tell me how to write an expression? If Bar2 has an opening price lower than the closing one, assign Bar2b to it. If it is vice versa, assign Bar2m to it. Thank you!

That's how you write it:

    //---- Объявляем переменную, которой будем присваивать значение
    double ld_Value;
    //---- Теперь запичываем условие
    if (Open[2] < Close[2]) ld_Value = Bar2b; else ld_Value = Bar2m; 
 
Thank you so much!
 

Good day dear forum users!!!

I just started to learn MQL, so I apologize for maybe a simple question...

I have an indicator in which I need to insert the LWMA in the same separate window... advise how to implement it ...

The figure shows Vector indicator (white and yellow lines) , and the red waving is superimposed on this inductor in the basement???

 

Good afternoon.

I want to draw the readings on D1 by sections on a smaller TF, it doesn't draw anything:

int start()
{
int counted_bars=IndicatorCounted();
int limit;
if (TimeFrame>0) limit=Bars-counted_bars+(TimeFrame/Period());
else limit=Bars-counted_bars-1;
int i=limit;
int C_time;
int Bar_Shift;
if (limit==0) return(0);
//wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
int h,l,h1,l1;
while(i>=0)
{
C_time=Time[i];
Bar_Shift=iBarShift(NULL,TimeFrame,C_time,true);
h=iMA(NULL,0,period,0,MODE_EMA,2,Bar_Shift);
l=iMA(NULL,0,period,0,MODE_EMA,3,Bar_Shift);

//----
ExtMapBuffer1[Bar_Shift]=h;
ExtMapBuffer2[Bar_Shift]=l;
i--;}
//----
return(0);
}

 


Maybe someone will correct the code or show me how to do it.

Thanks in advance.

Reason: