Разговор с искусственным интеллектом (ИИ) о форексе. - страница 7

 

Сложный разговор с ИИ.

ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

вы используете StringTrimRight(value, 1) в своем решении; это неправильный синтаксис для mql5, правильный - StringTrimRight(value);

-

Вы правы, что функция в MQL5 имеет только один параметр , который является строкой, подлежащей изменению. Правильный синтаксис функции выглядит следующим образом:StringTrimRight
int StringTrimRight(string& str);
Эта функция удаляет символы перевода строки, пробелы и табуляции из правой части строки после последнего осмысленного символа и возвращает количество вырезанных символов.

Вот пример того, как можно удалить пробелы из строки:StringTrimRight
string str = "   abcde   \n";
int count = StringTrimRight(str);  // str will be "   abcde" and count will be 2
Если требуется удалить символы с обоих концов строки, можно использовать функцию, которая удаляет символы с обоих концов строки.StringTrim

Вот пример того, как можно удалить пробелы с обоих концов строки:StringTrim
string str = "   abcde   \n";
StringTrim(str);  // str will be "abcde"

Приношу извинения за недоразумения. Пожалуйста, дайте мне знать, если у вас есть еще какие-либо вопросы.



ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ
напишите этот код правильно, с учетом информации, предоставленной в вашем последнем ответе.
string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Split the response string into an array of substrings
string substrings[];
int count = StringSplit(response, ",", substrings);

// Loop through the substrings and find the one that starts with "key2"
for (int i = 0; i < count; i++)
{
  if (StringFind(substrings[i], "key2") == 0)
  {
    // Extract the value for key2 by splitting the substring again
    string keyValuePair[];
    StringSplit(substrings[i], ":", keyValuePair);
    string value = keyValuePair[1];

    // Remove quotes from the value string
    value = StringTrimRight(value, 1);
    value = StringTrimLeft(value, 1);

    // Print the value
    Print(value);
  }
}

-

Для корректного извлечения значения ключа "key2" из строки ответа в MQL5 можно использовать следующий код:

string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Find the start and end indices of the value for key2
int startIndex = StringFind(response, "key2");
if (startIndex >= 0)
{
  startIndex = StringFind(response, ":", startIndex);
  if (startIndex >= 0)
  {
    startIndex += 2;  // Skip the colon and the space after it
    int endIndex = StringFind(response, ",", startIndex);
    if (endIndex < 0)
    {
      // If there is no comma after the value, use the end of the string as the end index
      endIndex = StringLen(response) - 1;
    }

    // Extract the value for key2 using the start and end indices
    string value = StringSubstr(response, startIndex, endIndex - startIndex);

    // Remove quotes from the value string
    StringTrimRight(value);
    StringTrimLeft(value);

    // Print the value
    Print(value);
  }
}

Этот код должен правильно извлечь значение ключа "key2" из строки ответа и распечатать его на консоли.

Надеюсь, это поможет! Дайте мне знать, если у вас есть еще какие-либо вопросы.

Я приношу извинения за путаницу в моих предыдущих ответах. Функции and в MQL5 не принимают никаких аргументов и не изменяют строку на месте. Правильный синтаксис для этих функций выглядит следующим образом:StringTrimRightStringTrimLeft

int StringTrimRight(string& str);
int StringTrimLeft(string& str);

Вот пример того, как можно использовать эти функции для удаления пробелов из строки:

Если требуется удалить символы с обоих концов строки, можно использовать функцию, которая удаляет символы с обоих концов строки.StringTrim

Вот пример того, как можно удалить пробелы с обоих концов строки:StringTrim

string str = "   abcde   \n";
StringTrim(str);  // str will be "abcde"

Приношу извинения за недоразумения. Пожалуйста, дайте мне знать, если у вас есть еще какие-либо вопросы.



ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ
напишите этот код правильно, с учетом информации, предоставленной в вашем последнем ответе.

-

