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

 
Roger Thank you so much!!!!!
 
Sepulca:

Different currency pairs will work, even if it is the same EA. There is definitely only one on one chart. But on different charts of the same currency pair, I do not even know.....
I'm sorry, but I can not understand it, it is directly in the order, if it's not difficult to explain in more detail ...
datime exp=iTime(Symbol(),PERIOD_D1,0)+23*60*60+59*60;
 

I have to change stop loss in pips to stop loss on the previous candlestick.

Here is the code, how to put it here.

Thanks a lot who tips.

double x = ... // Задаем на сколько пипсов выше
double sl = NormalizeDouble(High[1] + x * Point, Digits); // Задаем значение стоплосс на x пипсов выше предпоследней свечи
Files:
 

Pro guys, please advise: I bought an EA ($300) through one website and installed it according to the seller's instructions, but when I tested it on the account history it either shows zero profit and loss or indicates that something is wrong (although once again, I have installed it strictly according to the instructions). By the way, after installation the Expert Advisor was gray among its free counterparts, as if it were inactive. All the others were coloured: yellow faces in a blue hat. I moved the Expert Advisor to a demo account. All as it should be: a smiling face, I do not switch off the computer. I complained to the seller and he wrote to me: "1) The gray colour is closed code, not the source code .2) my Expert Advisor does not trade often, so just wait for the signal". Can you guys tell me whether I should wait? Is this even possible or is it a stupid scam?

 
vpogarcev:

I complained to the seller and he writes to me: "1) the grey colour is closed code, not the source code .2) The Expert Advisor does not trade often, so just wait for the signal". Can you guys tell me whether I should wait? Is it even possible or is it a stupid scam?


1) Yes, the EA is grey as there is no source code;

Who knows if it is worth waiting for? The psychics are on holiday.

 
vpogarcev:

Pro guys, please advise: I bought an EA ($300) through one website and installed it according to the seller's instructions, but when I tested it on the account history it either shows zero profit and loss or indicates that something is wrong (although once again, I have installed it strictly according to the instructions). By the way, after installation the Expert Advisor was gray among its free counterparts, as if it were inactive. All the others were coloured: yellow faces in a blue hat. I moved the Expert Advisor to a demo account. Everything as it should be: smiling face, computer on. I complained to the seller and he wrote to me: "1) The gray colour is closed code, not the source code .2) my Expert Advisor does not trade often, so just wait for the signal". Can you guys tell me whether I should wait? Is this even possible or is it a stupid scam?


At best, you might have been sold an EA which will soon stop making money.
 
FAQ:


Right, in this case when you delete e.g. 18 object, 19 becomes its place, 19=>18 i.e. you automatically get one reverse iteration. Use this for orders too.

Also, since the list of objects and orders are formally arrays starting from = 0, the maximal index will be one less than the array size:

Your last thought has led me to the following considerations... Suppose we have a deinit() function of the following form:

int deinit()                           // Спец. функция deinit()
  {
   int Quant_Objects=ObjectsTotal();   // Cтолько всего ВСЕХ объектов
   for(int k=0; k<Quant_Objects; k++)  // По количеству объектов 
     {
      string Obj_Name=ObjectName(k);   // Запрашиваем имя объекта
      string Head=StringSubstr(Obj_Name,0,6);// Извлекаем первые 6 сим
      if (Head==Prefix)                // Если найден объект, …
        {                              // ... начинающийся с Paint_,
         ObjectDelete(Obj_Name);       // … то его и удаляем
        }                              //конец if
     }                                 //конец for
   return;                             // Выход из deinit()
  }                                    //конец deinit
//-------------------------------------------------------------- 10 --

Suppose there are only 3 objects in the client terminal, of which the 1st and 2nd match the deletion conditions defined in the deinit() function. Correspondingly, they will be indexed 0 and 1 correspondingly. Then at the first iteration the variable k will take value 0 and the ObjectDelete(0) function will remove the corresponding object. Further, since the list of objects is formally an array, after deleting one of the objects, the remaining objects will be reindexed (something like forming a new bar and reindexing all bars that are currently present in the client terminal): then the object that was indexed number 1 (the object that must also be deleted by convention) will get index 0, and the object that had index 2 will get index 1. After deleting object number 0 on the 1st iteration, control will be given to the string

for(int k=0; k<Quant_Objects; k++)

to execute the expression k++. The k variable will get value 1 and since the value of the Quant_Objects variable is 3, the conditions of the for (k<Quant_Objects) operator are true and the 2nd iteration will be executed. But at this iteration there will be no object deletion because the object with index 1 (previously 2) does not meet the conditions of deletion. But it turns out that since the reindexing of objects took place after the removal of the first object, the 2nd object (which also by condition should have been removed) "skipped" the operation of removal, because at the moment when the variable k was equal to 1, the index of that object was reindexed and became 0. This is what was meant in the phrase "separately note that you can't delete objects in the first for loop, because in this case after each deletion the total number of objects and their numbering will change, so some object names will be skipped".

Did I get it right, or is there some mistake in my thinking?

Note: the deinit() function referring to the phrase "separately note that we mustn't delete objects in the first for loop, because in this case after each deletion the total number of objects and their numbering will change, so that some object names will be skipped":

//--------------------------------------------------------------- 9 --
int deinit()                           // Спец. функция deinit()
  {
   string Name_Del[1];                 // Объявление массива
   int Quant_Del=0;                    // Количество удаляемых объекто
   int Quant_Objects=ObjectsTotal();   // Cтолько всего ВСЕХ объектов
   ArrayResize(Name_Del,Quant_Objects);// Необходимый размер массива
   for(int k=0; k<Quant_Objects; k++)  // По количеству объектов 
     {
      string Obj_Name=ObjectName(k);   // Запрашиваем имя объекта
      string Head=StringSubstr(Obj_Name,0,6);// Извлекаем первые 6 сим
      if (Head==Prefix)                // Найден объект, ..
        {                              // .. начинающийся с Paint_
         Quant_Del=Quant_Del+1;        // Колич имён к удалению
         Name_Del[Quant_Del-1]=Obj_Name;//Запоминаем имя удаляемого
        }
     }
   for(int i=0; i<=Quant_Del; i++)     // Удаляем объекты с именами,.. 
      ObjectDelete(Name_Del[i]);       // .. имеющимися в массиве
   return;                             // Выход из deinit()
  }
//-------------------------------------------------------------- 10 --

P.S. Thank you in advance for your answer.

 
7777877:

Your last thought has led me to the following considerations... Suppose we have a deinit() function of the following kind:

Did I get it right or was I mistaken somewhere in my reasoning?


You've got it right.

In general, you'd better use index reduction in loops where deletion occurs:

int deinit()                           // Спец. функция deinit()
  {
   for(int k=ObjectsTotal()-1; k>=0; k--)  // По количеству объектов 
     {
      string Obj_Name=ObjectName(k);   // Запрашиваем имя объекта
      string Head=StringSubstr(Obj_Name,0,6);// Извлекаем первые 6 сим
      if (Head==Prefix)                // Найден объект, ..
         ObjectDelete(Obj_Name);
     }
   return;                             // Выход из deinit()
  }
 
yes
 

Gentlemen, using OrderSelect(), you can easily find the opening price of an order. Can we use the quotes on the chart to find out if there is an order at a certain price or nothing at this point? It is very annoying to look through all orders on each quote in the chart (especially if there are a lot of them) to find out if something is there or not with this price. Can you throw me the code if it exists?