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

 
rigc:
(it's not drawing at all)))


I do not know - it does. The indicator is simple as can be:

int start()
  {
   
//----
  double F1=0, F3=0, F13;    // номера фракталов
  int    B1, B3, SR=3;               // номера баров
  
  while(F3==0)                       //поиск фракталов
  {
    F13=iFractals(NULL,0,MODE_UPPER,SR);
    if (F13!=0) 
    {
      if      (F1==0){B1=SR; F1=F13;}
      else if (F3==0){B3=SR; F3=F13;}
    }
    SR++; 
  }
    ObjectSet("Rezist", OBJPROP_TIME1 ,iTime(NULL,0,B3));
    ObjectSet("Rezist", OBJPROP_TIME2 ,iTime(NULL,0,B1));
    ObjectSet("Rezist", OBJPROP_PRICE1,iHigh(NULL,0,B3));
    ObjectSet("Rezist", OBJPROP_PRICE2,iHigh(NULL,0,B1));
    ObjectSet("Rezist", OBJPROP_RAY   , True);

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

SR=3, that's what I corrected. It was SR=2 bar number from which to start looking for a fractal

 
Figar0:


I don't know, I tried it. The indicator is simple as can be:

SR=3, that's what I corrected. It was SR=2 bar number from which to start searching for a fractal

Yep, got it)))

Thanks

I owe you one.

 
sss2019:
Can you tell me how to execute a condition? We have a condition to open a buy order at the current price as soon as the price reaches 1.2550. So, when the price is higher or equal to 1.2550, the order is opened and when the order is opened, the static variable blocks the opening of new orders, until the order reaches 0. So, as soon as the order is closed and there are no more orders with this magic, the ban on opening is removed and a new order is opened, but the price has already moved away from this level. We need the EA to open market orders when the price reaches this level but not the pending ones.
You have a check for more or equal to 1.2550. In other words, when the price is higher(it has gone away long ago), the criterion is invariably true and therefore the positions will be opened.
You should consider the condition - price has crossed the 1.2550 level.
 
artmedia70:
You have a check for greater than or equal to 1.2550. I.e. when it is higher(price has long since left), the criterion is still true, and therefore positions will be opened.
You should consider the condition - price has crossed the 1.2550 level.


Thanks, I think it can be done with time calculation. For example, if the deposit in my account is in euros or for example in rubles, may my Expert Advisor make mistakes?

 

Can you tell me how the EA can reduce the size of RAM, zero it occasionally or something, because one terminal eats up to 100 MB and as I noticed, it eats until it reaches 100%. I have 25 terminals installed on one computer somewhere.

Let me remind you that I have only one chart in use and it is not showing. However, the data is used from tens of currency pairs.

May the size of historical data files affect the memory load? If we leave only daily data, will it work faster?

 
sss2019:


Thank you, I think it may be done with timing. For instance, if the deposit is in EUR or RUB, may my Expert Advisor make errors?

Why would you do that? You could, for example, use a MA with a period of 0. You check the first and second bars for intersection with the level. At the current one you open.

Errors may be in the programmer's head, not in the account deposit :)

 

Hi all !

Dear Professionals - please solve my question: https://www.mql5.com/ru/forum/116542

 

Can you tell me why this cycle doesn't work correctly, it doesn't look for the highest max, I can't find the error. It skips the highest max and takes the max of the previous candle as a result.

All values of the buystoploss array are 0 by default.

In the picture it looks like the loop has found the maximum of the 13th candle, skipping higher maximums

  i2=0;
  for(i=0;i<7;i++)
    {
    while(i2 <= 19)
      {
      if(High[i2]>buystoploss[i])
        {
        buystoploss[i]=High[i2];
        }
      i2++;
      }
    }
    Alert(" ",buystoploss[4]);
 
sss2019:

Can you tell me why this cycle doesn't work correctly, it doesn't look for the highest max, I can't find the error. It skips the highest max and takes the max of the previous candle as a result.

All values in buystoploss array are 0 by default.


This is such a joke:

Alert(" ",buystoploss[4]);

?

 
sss2019:

Can you tell me why this cycle doesn't work correctly, it doesn't look for the highest max, I can't find the error. It skips the highest max and takes the max of the previous candle as a result.

All values in buystoploss array are 0 by default.

well for starters i2 is only zeroed once...