Для корректного извлечения значения ключа "key2" из строки ответа в MQL5 можно использовать следующий код:

string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Find the start and end indices of the value for key2
int startIndex = StringFind(response, "key2");
if (startIndex >= 0)
{
  startIndex = StringFind(response, ":", startIndex);
  if (startIndex >= 0)
  {
    startIndex += 2;  // Skip the colon and the space after it
    int endIndex = StringFind(response, ",", startIndex);
    if (endIndex < 0)
    {
      // If there is no comma after the value, use the end of the string as the end index
      endIndex = StringLen(response) - 1;
    }

    // Extract the value for key2 using the start and end indices
    string value = StringSubstr(response, startIndex, endIndex - startIndex);

    // Remove quotes from the value string
    StringTrimRight(value);
    StringTrimLeft(value);

    // Print the value
    Print(value);
  }
}

Этот код должен правильно извлечь значение ключа "key2" из строки ответа и распечатать его на консоли.

Надеюсь, это поможет! Дайте мне знать, если у вас есть еще какие-либо вопросы.





ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

Неправильно mql5: int count = StringSplit(response, ",", substrings);

Правильный mql5: ushort u_sep=StringGetCharacter(",",0);

int count = StringSplit(response, u_sep, substrings);

напишите этот код правильно, с учетом информации, предоставленной в вашем последнем ответе.

-

Для корректного извлечения значения ключа "key2" из строки ответа в MQL5 можно использовать следующий код:

string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Split the response string into an array of substrings
string substrings[];
ushort u_sep=StringGetCharacter(",",0);
int count = StringSplit(response, u_sep, substrings);

// Loop through the substrings and find the one that starts with "key2"
for (int i = 0; i < count; i++)
{
  if (StringFind(substrings[i], "key2") == 0)
  {
    // Extract the value for key2 by splitting the substring again
    string keyValuePair[];
    u_sep=StringGetCharacter(":",0);
    StringSplit(substrings[i], u_sep, keyValuePair);
    string value = keyValuePair[1];

    // Remove quotes from the value string
    StringTrimRight(value);
    StringTrimLeft(value);

    // Print the value
    Print(value);
  }
}

Этот код должен правильно извлечь значение ключа "key2" из строки ответа и распечатать его на консоли.

Надеюсь, это поможет! Дайте мне знать, если у вас есть еще какие-либо вопросы.




ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

Смотрите ваш последний ответ, есть логическая ошибка:
if (StringFind(substrings[i], "key2") == 0)

"key2" не является индексом 0

Правильно: if ( StringFind(substrings[i], "key2") >= 0)

-

Вы правы, условие не будет правильно идентифицировать подстроку, содержащую "key2".if (StringFind(substrings[i], "key2") == 0)

Чтобы правильно определить подстроку, содержащую "key2", можно использовать функцию для поиска строки "key2" в любом месте подстроки. Если строка найдена, можно извлечь значение "key2" из подстроки следующим образом:StringFind

string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Split the response string into an array of substrings
string substrings[];
ushort u_sep=StringGetCharacter(",",0);
int count = StringSplit(response, u_sep, substrings);

// Loop through the substrings and find the one that contains "key2"
for (int i = 0; i < count; i++)
{
  if (StringFind(substrings[i], "key2") >= 0)
  {
    // Extract the value for key2 by splitting the substring again
    string keyValuePair[];
    u_sep=StringGetCharacter(":",0);
    StringSplit(substrings[i], u_sep, keyValuePair);
    string value = keyValuePair[1];

    // Remove quotes from the value string
    StringTrimRight(value);
    StringTrimLeft(value);

    // Print the value
    Print(value);
  }
}

Этот код должен правильно извлечь значение ключа "key2" из строки ответа и распечатать его на консоли.

Надеюсь, это поможет! Дайте мне знать, если у вас есть еще какие-либо вопросы.




ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

Перепишите эту часть кода:

string value = keyValuePair[1];

таким образом, чтобы индекс:

 keyValuePair[1];

 определяется автоматически

-

Чтобы извлечь значение ключа "key2" из строки ответа без указания индекса значения в массиве, можно использовать следующий код:keyValuePair

string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Split the response string into an array of substrings
string substrings[];
ushort u_sep=StringGetCharacter(",",0);
int count = StringSplit(response, u_sep, substrings);

// Loop through the substrings and find the one that contains "key2"
for (int i = 0; i < count; i++)
{
  if (StringFind(substrings[i], "key2") >= 0)
  {
    // Extract the value for key2 by splitting the substring again
    string keyValuePair[];
    u_sep=StringGetCharacter(":",0);
    StringSplit(substrings[i], u_sep, keyValuePair);

    // Find the index of the value in the keyValuePair array
    int valueIndex = -1;
    for (int j = 0; j < ArraySize(keyValuePair); j++)
    {
      if (StringFind(keyValuePair[j], "key2") < 0)
      {
        valueIndex = j;
        break;
      }
    }

    // Extract the value
    string value = keyValuePair[valueIndex];

    // Remove quotes from the value string
    StringTrimRight(value);
    StringTrimLeft(value);

    // Print the value
    Print(value);
  }
}

Этот код использует вложенный цикл для итерации по массиву и поиска индекса значения. Затем он извлекает значение по этому индексу и удаляет из него кавычки.keyValuePair

Надеюсь, это поможет! Дайте мне знать, если у вас есть еще какие-либо вопросы.




ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

Запишите строку "key2" как внешнюю переменную

-

Чтобы извлечь значение ключа из строки ответа с помощью внешней переменной для ключа, можно использовать следующий код:

string key = "key2";
string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Split the response string into an array of substrings
string substrings[];
ushort u_sep=StringGetCharacter(",",0);
int count = StringSplit(response, u_sep, substrings);

// Loop through the substrings and find the one that contains the key
for (int i = 0; i < count; i++)
{
  if (StringFind(substrings[i], key) >= 0)
  {
    // Extract the value for the key by splitting the substring again
    string keyValuePair[];
    u_sep=StringGetCharacter(":",0);
    StringSplit(substrings[i], u_sep, keyValuePair);

    // Find the index of the value in the keyValuePair array
    int valueIndex = -1;
    for (int j = 0; j < ArraySize(keyValuePair); j++)
    {
      if (StringFind(keyValuePair[j], key) < 0)
      {
        valueIndex = j;
        break;
      }
    }

    // Extract the value
    string value = keyValuePair[valueIndex];

    // Remove quotes from the value string
    StringTrimRight(value);
    StringTrimLeft(value);

    // Print the value
    Print(value);
  }
}

Этот код должен правильно извлечь значение ключа, хранящегося в переменной, из строки ответа и распечатать его на консоли.key

Надеюсь, это поможет! Дайте мне знать, если у вас есть еще какие-либо вопросы.





ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

является логической ошибкой:

string key = "key3";

возвращает: "value3"}

"value3" отображается в скобках }

-

Вы правы, в коде есть логическая ошибка. Функция удаляет только последний символ строки значения, который является закрывающей кавычкой. Чтобы также удалить скобки, можно использовать функцию извлечения строки значения без скобок.StringTrimRightStringSubstr

Вот пересмотренный код:

string key = "key3";
string response = "{\"key1\": \"value1\", \"key2\": \"value2\", \"key3\": \"value3\"}";

// Split the response string into an array of substrings
string substrings[];
ushort u_sep=StringGetCharacter(",",0);
int count = StringSplit(response, u_sep, substrings);

// Loop through the substrings and find the one that contains the key
for (int i = 0; i < count; i++)
{
  if (StringFind(substrings[i], key) >= 0)
  {
    // Extract the value for the key by splitting the substring again
    string keyValuePair[];
    u_sep=StringGetCharacter(":",0);
    StringSplit(substrings[i], u_sep, keyValuePair);

    // Find the index of the value in the keyValuePair array
    int valueIndex = -1;
    for (int j = 0; j < ArraySize(keyValuePair); j++)
    {
      if (StringFind(keyValuePair[j], key) < 0)
      {
        valueIndex = j;
        break;
      }
    }

    // Extract the value
    string value = keyValuePair[valueIndex];

    // Remove brackets and quotes from the value string
    int start = StringFind(value, "\"") + 1;
    int end = StringFind(value, "}", start);
    value = StringSubstr(value, start, end - start);

    // Print the value
    Print(value);
  }
}

Этот код должен правильно извлечь значение ключа, хранящегося в переменной, из строки ответа и распечатать его на консоли.key

Надеюсь, это поможет! 

 

Даже при наличии не содержащей ошибок Технологии обработки информации, ценность результатов её работы будет определяться качеством имеющихся в её распоряжении данных.

А из того "шлака", который, судя по ответам, доступен системе - "конфетку" ждать не приходится.

А так, если из описания шахматного поля, свойств фигур и правил игры система, через отпущенное ей время на самообучение, сможет уделать в шахматы любого из нас, то она действительно толковый инструмент. Иначе - она тупой классификатор.

 
Lilita Bogachkova #:

Сложный разговор с ИИ.

ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

вы используете StringTrimRight(value, 1) в своем решении; это неправильный синтаксис для mql5, правильный - StringTrimRight(value);

-

Вы правы, что функция в MQL5 имеет только один параметр , который является строкой, подлежащей изменению. Правильный синтаксис функции выглядит следующим образом:StringTrimRight
Эта функция удаляет символы перевода строки, пробелы и табуляции из правой части строки после последнего осмысленного символа и возвращает количество вырезанных символов.

Вот пример того, как можно удалить пробелы из строки:StringTrimRight
Если требуется удалить символы с обоих концов строки, можно использовать функцию, которая удаляет символы с обоих концов строки.StringTrim

Вот пример того, как можно удалить пробелы с обоих концов строки:StringTrim

Приношу извинения за недоразумения. Пожалуйста, дайте мне знать, если у вас есть еще какие-либо вопросы.

ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ
почему вы удалили его из кода:
 StringTrimRight(value);
 StringTrimLeft(value);
-

Функции and используются для удаления начальных и конечных пробелов, табуляций и символов перевода строк из строки. В этом случае мы пытаемся убрать скобки и кавычки из строки значения, поэтому эти функции не нужны.StringTrimRight StringTrimLeft

Вместо этого мы можем использовать функцию для извлечения подструбы из строки значения, начиная с индекса первого символа кавычки и заканчивая индексом символа закрывающей скобки.StringSubstr

Надеюсь, это поможет прояснить! Дайте мне знать, если у вас есть еще какие-либо вопросы.
Документация по MQL5: Строковые функции / StringTrimRight
Документация по MQL5: Строковые функции / StringTrimRight
  • www.mql5.com
StringTrimRight - Строковые функции - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

В конце концов ИИ не смог справиться с требованиями, надеюсь, окончательное решение будет сохранено для будущего обучения ИИ.

-


Вот пересмотренный код с примененными изменениями:

string key = "key1";
string response = "{\"key1\":   \" value1 \", \"key2\": \"value2 \", \"key3\": \"value3 \"}";

// Split the response string into an array of substrings
string substrings[];
ushort u_sep=StringGetCharacter(",",0);
int count = StringSplit(response, u_sep, substrings);

// Loop through the substrings and find the one that contains the key
for (int i = 0; i < count; i++)
{
  if (StringFind(substrings[i], key) >= 0)
  {
    // Extract the value for the key by splitting the substring again
    string keyValuePair[];
    u_sep=StringGetCharacter(":",0);
    StringSplit(substrings[i], u_sep, keyValuePair);

    // Find the index of the value in the keyValuePair array
    int valueIndex = -1;
    for (int j = 0; j < ArraySize(keyValuePair); j++)
    {
      if (StringFind(keyValuePair[j], key) < 0)
      {
        valueIndex = j;
        break;
      }
    }

    // Extract the value
    string value = keyValuePair[valueIndex];

    // Remove brackets and quotes from the value string
    int start = StringFind(value, "\"") + 1;
    int end = StringFind(value, "\"", start);

    if (start >= 0 && end > start)
    {
      value = StringSubstr(value, start, end - start);
    }
    StringTrimRight(value);
    StringTrimLeft(value);

    // Print the value
    Print(value);
  }
}

Этот код должен правильно извлечь значение для указанного ключа, удалить начальные и конечные кавычки, а затем удалить все начальные или конечные пробелы. Затем он должен распечатать значение на консоли.

Надеюсь, это поможет! Дайте мне знать, если у вас есть какие-либо дополнительные вопросы.
 
Когда Земля налетит на небесную ось?
 
Stickman #:
Когда Земля налетит на небесную ось?

PROFESSIONAL ADVISOR

When will the Earth hit the celestial axis?

-

The Earth does not hit the celestial axis. The celestial axis is an imaginary line that runs through the Earth's North and South poles and is perpendicular to the plane of the Earth's orbit around the sun. The Earth's axis is tilted at an angle of about 23.5 degrees relative to its orbit, which is what causes the seasons. The Earth does not move along this axis in any way, so there is no risk of it hitting anything.


ПРОФЕССИОНАЛЬНЫЙ КОНСУЛЬТАНТ

Когда Земля столкнется с небесной осью?

-

Земля не попадает в небесную ось. Небесная ось представляет собой воображаемую линию, которая проходит через Северный и Южный полюса Земли и перпендикулярна плоскости орбиты Земли вокруг Солнца. Ось Земли наклонена под углом около 23,5 градусов относительно ее орбиты, что и обуславливает времена года. Земля никак не движется вдоль этой оси, поэтому нет риска ее столкновения с чем-либо.


Как это влияет на торговлю на Форекс? )))

 
Lilita,

1. Волновая теория Эллиота применима к рынку форекс или к любому другому рынку? Является ли Волновая теория Эллиота фейковой теорий, не имеющей ничего общего с ценообразованием?

2. Есть ли логика в ценоообразовании? Что лучше подходит к прогнозированию цен: простые алгоритмы или нейросети?



1. Does Elliot Wave Theory apply to the forex market or any other market? Is the Elliot Wave Theory a fake theory that has nothing to do with pricing?

2. Is there any logic in pricing? What is better for price forecasting: simple algorithms or neural networks?
 
Ivan Butko #:

1.

Elliot Wave Theory is a technical analysis method that attempts to forecast the direction of prices through the identification and interpretation of price patterns. It is based on the idea that prices move in predictable patterns, or waves, that can be identified and analyzed.

The theory was developed by Ralph Elliott in the 1930s and is based on the idea that market trends, as represented by price movements, are not random but rather reflect the collective psychology of market participants. According to the theory, market movements can be predicted by identifying and interpreting the waves, or patterns, that form in the price data.

Elliot Wave Theory is often used by traders and investors to help identify potential trading opportunities and to make investment decisions. While the theory has its supporters, it is also controversial and has been criticized by some for its subjective nature and lack of a clear and objective set of rules for analysis.

As for whether the theory can be applied to the forex market or any other market, it is generally thought that Elliot Wave Theory can be applied to any market where prices are determined by the interaction of supply and demand. This includes not just the forex market, but also stock markets, commodity markets, and other financial markets. However, it is important to note that the effectiveness of the theory in any given market may vary, and it should be used as just one of many tools in an overall trading or investment strategy.

2.

Pricing is determined by the interaction of supply and demand in a market. When the demand for a good or service is high and the supply is low, the price will tend to be higher. Conversely, when the demand is low and the supply is high, the price will tend to be lower. This basic principle of economics is based on the idea that the price of a good or service reflects the value that buyers place on it and the costs that sellers incur in producing it.

As for which is better for price forecasting - simple algorithms or neural networks - it really depends on the specific circumstances and the goals of the forecasting. Both simple algorithms and neural networks can be effective tools for forecasting prices, but they have different strengths and limitations.

Simple algorithms, such as linear regression or moving averages, can be easy to understand and implement, and they may be sufficient for certain forecasting tasks. However, they may not be able to capture complex relationships or patterns in the data, which can limit their accuracy.

Neural networks, on the other hand, are more powerful and flexible tools that can learn and adapt to complex patterns in the data. They are often used for tasks that require a high degree of accuracy, such as image or speech recognition. However, they can be more complex to implement and may require more data and computational resources to train and run.

Ultimately, the choice between simple algorithms and neural networks will depend on the specific forecasting task at hand and the resources and expertise available. It may be necessary to experiment with different approaches and evaluate their performance in order to determine the most effective approach for a given situation.

 
Maxim Dmitrievsky #:

1.

Elliot Wave Theory is a technical analysis method that attempts to forecast the direction of prices through the identification and interpretation of price patterns. It is based on the idea that prices move in predictable patterns, or waves, that can be identified and analyzed.

The theory was developed by Ralph Elliott in the 1930s and is based on the idea that market trends, as represented by price movements, are not random but rather reflect the collective psychology of market participants. According to the theory, market movements can be predicted by identifying and interpreting the waves, or patterns, that form in the price data.

Elliot Wave Theory is often used by traders and investors to help identify potential trading opportunities and to make investment decisions. While the theory has its supporters, it is also controversial and has been criticized by some for its subjective nature and lack of a clear and objective set of rules for analysis.

As for whether the theory can be applied to the forex market or any other market, it is generally thought that Elliot Wave Theory can be applied to any market where prices are determined by the interaction of supply and demand. This includes not just the forex market, but also stock markets, commodity markets, and other financial markets. However, it is important to note that the effectiveness of the theory in any given market may vary, and it should be used as just one of many tools in an overall trading or investment strategy.

2.

Pricing is determined by the interaction of supply and demand in a market. When the demand for a good or service is high and the supply is low, the price will tend to be higher. Conversely, when the demand is low and the supply is high, the price will tend to be lower. This basic principle of economics is based on the idea that the price of a good or service reflects the value that buyers place on it and the costs that sellers incur in producing it.

As for which is better for price forecasting - simple algorithms or neural networks - it really depends on the specific circumstances and the goals of the forecasting. Both simple algorithms and neural networks can be effective tools for forecasting prices, but they have different strengths and limitations.

Simple algorithms, such as linear regression or moving averages, can be easy to understand and implement, and they may be sufficient for certain forecasting tasks. However, they may not be able to capture complex relationships or patterns in the data, which can limit their accuracy.

Neural networks, on the other hand, are more powerful and flexible tools that can learn and adapt to complex patterns in the data. They are often used for tasks that require a high degree of accuracy, such as image or speech recognition. However, they can be more complex to implement and may require more data and computational resources to train and run.

Ultimately, the choice between simple algorithms and neural networks will depend on the specific forecasting task at hand and the resources and expertise available. It may be necessary to experiment with different approaches and evaluate their performance in order to determine the most effective approach for a given situation.

Спасибо! С таким успехом, помимо художников, скоро начнут беспокоиться и преподаватели) И вобще все, кого можно заменить "консультантом")

 
Ivan Butko #:

Спасибо! С таким успехом, помимо художников, скоро начнут беспокоиться и преподаватели) И вобще все, кого можно заменить "консультантом")

Вообще все то же самое можно найти через Гугл и Яндекс. Пока не обнаружил ничего удивительного. Оно и понятно: модель обучалась на массивах открытых источников, интернета. Больше чем там было на момент 21-го года она вам не подскажет.