Ошибки, баги, вопросы - страница 3467

 
fxsaber #:


Result.

Нет разницы

void OnDeinit(int reason)
{
};
 
fxsaber #:

The advisor trades and has much higher security requirements than the indicator.

This is a subjective thing.

Я понимаю, что вы говорите. Но я все же придерживаюсь мнения, что он ведет себя не так, как надо. - Здесь я на стороне Фернандо.

 
Fernando Carreiro #:

It's up to the developer to decide how he wants to handle different situations.

Just like with EAs, you can deliberately continue execution if you wish and manage outages or other situations without terminating the EA.

The same can be done with indicators. It shouldn't be forced. The programmer must control how he wants to handle the situation.

The terminal must provide the same behavior for both advisors and indicators, as implemented in MT4.

It should be up to the developer to decide how they want to handle the various cases.

Just as in EAs, one can that purposely continue execution and manage the disconnections or other situations if one wishes without termination of the EA.

The same can also be done for indicators. It should not be forced. It should be under the programmer's control of how they wish to handle the situation.

The terminal should allow the same behaviour both on EAs and Indicators, just as it is implemented in MT4.

Я понимаю, почему его не удаляют, но возвращаемое значение на данный момент просто "съедается" терминалом. Так не должно быть.

На самом деле имеет смысл держать индикатор на графике. Тем не менее, обработка возвращаемого значения должна быть последовательной. - Возможно, было бы хорошо добавить еще одну причину инициализации. Так что индикатор фактически удаляется.
 
Alexey Viktorov #:

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

Я рад за Вас, Алексей.
Но речь, про то, что используется не одним, а многими. 
Поэтому женщина не подходит для подобной аналогии.
 
Dominik Egert # : I understand why it is not removed, but the return value is currently just "eaten" by the terminal. It should not be. It actually makes sense to keep the indicator on the chart. However, the processing of the return value must be consistent. - Perhaps it would be good to add another reason for initialization. So the indicator is effectively removed.

Да, я могу пойти на компромисс с двумя кодами возврата (примерно так):

  • INIT_FAILED_WARNING (по умолчанию, только сообщает об этом, но остается активным)
  • INIT_FAILED_ERROR (который сообщит об этом и удалит)

Yes, I can accept a compromise with two return codes (something like this):

  • INIT_FAILED _WARNING (default, which will only report it but remain active)
  • INIT_FAILED_ERROR (which will report and remove it)
 
Fernando Carreiro #:

Да, я могу пойти на компромисс с двумя кодами возврата (примерно так):

  • INIT_FAILED_WARNING (по умолчанию, только сообщает об этом, но остается активным)
  • INIT_FAILED_ERROR (который сообщит об этом и удалит)

Yes, I can accept a compromise with two return codes (something like this):

  • INIT_FAILED _WARNING (default, which will only report it but remain active)
  • INIT_FAILED_ERROR (which will report and remove it)

И в дальнейшем его следует последовательно применять как к индикаторам, так и к советникам, и это следует документировать.

And as a follow-up, it should be applied consistently to both Indicators and EAs, and it should be documented.
 
Fernando Carreiro #:

Это абсолютно смешно (не вы, я имею в виду MetaQuotes).

Если на МТ4 оно работает корректно, то это не фича — это явный баг. Это даже не объяснено в документации, а объясняется так, как это практикуется в реализации МТ4.

Когда советник выходит из строя, он также удаляется с графика. Почему бы индикатору не следовать той же процедуре?

That is absolutely ridiculous (not you, I mean MetaQuotes).

If it works correctly on MT4, then it is not a feature — it is a blatant bug. It is not even explained in the documentation, and it is explained in the way it is practice in the MT4 implementation.

When an EA fails, it is also removed from the chart. Why would an indicator not follow the same procedure.

Это было сделано специально больше 15 лет назад, чтобы предотвратить массовое исчезновение индикаторов с графиков.

Индикатор остаётся на графике, но он не работает, так как не получает событий OnCalculate, OnTimer, OnChartEvent

 
Dominik Egert #:

Также попробуйте мой пример кода.

Вы просто не в курсе архитектурной особенности индикаторов - внутренний счетчик. Видимо, вам нужно прописать эту строку.

int OnInit()
{
    printf("GetTickCount: %llu", GetTickCount());


    indicator_shortname = ::MQLInfoString(MQL_PROGRAM_NAME);
    const int wnd_count  = (int)ChartGetInteger(ChartID(), CHART_WINDOWS_TOTAL);        
    for(int wndptr = NULL; (wndptr < wnd_count) && (indicator_handle == INVALID_HANDLE); wndptr++)
    {
        for(int ind_cnt = ChartIndicatorsTotal(ChartID(), wndptr) - 1; (ind_cnt >= NULL) && (indicator_handle == INVALID_HANDLE); ind_cnt--)
        { indicator_handle = (ChartIndicatorName(ChartID(), wndptr, ind_cnt) == indicator_shortname) ? ChartIndicatorGet(ChartID(), wndptr, indicator_shortname) : indicator_handle; }
        indicator_subwnd_id = (indicator_handle != INVALID_HANDLE) ? wndptr : indicator_subwnd_id;
    }
    printf("Indicator handle: %i", indicator_handle);
    IndicatorRelease(indicator_handle);
    
    return((indicator_subwnd_id != -1) ? INIT_SUCCEEDED : INIT_FAILED);
}
 
Slava # : Это было сделано специально больше 15 лет назад, чтобы предотвратить массовое исчезновение индикаторов с графиков. Индикатор остаётся на графике, но он не работает , так как не получает событий OnCalculate, OnTimer, OnChartEvent

Я могу принять эту аргументацию, но если это было сделано 15 лет назад, то почему это не было должным образом задокументировано?

I can accept the reasoning, but if it was done 15 years ago, why was it not documented properly?

 
fxsaber #:

b4158, порядок входных влияет на результат MathMin/MathMax.

Строка для поиска: Uluchshenie 081.

В этом ошибки нет - функция MathMin\MathMax возвращает минимальное\максимальное из двух числовых значений. Соответственно, если числа равны, то результат функции неопределен - она может вернуть любое из них

Причина обращения: