EA programming tutorials for a complete list of character functions

  • 2023/2/24 18:46:40
  • read: 3
  • forextradingsessiontimes

 A set of functions for forex trading session times forextradingtime type data StringConcatenate  StringFind  StringGetChar  StringLen   nbsp;StringSetChar  StringSubstr  StringTrimLeft  StringTrimRight stringStringConcatenate(...) The string form of the data passed and the return parameter can forextradingmarket of any type The total number of passed parameters must not exceed 64 characters as applied to the Print(), Alert() and Comment() functions follow the same rules to transfer the string obtained cashback forex the function parameters returned as a concatenated result When the string character is added consecutively using (+) StringConcatenate() runs faster and stores the parameters:...  - All price values are separated by commas It can be 64 parameters   Example: stringtext;  text=StringConcatenate(Accountfreemarginis, AccountFreeMargin(),Currenttimeis,TimeToStr(TimeCurrent())); //text=Accountfreemarginis+AccountFreeMargin()+Currenttimeis+ TimeToStr(TimeCurrent())  Print(text);      intStringFind(stringtext,stringmatched_text, voidstart)Search for substring charactersIf a substring character is not found, return the position in the string character from the search substring character, or -1 parametric:text - the string being searched  matched_text - the string to be searched    nbsp;start - search start index position   example: stringtext=fast brown puppy across the lazy fox;  intindex=StringFind(text,puppy across,0);   if(index!=16)    Print(oops!);     intStringGetChar(stringtext,intpos) from the string text - string character  pos - The position of the taken character can be from 0 to StringLen(text)-1   Example: intchar_code= StringGetChar(abcdefgh,3);  //take out the code c is 99      intStringLen(stringtext) in the string character returns the code number Returnscharactercountinastring.Parameter:text - Calculate string length Example: stringstr=sometext;  if(StringLen(str)<5) return(0);      stringStringSetChar(stringtext,intpos,intvalue) returns the string character copy parameter with the changed code at the specified position:text - the changed string text code  pos - the position of the string text kind of code can be from 0 to StringLen(text)  value - the newly obtained ASCII code example: stringstr= abcdefgh;  stringstr1=StringSetChar(str,3,D);  //str1isabcDefgh    stringStringSubstr( stringtext,intstart,voidlength)extract string character from the beginning of the text string character at the given location if possible this function returns a copy of the extracted string character, otherwise it returns the empty string character parameter:text - will be extracted string character  start -& nbsp;stringtext start index can be from 0 to StringLen(text)-1  length - width of stringtext extracted if the value of the parameter is more than or equal to 0 or the parameter is not specified, stringtext will be extracted   Example:  stringtext=Fast brown puppy crossing over lazy fox;  stringsubstr=StringSubstr(text,4,5);  //minus the string character is fast word       stringStringTrimLeft(stringtext) in the left part of the string character function cut space and chart if possible function returns a cut copy otherwise return empty string character parameter:text - left cut string character    Example:  stringstr1= Helloworld ;  stringstr2=StringTrimLeft(str);  //in the cut str2 will be HelloWorld      nbsp;  stringStringTrimRight(stringtext) in the right part of the string character function cut space and chart if possible function returns a cut copy otherwise return empty string character parameter:text - right cut string character    Example: stringstr1= Helloworld ;  stringstr2=StringTrimRight(str);  //after clipping str2 will be  HelloWorld 

comments

Links