[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 409

 
Can you please tell me how to divide all orders into two groups at the opening so that we can see which group each order belongs to? (MAGIC does not work)
 

Hello.

Can you please tell me if it's possible to create an array or its analog from variables in some way? My variant is given below, but it is, of course, erroneous.

Thank you in advance.

extern int F1=0;
extern int F2=0; 
extern int F3=0; 
extern int F4=0; 
extern int F5=0; 
extern int F6=0; 

*************************************

int NOrd[]={F1,F2,F3,F4,F5,F6};
 
nemo811:

Hello.

Can you please tell me if it's possible to create an array or its counterpart from variables in some way? My variant is given below, but it is, of course, erroneous.

Thank you in advance.

element by element

NOrd[0]=F1; NOrd[1]=F2;....

 
costy_:

element by element

NOrd[0]=F1; NOrd[1]=F2;....

Perfect! Thank you.
 

Please explain the principle of flags action.

If Condition1 is fulfilled, then Val_max=true and we go on to check Condition2 (on subsequent ticks Condition1 is no longer checked until we forcefully declare that Val_max=false). Or at every tick Condition1 will be checked to make sure it is true and if the condition is not fulfilled, then Val_max=false ?

If Condition2 is true, then Cl_dn=true and we proceed to check Condition3 (on next ticks Condition2 will not be checked until we forcefully declare Cl_dn=false). Or at every tick Condition1 and Condition2 will be checked for validity and if they are not met, then Val_max=false and Cl_dn=false ?

If Condition3 is fulfilled and Cl_dn==true, then Val_min=true and pass on

How to check that if Condition1 is fulfilled, then do not check it anymore and at next ticks check Condition2 and so on?

static bool Val_max, Cl_dn, Val_min; //static or global
                                        |
//+------------------------------------------------------------------+
int start()
  {
   int  j;
   double  bid;                                         
   bid=Bid;                                    // Текущая цена продажи
   string
   Symb=Symbol();                               // Название фин.инстр.
double Value_max=1.0000;
double Value_min=0.9980;
double Open_1=Open[1];
double Close_1=Close[1];
//----

//--------------------------------------------------------------- 4 --

double Val=iCustom(NULL, 0, "Название Польз. Индикатора",0,0);   // Присваиваем пер. Val значение польз. индикатора
if (Условие1)
{
 Val_max=true;                  // 
 Alert("Значение инд. >= V alue_max (исп. 1-е усл.)");
}
if (Условие2)
{
 Cl_dn=true;
 Alert("1 бар закрылся падением (исп. 2-е усл.)");
}
if (Условие3 && Cl_dn==true)
{
 Val_min=true;
 Alert("Значение инд. <= V alue_min (исп. 3-е усл.)");
}
if (Val_max==true && Cl_dn==true && Val_min==true)
  {
   for (j = 0; j < OrdersTotal(); j++)
    {
     OrderSelect(j, SELECT_BY_POS, MODE_TRADES);
     if (OrderSymbol() == Symbol())
      {
      if (OrderType() == OP_SELL) return(0);
      }
    }
   
   OrderSend(Symbol(),OP_SELL,0.1,NormalizeDouble(Bid,Digits),2,Bid+400*Point,Bid-400*Point,"",3,Red);  // Открытие SELL
   Val_max=false; Cl_dn=false; Val_min=false;
  }

//----
   return(0);
  }
 
costy_:

element by element

NOrd[0]=F1; NOrd[1]=F2;....

No, tried both ways - the compiler generates errors.
 
nemo811:
No, I tried it both ways - the compiler generates errors.


And so, if NOrd[] is not an indicator and is not located in a global block:

int NOrd[6];
NOrd[0]=F1; NOrd[1]=F2;....
 
DOCTORS:


I just have them in fact red (and there are 6 of them) and after each test I have to colour the graph manually (that's how I am...). I don't want to rewrite it.

Maybe there is a standard command?

Don't judge strictly, I'm just learning...

look for #property indicator_color1 Red

 
nemo811:
No, I tried it both ways - the compiler generates errors.

Read

first set the size of the array

buf[2]; .

assign

buf[0]=x1; buf[1]=x2;

It will take you 2 minutes toread it.

 
Mislaid:


Otherwise, if NOrd[] is not an indicator:

Thank you. No errors now.
Reason: