Sen descrición

blTelegramToMT4.mq4 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. //+------------------------------------------------------------------+
  2. //| blTelegramToMT4.mq4 |
  3. //| Copyright 2025, MQL Development |
  4. //| https://www.mqldevelopment.com/ |
  5. //+------------------------------------------------------------------+
  6. #property copyright "Copyright 2025, MQL Development"
  7. #property link "https://www.mqldevelopment.com/"
  8. #property version "1.00"
  9. #property strict
  10. #define buy "buy"
  11. #define sell "sell"
  12. #define MaxOrders 10000
  13. struct msgDetails
  14. {
  15. int msgid;
  16. msgDetails()
  17. {
  18. msgid = -1;
  19. }
  20. };
  21. msgDetails od[MaxOrders];
  22. struct new_trade_store
  23. {
  24. ulong ticket; // Ticket
  25. int order_type; // OrderType
  26. double lot; // Lot
  27. double stop_loss; // StopLoss
  28. double take_profit; // TakeProfit
  29. double price; // Price
  30. string symbol; // Symbol
  31. int chatId; // ChatId
  32. string trade_type; // Trade Type (Trade Type: Tp1, Tp2, Tp3.... Tpn)
  33. new_trade_store()
  34. {
  35. ticket = -1;
  36. chatId=-1;
  37. trade_type = "";
  38. }
  39. };
  40. new_trade_store newTradeStore[MaxOrders];
  41. input string Settings = " ------------- General Settings ------------- "; //_
  42. input int magic_no = 333; // Magic no
  43. input string symbolMatch = "GOLD:XAUUSD,BitCoin:BTCUSD"; // Symbol Mapping (Telegram:MT5)
  44. input string suffix = ""; // Account Suffix
  45. input string prefix = ""; // Account Prefix
  46. input double lotSize = 0.1; // Lot Size
  47. //+------------------------------------------------------------------+
  48. //| Expert initialization function |
  49. //+------------------------------------------------------------------+
  50. // Global Variables
  51. string url1 = "http://127.0.0.1";
  52. string header = "Content-Type: application/json\r\nAccept: application/json\r\n";
  53. int getme_result;
  54. string symbolChart[];
  55. string symbolSnd[];
  56. string symbolsListUserInput[];
  57. uchar sym1[];
  58. uchar sym2[];
  59. datetime ea_start_time = 0;
  60. int last_message_id = INT_MIN;
  61. int OnInit()
  62. {
  63. //--- create timer
  64. ea_start_time = TimeCurrent();
  65. ushort u_sep = StringGetCharacter(",",0);
  66. StringSplit(symbolMatch,u_sep,symbolsListUserInput);
  67. ArrayResize(symbolChart,0);
  68. ArrayResize(symbolSnd,0);
  69. for(int i = 0; i < ArraySize(symbolsListUserInput); i++)
  70. {
  71. string str = symbolsListUserInput[i];
  72. int index = StringFind(str,":");
  73. int index2 = StringLen(str);
  74. ArrayResize(sym1,0);
  75. ArrayResize(sym2,0);
  76. for(int j = 0; j < index; j++)
  77. {
  78. ArrayResize(sym1,ArraySize(sym1)+1);
  79. sym1[j] = uchar(str[j]);
  80. }
  81. int k = 0;
  82. for(int j = index + 1 ; j < index2; j++)
  83. {
  84. ArrayResize(sym2,ArraySize(sym2)+1);
  85. sym2[k] = uchar(str[j]);
  86. k++;
  87. }
  88. ArrayResize(symbolChart,ArraySize(symbolChart)+1);
  89. ArrayResize(symbolSnd,ArraySize(symbolSnd)+1);
  90. symbolChart[i] = CharArrayToString(sym1);
  91. symbolSnd[i] = CharArrayToString(sym2);
  92. }
  93. string jsonString = GET_function(url1 + "/get-latest-message-id", header);
  94. StringReplace(jsonString,"},", "*");
  95. last_message_id = (int)getJsonStringValue(jsonString, "id") != 0 ? (int)getJsonStringValue(jsonString, "id") : INT_MIN;
  96. string message = getJsonStringValue(jsonString, "message");
  97. if(last_message_id != INT_MIN)
  98. {
  99. Print(" latest_message_id = ",last_message_id);
  100. Print(" result found against get-latest-message-id = ",message);
  101. }
  102. EventSetTimer(1);
  103. //---
  104. return(INIT_SUCCEEDED);
  105. }
  106. //+------------------------------------------------------------------+
  107. //| Expert deinitialization function |
  108. //+------------------------------------------------------------------+
  109. void OnDeinit(const int reason)
  110. {
  111. //--- destroy timer
  112. EventKillTimer();
  113. }
  114. //+------------------------------------------------------------------+
  115. //| Expert tick function |
  116. //+------------------------------------------------------------------+
  117. void OnTick()
  118. {
  119. //---
  120. }
  121. //+------------------------------------------------------------------+
  122. //| Timer function |
  123. //+------------------------------------------------------------------+
  124. void OnTimer()
  125. {
  126. //---
  127. if(last_message_id == INT_MIN)
  128. {
  129. string jsonString = GET_function(url1 + "/get-latest-message-id", header);
  130. StringReplace(jsonString,"},", "*");
  131. last_message_id = (int)getJsonStringValue(jsonString, "id") != 0 ? (int)getJsonStringValue(jsonString, "id") : INT_MIN;
  132. if(last_message_id != INT_MIN)
  133. {
  134. string message = getJsonStringValue(jsonString, "message");
  135. if(last_message_id != INT_MIN)
  136. {
  137. Print(" latest_message_id = ",last_message_id);
  138. Print(" result found against get-latest-message-id = ",message);
  139. }
  140. execute_functionality_on_new_message(last_message_id);
  141. }
  142. }
  143. else
  144. {
  145. string jsonString = GET_function(url1 + "/get-latest-message-id", header);
  146. StringReplace(jsonString,"},", "*");
  147. int latest_message_id = (int)getJsonStringValue(jsonString, "id") != 0 ? (int)getJsonStringValue(jsonString, "id") : INT_MIN;
  148. if(last_message_id != latest_message_id)
  149. {
  150. for(int i = latest_message_id; i > last_message_id; i--)
  151. {
  152. execute_functionality_on_new_message(i);
  153. }
  154. last_message_id = latest_message_id;
  155. }
  156. }
  157. }
  158. //+------------------------------------------------------------------+
  159. //| |
  160. //+------------------------------------------------------------------+
  161. string GET_function(string url,string headers)
  162. {
  163. string result_string = NULL;
  164. int timeout = 10; // Set the timeout value in seconds
  165. char result[],data[];
  166. string resultHeaders;
  167. int res = WebRequest("GET",url,headers,timeout,data,result,resultHeaders);
  168. if(res == 200)
  169. {
  170. result_string = CharArrayToString(result);
  171. }
  172. else
  173. {
  174. Print("content GETT: ", result_string," Error: ",GetLastError(), " res: ",res);
  175. }
  176. return result_string;
  177. }
  178. //+------------------------------------------------------------------+
  179. //| |
  180. //+------------------------------------------------------------------+
  181. void seperatingDataOnint(int index, string data)
  182. {
  183. string message = getJsonStringValue(data,"message",4,"\"");
  184. int message_id = (int)getJsonStringValue(data,"message_id",4,"\"");
  185. if(checkExistingTrade(message_id) == false)
  186. {
  187. Print(" ================ OnInit New Trade Message Found ================");
  188. StringReplace(message,"~","#");
  189. StringToLower(message);
  190. Print("Message is ", message);
  191. for(int i=0; i < MaxOrders; i++)
  192. {
  193. if(od[i].msgid == -1)
  194. {
  195. od[i].msgid = message_id;
  196. break;
  197. }
  198. }
  199. }
  200. }
  201. //+------------------------------------------------------------------+
  202. //| |
  203. //+------------------------------------------------------------------+
  204. bool checkExistingTrade(int message_id)
  205. {
  206. for(int i=0; i < MaxOrders; i++)
  207. {
  208. if(od[i].msgid == message_id)
  209. {
  210. return true;
  211. }
  212. }
  213. return false;
  214. }
  215. //+------------------------------------------------------------------+
  216. //| |
  217. //+------------------------------------------------------------------+
  218. string getJsonStringValue(string json,string key,int addUp,string endSign)
  219. {
  220. int indexStart = StringFind(json,key)+StringLen(key)+addUp;
  221. int indexEnd = StringFind(json,endSign,indexStart);
  222. return StringSubstr(json,indexStart,indexEnd-indexStart);
  223. }
  224. //+------------------------------------------------------------------+
  225. //| |
  226. //+------------------------------------------------------------------+
  227. string getJsonStringValue(string json, string key)
  228. {
  229. int start = StringFind(json, "\""+key+"\"");
  230. if(start == -1)
  231. return "";
  232. // Find colon after key
  233. int colon = StringFind(json, ":", start);
  234. if(colon == -1)
  235. return "";
  236. // Find next comma or closing brace
  237. int endComma = StringFind(json, ",", colon);
  238. int endBrace = StringFind(json, "}", colon);
  239. int end = (endComma != -1 && (endComma < endBrace || endBrace == -1)) ? endComma : endBrace;
  240. if(end == -1)
  241. end = StringLen(json);
  242. string value = trim(StringSubstr(json, colon+1, end-colon-1));
  243. // remove quotes if exist
  244. StringReplace(value, "\"", "");
  245. return value;
  246. }
  247. //+------------------------------------------------------------------+
  248. //| |
  249. //+------------------------------------------------------------------+
  250. string trim(string text)
  251. {
  252. StringTrimLeft(text);
  253. StringTrimRight(text);
  254. return text;
  255. }
  256. //+------------------------------------------------------------------+
  257. //| |
  258. //+------------------------------------------------------------------+
  259. void seperatingData(int index, string data)
  260. {
  261. // Print(" Data: ", data);
  262. string message = getJsonStringValue(data,"message",4,"\"");
  263. int message_id = (int)getJsonStringValue(data,"message_id",4,"\"");
  264. string isReplyValue = getJsonStringValue(data,"is_reply",4,"\"");
  265. int reply_to_msg_id = (int)getJsonStringValue(data,"reply_to_msg_id",4,"\"");
  266. if(isReplyValue == "False")
  267. {
  268. if(checkExistingTrade(message_id) == false)
  269. {
  270. Print(" --------------- New Trade Message Found ----------------- ", " Message Id: ", message_id);
  271. StringReplace(message,"~","#");
  272. StringReplace(message,"##", "#");
  273. StringToLower(message);
  274. message = removeExtraSpaces(message);
  275. Print("Message is ",message);
  276. addtoMessageStructure(message_id,message);
  277. string result[];
  278. string tempResult[];
  279. int indexTemp = 0;
  280. StringSplit(message,'#',tempResult);
  281. for(int i=0; i<ArraySize(tempResult); i++)
  282. {
  283. //result[i] = StringTrimLeft(result[i]);
  284. //result[i] = StringTrimRight(result[i]);
  285. //Print("Temp Result : ", tempResult[i], " index is: ", i);
  286. if(HasAlphanumeric(tempResult[i]))
  287. {
  288. //Print(" contains alphanumeric characters.");
  289. ArrayResize(result,ArraySize(result)+1);
  290. result[indexTemp] = tempResult[i];
  291. indexTemp++;
  292. }
  293. else
  294. {
  295. //Print(" does not contain alphanumeric characters.");
  296. //ArrayResize(indexToDelete,ArraySize(indexToDelete)+1);
  297. //indexToDelete[indexTemp] = i;
  298. //indexTemp++;
  299. }
  300. }
  301. message(result,message,message_id);
  302. }
  303. }
  304. if(isReplyValue == "True")
  305. {
  306. if(checkExistingTrade(message_id) == false)
  307. {
  308. Print(" --------------- New Replied Message Found ----------------- ", " Message Id: ", message_id, " Reply Message Id: ", reply_to_msg_id);
  309. StringToLower(message);
  310. Print("Message is ",message);
  311. addtoMessageStructure(message_id,message);
  312. }
  313. }
  314. }
  315. //+------------------------------------------------------------------+
  316. //| |
  317. //+------------------------------------------------------------------+
  318. void execute_functionality_on_new_message(int i)
  319. {
  320. string url = url1 + "/get-message/" + IntegerToString(i);
  321. string jsonString = GET_function(url, header);
  322. StringReplace(jsonString,"},", "*");
  323. string message = getJsonStringValue(jsonString,"message",4,"\"");
  324. int group_message_id = (int)getJsonStringValue(jsonString, "message_id");
  325. StringToLower(message);
  326. StringReplace(message,"~","#");
  327. if(checkExistingTrade(group_message_id) == false)
  328. {
  329. string isReplyValue = getJsonStringValue(jsonString, "is_reply");
  330. if(isReplyValue == "True")
  331. {
  332. int reply_to_msg_id = (int)getJsonStringValue(jsonString, "reply_to_msg_id");
  333. message = getJsonStringValue(jsonString, "message");
  334. StringToLower(message);
  335. Print(" ================ Replied Message found of message_id ================ ",reply_to_msg_id);
  336. Print(" ================ Message: ================ ",message);
  337. }
  338. else
  339. {
  340. if(checkExistingTrade(group_message_id) == false)
  341. {
  342. Print(" --------------- New Trade Message Found ----------------- ", " Message Id: ", group_message_id);
  343. StringReplace(message,"~","#");
  344. StringReplace(message,"##", "#");
  345. StringToLower(message);
  346. message = removeExtraSpaces(message);
  347. Print("Message is ",message);
  348. string result[];
  349. string tempResult[];
  350. int indexTemp = 0;
  351. StringSplit(message,'#',tempResult);
  352. for(int j=0; j<ArraySize(tempResult); j++)
  353. {
  354. //result[i] = StringTrimLeft(result[i]);
  355. //result[i] = StringTrimRight(result[i]);
  356. //Print("Temp Result : ", tempResult[i], " index is: ", i);
  357. if(HasAlphanumeric(tempResult[j]))
  358. {
  359. //Print(" contains alphanumeric characters.");
  360. ArrayResize(result,ArraySize(result)+1);
  361. result[indexTemp] = tempResult[j];
  362. indexTemp++;
  363. }
  364. else
  365. {
  366. //Print(" does not contain alphanumeric characters.");
  367. //ArrayResize(indexToDelete,ArraySize(indexToDelete)+1);
  368. //indexToDelete[indexTemp] = i;
  369. //indexTemp++;
  370. }
  371. }
  372. addtoMessageStructure(group_message_id,message);
  373. message(result,message,group_message_id);
  374. }
  375. }
  376. }
  377. }
  378. //+------------------------------------------------------------------+
  379. //| |
  380. //+------------------------------------------------------------------+
  381. void message(string &result[], string message, int message_id)
  382. {
  383. string lineOne[]; // = result[0];
  384. int lineIndex = 0;
  385. string direction = "";
  386. int direction_index = -1;
  387. string symbol = "";
  388. if(ArraySize(result) >= 1)
  389. {
  390. StringSplit(result[0], ' ', lineOne);
  391. if(((StringFind(result[0], "buy", 0) != -1) || (StringFind(result[0], "sell", 0) != -1)))
  392. {
  393. for(int i=0; i<ArraySize(lineOne); i++)
  394. {
  395. if(HasAlphanumeric(lineOne[i]))
  396. {
  397. ArrayResize(lineOne,ArraySize(lineOne)+1);
  398. lineOne[lineIndex] = lineOne[i];
  399. Print("Direction and Symbol: ", lineOne[lineIndex], " index is: ", lineIndex);
  400. if(lineOne[lineIndex] == buy || lineOne[lineIndex] == sell)
  401. {
  402. direction = lineOne[lineIndex];
  403. direction_index = lineIndex;
  404. //Print(" Direction is: ", direction, " Direction Index: ", direction_index);
  405. }
  406. lineIndex++;
  407. }
  408. }
  409. if(ArraySize(lineOne) >= 2)
  410. {
  411. if(direction_index == 0)
  412. {
  413. symbol = lineOne[1];
  414. StringToUpper(symbol);
  415. //Print(" This is Message format One (1). Where Direction is: ", direction, " Symbol: ", symbol);
  416. }
  417. else
  418. if(direction_index > 0)
  419. {
  420. symbol = lineOne[0];
  421. StringToUpper(symbol);
  422. //Print(" This is Message format One (1). Where Direction is: ", direction, " Symbol: ", symbol);
  423. }
  424. }
  425. symbol = symbolMapping(symbol);
  426. double sl = 0;
  427. double tpStore[]; // = result[0];
  428. int tpIndex = 0;
  429. for(int i=0 ; i < ArraySize(result); i++)
  430. {
  431. // result[i] = StringTrimLeft(result[i]);
  432. // result[i] = StringTrimRight(result[i]);
  433. // Print("Result : ", result[i], " index is: ", i);
  434. if((StringFind(result[i], "sl", 0) != -1))
  435. {
  436. string tempSl[];
  437. result[i] = trimString(result[i]);
  438. //Print(" Sl String: ", result[i]);
  439. StringSplit(result[i], ' ', tempSl);
  440. if(ArraySize(tempSl) >= 2)
  441. sl = (double) tempSl[1];
  442. Print("Sl : ", sl);
  443. }
  444. if((StringFind(result[i], "tp", 0) != -1))
  445. {
  446. // Print("Tp : ", result[i], " index is: ", i);
  447. string tempTp[];
  448. result[i] = trimString(result[i]);
  449. StringSplit(result[i], ' ', tempTp);
  450. //double tp = (double) tempTp[1];
  451. ArrayResize(tpStore,ArraySize(tpStore)+1);
  452. if(ArraySize(tempTp) >= 2)
  453. tpStore[tpIndex] = (double) tempTp[1];
  454. Print("Tp : ", tpStore[tpIndex]);
  455. tpIndex++;
  456. }
  457. }
  458. Print("Side:", direction, " Symbol: ", symbol, " Tp Array Size: ", ArraySize(tpStore), " Message Id: ", message_id);
  459. for(int i = 0 ; i < ArraySize(tpStore) ; i++)
  460. {
  461. Print("Side:", direction, " Symbol: ", symbol, " Tp: ", tpStore[i], " Sl: ", sl, " Message Id: ", message_id);
  462. if(direction == buy)
  463. {
  464. placeBuyTrade(symbol, tpStore[i], sl, message_id, lotSize);
  465. }
  466. if(direction == sell)
  467. {
  468. placeSellTrade(symbol, tpStore[i], sl, message_id, lotSize);
  469. }
  470. }
  471. }
  472. }
  473. }
  474. //+------------------------------------------------------------------+
  475. //| |
  476. //+------------------------------------------------------------------+
  477. void placeBuyTrade(string symbol,double tp,double sl, int messageId, double lot_size)
  478. {
  479. double ask = SymbolInfoDouble(symbol,SYMBOL_ASK);
  480. double bid = SymbolInfoDouble(symbol,SYMBOL_BID);
  481. double buySl = sl;
  482. double buyTp = tp;
  483. int ticket = OrderSend(symbol, OP_BUY, lot_size, ask, 3, buySl, buyTp, "Buy Trade Placed.", magic_no, 0, clrBlue);
  484. Print("Buy order Print: Stop Loss: ", buySl, " Take profit: ", buyTp);
  485. if(ticket < 0)
  486. {
  487. Print("Buy Order Failed ", GetLastError());
  488. }
  489. else
  490. {
  491. Print(" Buy Order Is Placed Sucessfully ");
  492. }
  493. }
  494. //+------------------------------------------------------------------+
  495. //| |
  496. //+------------------------------------------------------------------+
  497. void placeSellTrade(string symbol,double tp,double sl, int messageId, double lot_size)
  498. {
  499. double ask = SymbolInfoDouble(symbol,SYMBOL_ASK);
  500. double bid = SymbolInfoDouble(symbol,SYMBOL_BID);
  501. double sellSl = sl;
  502. double sellTp = tp;
  503. int ticket = OrderSend(symbol, OP_SELL, lot_size, bid, 3, sellSl, sellTp, "Sell Trade Placed.", magic_no, 0, clrRed);
  504. if(ticket < 0)
  505. {
  506. Print("Sell Order Failed ", GetLastError());
  507. }
  508. else
  509. {
  510. Print(" Sell Order Is Placed Sucessfully ");
  511. }
  512. }
  513. //+------------------------------------------------------------------+
  514. //| |
  515. //+------------------------------------------------------------------+
  516. void addtoMessageStructure(int message_id,string message)
  517. {
  518. for(int i=0; i < MaxOrders; i++)
  519. {
  520. if(od[i].msgid == -1)
  521. {
  522. od[i].msgid = message_id;
  523. StringToLower(message);
  524. Print(" Message ID ",message_id," of Message = ",message," is added To Structure :: ");
  525. break;
  526. }
  527. }
  528. }
  529. //+------------------------------------------------------------------+
  530. //| |
  531. //+------------------------------------------------------------------+
  532. string trimString(string inputt)
  533. {
  534. // Remove spaces from the left and right sides
  535. int start = 0;
  536. int end = StringLen(inputt) - 1;
  537. // Find the first non-space character
  538. while(start <= end && StringGetCharacter(inputt, start) == ' ')
  539. start++;
  540. // Find the last non-space character
  541. while(end >= start && StringGetCharacter(inputt, end) == ' ')
  542. end--;
  543. // Extract the substring without leading or trailing spaces
  544. return StringSubstr(inputt, start, end - start + 1);
  545. }
  546. //+------------------------------------------------------------------+
  547. //| |
  548. //+------------------------------------------------------------------+
  549. string removeExtraSpaces(string str)
  550. {
  551. string result = "";
  552. int len = StringLen(str);
  553. bool lastWasSpace = false;
  554. for(int i = 0; i < len; i++)
  555. {
  556. string currentChar = StringSubstr(str, i, 1);
  557. if(currentChar == " ")
  558. {
  559. // Skip adding this space if the last character was also a space
  560. if(lastWasSpace)
  561. continue;
  562. lastWasSpace = true;
  563. }
  564. else
  565. {
  566. lastWasSpace = false;
  567. }
  568. result += currentChar;
  569. }
  570. return result;
  571. }
  572. //+------------------------------------------------------------------+
  573. //| |
  574. //+------------------------------------------------------------------+
  575. bool HasAlphanumeric(string str)
  576. {
  577. //Print("String Length: ", StringLen(str));
  578. for(int i = 0; i <= StringLen(str); i++)
  579. {
  580. //Print("Here ", StringLen(str));
  581. if(IsAlphanumeric((char)str[i]))
  582. {
  583. return true;
  584. break;
  585. }
  586. }
  587. return false;
  588. }
  589. //+------------------------------------------------------------------+
  590. //| |
  591. //+------------------------------------------------------------------+
  592. bool IsAlphanumeric(char c)
  593. {
  594. if((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
  595. return true;
  596. return false;
  597. }
  598. //+------------------------------------------------------------------+
  599. //| |
  600. //+------------------------------------------------------------------+
  601. string symbolMapping(string symbol)
  602. {
  603. for(int k = 0; k < ArraySize(symbolChart); k++)
  604. {
  605. StringToUpper(symbolChart[k]);
  606. if(symbol == symbolChart[k])
  607. {
  608. symbol = symbolSnd[k];
  609. }
  610. }
  611. symbol = prefix + symbol + suffix;
  612. return symbol;
  613. }
  614. //+------------------------------------------------------------------+
  615. //| |
  616. //+------------------------------------------------------------------+
  617. //+------------------------------------------------------------------+
  618. //+------------------------------------------------------------------+