Maximum length of a symbol name on FOREX - page 3

 
Vitaly Muzichenko:

But I don't understand the problem, why a character can't be substituted there regardless of its length

Because Magic is of the ulong type (8 bytes) 6 bytes are used for the basic magic and two bytes for variations of that magic

 
Vitaly Muzichenko:

But I don't understand the problem, why can't a character be put there immediately, regardless of its length

Here's a piece of code. I think you'll see.

string FindSymbol(const string str)
{
     
     string symbol = NULL, sym = str;
     if( !StringToUpper( sym ) ) return symbol;

     for(i=0; i<SymbolsTotal(false); i++)
     {
          string s = SymbolName(i, false);
          if( !StringToUpper( s ) ) continue;
          if(StringFind(sym, s, 0) < 0 &&
             StringFind(s, sym, 0) < 0) continue;
          symbol = SymbolName(i, false);
          break;
     }

     return symbol;
}
Situations can be different. Especially when writing for clients, it is better to double-check.
 
prostotrader:

Because Magic is of ulong type (8 bytes) 6 bytes are used for the main magician and two bytes for variations of that magician

How about this?

string GetForexName(string Str)
  {
  string ch, res;
  string mass[26]={"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 Len=StringLen(Str);
  // цикл по буквам строки
   for(int i=0;i<Len;i++)
     {
      ch=StringSubstr(Str,i,1);
      for(int c=0;c<26;c++)
       {
        if(mass[c]==ch)
          res+=ch;
          break;
       }
     }
//---
   return(res);
  }

//Print( GetForexName(/*_Symbol*/".AUDCHFnosp") ); // получим чистый символ, без префиксов и суффиксов "AUDCHF"
 
Alexander Bereznyak:

if only currency pairs are used:

For SymbolInfoString()

ENUM_SYMBOL_INFO_STRING

Identifier

Description

Property type

SYMBOL_BASIS

Name of the underlying asset for the derivative

string

SYMBOL_CURRENCY_BASE

Base currency of the instrument

string

SYMBOL_CURRENCY_PROFIT

Profit currency

string

SYMBOL_CURRENCY_MARGIN

Currency in which the margin is calculated

string

SYMBOL_BANK

Current quote source

string

SYMBOL_DESCRIPTION

String description of the symbol

string

SYMBOL_FORMULA

Formula for constructing the price of a custom symbol

string

SYMBOL_ISIN

Name of a trading symbol in the International Securities Identification Number (ISIN) system. The International Securities Identification Number is a 12-digit alphanumerical code which uniquely identifies a security. The presence of this characteristic is defined on the trade server side.

string

SYMBOL_PAGE

Address of the web page containing information on the symbol. This address will be displayed as a link when viewing the symbol properties in the terminal

string

SYMBOL_PATH

Path in the symbol tree

string

Thanks, can anyone check what is returned ifSYMBOL_DESCRIPTION and SYMBOL_ISIN are queried on characters ecn______ and.AUDCHFnosp ?

 
prostotrader:

Thanks, can anyone check what is returned ifSYMBOL_DESCRIPTION and SYMBOL_ISIN are queried on the characters ecn______ and.AUDCHFnosp ?

Here:

Print( "SYMBOL_CURRENCY_BASE=",SymbolInfoString("AUDNZD",SYMBOL_CURRENCY_BASE)," || SYMBOL_ISIN=",SymbolInfoString("AUDNZD",SYMBOL_ISIN) );

2018.08.24 11:58:36.727	Sym AUDNZD,H1: SYMBOL_CURRENCY_BASE=AUD || SYMBOL_ISIN=
 
Vitaly Muzichenko:

Here you go:

Thank you, butSYMBOL_DESCRIPTION?

I.e. Is the base character always the first character in the pair?
 
Vitaly, please check if the message "FOREX done." appears on "crooked" characters
Files:
 
prostotrader:
Vitaly, please check if the message "FOREX done." appears on the "crooked" characters

prostotrader, I'm sorry, but I can't at the moment - I don't have time at all, I have a construction site. I only go to my computer for a couple of minutes on my break.

 
Vitaly Muzichenko:

prostotrader, I'm sorry, but I can't at the moment - I don't have time at all, I have a construction site. I only go to my computer for a couple of minutes on my break.

Ok

Guys, please check on characters other than 6 letters

 
prostotrader:

Okay

Guys, please check on symbols other than 6 letters

If you are aprostotrader, get a forex account and test it, you already have an mt5 terminal. This will be faster, and you will see all the logs

Reason: