В дополнение к логике сигналов, позволили бы вы индикатору создавать сигналы на покупку и продажу при переходах «0», чтобы избежать ложной волатильности рынка и получить более надежные сигналы?
В дополнение к логике сигналов, позволили бы вы индикатору создавать сигналы на покупку и продажу при переходах «0», чтобы избежать ложной волатильности рынка и получить более надежные сигналы?
Скажите, какой билд у Вас? У меня на 2898 тестирование на истории не пошло.
Да, с EA проблема.
Строить; 2875
У меня такая конфигурация:
MetaTrader 5 x64 build 2898 started for MetaQuotes Software Corp. Windows 10 build 19042, Intel Core i7-9750H @ 2.60GHz, 26 / 31 Gb memory, 837 / 947 Gb disk, IE 11, UAC, GMT+2 C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075
Вот результат различных запусков индикатора и советника
Тип и название программы | Отладка на исторических данных ( ![]() | Отладка на реальных данных ( ![]() | Прикрепление на график |
---|---|---|---|
Индикатор TRIX Four Colors | Проблем нет | Проблем нет | Проблем нет |
Советник TRIX Four Colors EA | Индикатор сыпет ошибки 'BarsCalculated() returned -1, error code 4806' | Индикатор сыпет ошибки 'BarsCalculated() returned -1, error code 4806' | Индикатор сыпет ошибки 'BarsCalculated() returned -1, error code 4806' |
Мои настройки редактора MetaEditor и терминала MetaTrader
Я получаю те же отчеты, что и конфигурация ниже.
Metatrader 5 x64 build 2875 started for xxx Limited Windows 10 build 19042, AMD Ryzen 7 4800H with Radeon, 12 / 16 Gb memory, 446 / 476 Gb disk, IE 11, UAC, GMT+3 C:\Users\mtbook\AppData\Roaming\MetaQuotes\Terminal\71ADF801542429AK392A1J02T2F6D5095
- TRIX Four Colors: 0 errors, 0 warnings, (No problem)
- TRIX Four Colors EA: BarsCalculated() returned -1, error code 4806
Обновился на билд 2900
MetaTrader 5 x64 build 2900 started for MetaQuotes Software Corp. Windows 10 build 19042, Intel Core i7-9750H @ 2.60GHz, 25 / 31 Gb memory, 835 / 947 Gb disk, IE 11, UAC, GMT+2 C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075
Немного изменилось поведение советника.
скомпилированный индикатор в 2900 лежит в папке data folder]\MQL5\Indicators\TRIX Four Colors.ex5, создание индикатора предполагает его наличие в корне папки Indicators
//--- create handle of the indicator iCustom handle_iCustom=iCustom(m_symbol.Name(),InpWorkingPeriod,"TRIX Four Colors",Inp_TriX_ma_period,Inp_TriX_applied_price); //--- if the handle is not created if(handle_iCustom==INVALID_HANDLE) { //--- tell about the failure and output the error code PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d", m_symbol.Name(), EnumToString(InpWorkingPeriod), GetLastError()); //--- the indicator is stopped early //--- m_init_error=true; return(INIT_SUCCEEDED); }
Тип и название программы | Отладка на исторических данных ( ![]() | Отладка на реальных данных ( ![]() | Прикрепление на график |
---|---|---|---|
Советник TRIX Four Colors EA | Индикатор сыпет ошибки 'BarsCalculated() returned -1, error code 4806' | cannot load custom indicator 'TRIX Four Colors' [4802] Failed to create handle of the iCustom indicator for the symbol EURUSD/PERIOD_CURRENT, error code 4802 | cannot load custom indicator 'TRIX Four Colors' [4802] Failed to create handle of the iCustom indicator for the symbol EURUSD/PERIOD_CURRENT, error code 4802 |

Hi
I am inexperienced with MT5 coding but think I have found two issues with the EA / Indicator Combination:
(a) The BarsCalculated Error
This is caused by the call iCustom call on line 238 of the EA. It has 2 inputs Inp_TriX_ma_period & Inp_TriX_applied_price yet the indicator is expecting 3 as MT5 is counting " input group" TRIX "" as an input also.
238 handle_iCustom = iCustom (m_symbol.Name (), InpWorkingPeriod, "TRIX Four Colors", Inp_TriX_ma_period, Inp_TriX_applied_price);
I found I could make the Bars Calculated error go away by commenting out Line 19 of the indicator.
19 // input group "TRIX"
(b) In the EA when the Indicator is called using "GetArray" as below no data is returned
if (! iGetArray (handle_iCustom, 0, start_pos, count, trix_buffer) ||
! iGetArray (handle_iCustom, 1, start_pos, count, trix_colors))
This appears to be a timing issue as others have come across the same thing.
My fix is not a good one but it did allow me to run the EA in the tester:
The above if statement is replaced by some sleep and while () functions
Sleep (5000);
while (iGetArray (handle_iCustom, 0, start_pos, count, trix_buffer) <= 0) Print ("Error copying Trix_Buffer", GetLastError ());
Sleep (5000);
while (iGetArray (handle_iCustom, 1, start_pos, count, trix_colors) <= 0) Print ("Error copying Trix_Color", GetLastError ());
/ *
if (! iGetArray (handle_iCustom, 0, start_pos, count, trix_buffer) ||
! iGetArray (handle_iCustom, 1, start_pos, count, trix_colors))
{
return (false);
}
* /
I am running Version 5 Build 2875
CPU Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz 3.79 GHz
Ram 48.0 GB (47.9 GB usable)
Lastly - thank you Vladimir for publishing your work & I hope the above will help with refining of the EA.

- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Вы принимаете политику сайта и условия использования
TRIX Four Colors EA:
Торговля по пользовательскому индикатору 'TRIX Four Colors'
Автор: Vladimir Karputov