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

 
hurkin:

Code line:

Warning:

possible loss of data due to type conversion FinBuy1531.mq4 144 7

The types correspond to my opinion. What's wrong here?

Do not match, MarketInfo(...) returns the value of typedouble

something like this:

int Dgt=(int)MarketInfo(Symbol(),MODE_DIGITS);
 
r772ra:

No match, MarketInfo(...) returns a value of typedouble

like this:

Example from the directory:

double vpoint =MarketInfo("EURUSD",MODE_POINT);
int vdigits =MarketInfo("EURUSD",MODE_DIGITS);
Something else seems to be wrong?

 
Shurkin:

An example from the directory:

double vpoint =MarketInfo("EURUSD",MODE_POINT);
int vdigits =MarketInfo("EURUSD",MODE_DIGITS);
Something else seems to be wrong?

In the case of "MODE_DIGITS", "MarketInfo" returns a value of type "double". Here it looks like an implementation error of "MarketInfo". Therefore, the correct way would be:

int Dgt=(int)MarketInfo(Symbol(),MODE_DIGITS);
 

All last question!

There isOBJ_LABEL. in object descriptions, there is text (not name) and digit, digit changes with ticks.

How do I get the number out?

 
Top2n:

All last question!

There is OBJ_LABEL. in object descriptions, there is text (not name) and digit, digit changes with ticks.

How do I get the number out?

StringFind will help you. And there int StrToInteger or long StringToInteger
 

Good afternoon. Please help me to solve the problem.

I have installed the MT4 646th build. I placed in folder ...\MetaTrader 4 Admiral Markets AS\MQL4\Indicators two files - a file with indicator code LC-RSI_Histo3.mq4 and a file with compiled indicator LC-RSI_Histo3.ex4. I run the indicator - it works. However, I want to change the source code. I open the embedded code editor. The problem is that after any, even cosmetic changes to the code (for example, adding a space) and its subsequent compilation, the indicator after startup works incorrectly - all its columns show the same value:

The compiled .ex4 file (attached with the name LC-RSI_Histo3_1.ex4) weighs much more than the original (copied into the folder).

What is the reason? How to correct it?

 

Hi all!

Help me out with this error: "Not enough rights" or "Not enough rights" code #7

What is happening: An Expert Advisor on a EURCHFX M1 pair can not open a position, this error appears (found in the journal), but at the same time, it opens without problems on other pairs and EURCHF M5. It opens by hand without any problems. At another broker it works. What is the problem may be?

I thank you in advance for your help.

 
AlexeyVik:
StringFind is your guide. And then int StrToInteger or long StringToInteger


This function returns the number of position in the timeframe, not the number itself.

int  StringFind(
   string  string_value,        // строка, в которой ищем
   string  match_substring,     // что ищем
   int     start_pos=0          // с какой позиции начинать поиск
   );

Let's say I got the position number, then how do I extract this position?

 
Boeing747:

Does anyone have a piece of code for an example where elements of a string array are grouped in alphabetical order?

thanks in advance.


   string w[]={"E","c","f","b","j","R","A","H","a","c"}; // массив для экзекуции
   int size=ArraySize(w);
   string abc[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
   string ABC[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
   int c,e,i;

   for(i=0; i<26; i++)
     {
      for(e=c; e<size; e++)
        {
         if(ABC[i]==w[e])
           {
            w[e]=w[c];
            w[c]=ABC[i];
            c++;
           }
         else
           {
            if(abc[i]==w[e])
              {
               w[e]=w[c];
               w[c]=abc[i];
               c++;
              }
           }


        }
     }
   
   Alert(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9]);

Another example for applied tasks

   string w[]={"EURUSD","USDCHF","BRNQ4","AUDUSD","GOLD","AUDCHF","NZDUSD","USDCAD","SILVER","GBPUSD"}; // массив для экзекуции
   int size=ArraySize(w);
   string f=" ";
   string ABC[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
   int c,e,i;

   for(i=0; i<26; i++)
     {
      for(e=c; e<size; e++)
        {
         f=w[e];
         if(ABC[i]==StringSubstr(f,0,1))
           {
            w[e]=w[c];
            w[c]=f;
            c++;
           }
        }
     }

   Alert(w[0],", ",w[1],", ",w[2],", ",w[3],", ",w[4],", ",w[5],", ",w[6],", ",w[7],", ",w[8],", ",w[9]);



 
RostZ:

Hi all!

Help me out with this error: "Not enough rights" or "Not enough rights" code #7

What is happening: An Expert Advisor on a EURCHFX M1 pair can not open a position, this error appears (found in the journal), but at the same time, it opens without problems on other pairs and EURCHF M5. It opens by hand without any problems. At another broker it works. What is the problem may be?

I thank you in advance for your help.

Without knowing what is written inside your EA it is impossible to say what the problem is. How does the EA behave on EURCHFX M5 and EURCHF M1?
Reason: