[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 494

 
vilard:
how do I write to include the "and" first?

Place brackets
 
granit77:
symbol=Symbol();
Thank you !
 
Thank you
 
pu6ka:

Can you tell me why the array is not filling with values? It outputs zero.


1. Insert the code with the SRC button

2. double mas[];

 
pu6ka:

Can you tell me why the array is not filling with values? It outputs zero.

extern int n=15; // Number of bars
int Total; // No. of accesses to the start function

int start()
{
if (Total>=1) return; // we need 1 time
Total++;

double mas[];
for (int i=1; i<=n; i++)
{
mas[n]=iOsMA(NULL,0,9,21,5,PRICE_CLOSE,i);
Print ("OsMA = ",iOsMA(NULL,0,9,21,5,PRICE_CLOSE,i));
}
Print ("Array = ", mas[2];
Print ("Array = ", mas[10]);

return;
}

I don't know what you want, but maybe that's what you want. :

extern int n=15;  // Кол-во баров обсчета
int Total=0;      // Кол-во обращений в ф-ию start
double mas[];

int start()
{
   if (Total>=1) return; // нам сюда нужно 1 раз
   ArrayResize(mas,n);
   Total++;
   for (int i=1; i<=n; i++) {
      mas[i-1]=iOsMA(NULL,0,9,21,5,PRICE_CLOSE,i);
      Print ("OsMA = ",iOsMA(NULL,0,9,21,5,PRICE_CLOSE,i));
   }
   Print ("Массив = ", mas[2]);
   Print ("Массив = ", mas[10]);

return;
}
 
Can you tell me how to make a condition ?
I do not want my EA to open more than one order
and positions will be closed when StopLoss TakeProfit reaches exactly that specified
not much more

Files:
all_4.mq4  3 kb
 

Where is the list of organizations that support automated trading on mql4 and mql5?

Logically, such a list should be on the website of the mql developer.

 
artmedia70:

I don't know what you want, but maybe you need to. :




Thank you, artmedia70. That's exactly what I needed. Just getting to grips with arrays.
 
novicek:
Can you tell me how to make a condition ?
I do not want my EA to open more than one order
and positions will be closed when StopLoss TakeProfit reaches exactly that specified
not much more

To avoid opening more than one order, this can be inserted at the beginning of the start function:
int Total=0;                                    // Кол-во наших ордеров обнулено   
for(int i=1; i<=OrdersTotal(); i++)            
    {
     if (OrderSelect(i-1,SELECT_BY_POS)==true)   // Если есть следующий
       {                                         // 
        if (OrderMagicNumber()!=magic)continue;  // Ордера не нашего эксперта
           Total++;                              // Подсчет кол-ва всех наших ордеров
       }
    }

if (Total>=1) return;                            // не более одного ордера
As for StopLoss TakeProfit, I have not yet encountered slippage on set orders. Although I only worked with two brokerage companies, maybe it exists.
 
Hello Hello, does anybody know if a broker can shut down an EA in your terminal and if so, how to deal with it))) I have an EA working, then it starts tapping error 0. I got suspicious.
Reason: