Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 604

 
tuner:

Folks, could you please tell me how to convert double to int?

MatRound and other rounding functions return, oddly enough, Double. And if int variable is assigned to MatRound function, the compiler generates a lot of warnings like



Use an explicit type conversion.
 
tuner:

Folks, could you please tell me how to convert double to int?

MatRound and other rounding functions return, oddly enough, Double. And if int variable is assigned to MatRound function, the compiler generates a lot of warnings like




Conversion of numeric types
 

Zhunko, Contender, r772ra

Thank you! It helped :)

 

Requires a copyable text message output containing a bunch of lines with information about the last order.

MessageBox() doesn't seem to allow selection and copying of text.

I tried using ObjectCreate() to create type OBJ_EDIT, but line feed '\n' does not work there, it is displayed as a square and all in one line.

The only thing is that Alert() in the header outputs with line breaks as I need and the text is highlighted, but the message log with time below is unnecessary for me.

Has anyone come across this, how else can a message be displayed on multiple lines and copied in addition to Alert?

 
pu6ka:

Requires the output of a copyable text message containing a bunch of lines with information about the last order.

MessageBox() doesn't seem to allow selection and copying of text.

I tried using ObjectCreate() to create type OBJ_EDIT, but line feed '\n' does not work there, it is displayed as a square and all in one line.

The only thing is that Alert() in the header outputs with line breaks as I need and the text is highlighted, but the message log with time below is unnecessary for me.

Has anyone come across this, how else can a message be displayed on multiple lines and copied in addition to Alert?

Allows --> Ctrl-C.
 
Zhunko:
Allows --> Ctrl-C.


It worked.

It doesn't allow selection, as in Alert above in the screenshot, because of this I didn't think to use copying.

However, it also copies the title from the header and "OK" from the button, but I can "turn it off", I'll figure it out.

Thanks Zhunko.

 
Will this code work for opening orders?
 if (USDCAD){
          while(Count("USDCAD")==0){
            Result[0] = OrderSend("USDCAD",OP_BUY,Lot,MarketInfo("USDCAD",MODE_ASK),slip,0,0,"USDCAD",magic[0],0,Red);
            if (Result[0]<0){
              Answer=ERRORS(GetLastError());
              if (Answer==1)continue;
              if (Answer==2)break;
            }
          }
        }


int ERRORS (int Error)  // Error - номер ошибки  
  {
  if(Error==0)
      return(0);        // Нет ошибки      
  // 4-торговый сервер занят,132-рынок закрыт,137-брокер занят
  if(Error==4||Error==132||Error==137)  
      {
      Sleep(240000);    // Пауза 240 сек.
      return(1);        // Сообщаем о преодол. ошибке
      }
  // 128,142,143 - истек срок ожидания и т.д.
  if(Error==128||Error==142||Error==143) 
      {      
      Sleep(60000);     // Пауза 60 сек.
      return(1);        // Сообщаем о преодол. ошибке 
      }    
  // 135-цена изменилась,138-цена устарела
  if(Error==135||Error==138)               
      {      
      return(1);        // Сообщаем о преодол. ошибке
      }        
  // 6-нет связи,129-неправильные цены,
  // 130-неправильные стопы,136-нет цен
  if(Error==6||Error==129||Error==130||   
  Error==136||Error==137||Error==138)    
      {
      Sleep(5000);      // Пауза 5 сек. 
      return(1);        // Сообщаем о преодол. ошибке
      }
  // 146-подсистема торговли занята
  if(Error==146)               
      {      
      // Пока подсистема занята
      while(IsTradeContextBusy())
         {
         Sleep(10);     // Пауза 0.01 сек.
         }
      return(1);        // Сообщаем о преодол. ошибке
      }         
  // Критическая ошибка
  Alert("Ошибка №",Error,". Дальнейшая работа советника невозможна."); 
  return(2);          // Сообщаем о критич. ошибке
  }
 
Why do different brokers have different optimization and testing results for the same advisor of a standard wizard...... all settings including time zones of the brokers are identical and both results were done through real accounts
 
Zver4991:
Hello, why do different brokers have different results for optimization and testing the same advisor standard mashka...... all settings including time zones of brokers are identical and both results were carried out through real accounts

I don't know why I should use it as a base for testing one EA on a real account and I don't know how to use it on real accounts.
 
Svetlo:

I don't know how to use these brokers, but I'm sure they have a lot of advantages, and I'm sure they have a lot of advantages.

If you want to get a quote from a broker with MTs, you need to use a MetaQuotes service...
Reason: