2015.03.26 11:44:13.934 test (MIX-6.15,H1) Bingo! We done. 2015.03.26 11:44:13.934 test (MIX-6.15,H1) Init OK.
инструменты в обзоре рынка включены все доступные. счет реал Открытие
переделал тест. кинул именно на MIX со включенными остальными инструментами.
Все ок.
Счет реал в Открытии. Графики Ri и Si тоже открыты.
2015.03.26 13:56:01.024 Test (MIX-6.15,M1) Init OK.
реал Открытие win7 x64 C:\Program Files\ОТКРЫТИЕ-Брокер\terminal64.exe build 1085
Спасибо!
А у меня:
Win7/64 Ultimate MT5 билд 1085
2015.03.26 15:30:37.229 Test (MIX-6.15,M1) Sorry! Get Bars failed. 2015.03.26 15:30:37.229 Test (MIX-6.15,M1) Get Bars failed RTS-6.15 Last error = 4401
А у меня, вообще, на MIX-6.15 "падает", WIN 7-64 home premium МТ5 билд 1085:
2015.03.26 15:44:27.729 Test (MIX-6.15,H1) Get Bars failed MIX-6.15 Last error = 4401 2015.03.26 15:44:27.729 Test (MIX-6.15,H1) Sorry! Get Bars failed.
Пользователи ФОРТС!
Пожалуйста, потратьте 3 мин. времени!
Для исправления "плавающей" ошибки - нужно
БОЛЬШЕ статистики!
Пользователи ФОРТС!
Пожалуйста, потратьте 3 мин. времени!
Для исправления "плавающей" ошибки - нужно
БОЛЬШЕ статистики!
Трачу 3 мин))
Михаил, так делать нельзя - однократным запросом в ините. Нет гарантии, что все данные уже готовы.
Вот так делайте - по смыслу, конечно.
#property copyright "Copyright 2014, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00" #property indicator_separate_window #property indicator_buffers 1 #property indicator_plots 1 // bool is_failed = false; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SymbolSelect( "MIX-6.15", true ); SymbolSelect( "RTS-6.15", true ); SymbolSelect( "Si-6.15", true ); //--- ResetLastError(); //--- int total_bars = Bars( "MIX-6.15", PERIOD_M1 ); if ( total_bars > 0 ) { total_bars = Bars( "RTS-6.15", PERIOD_M1 ); if ( total_bars > 0 ) { total_bars = Bars( "Si-6.15", PERIOD_M1 ); { if ( total_bars > 0 ) { Print( "Init OK." ); } else { is_failed = true; Print( "Get Bars failed Si-6.15 Last error = ", string(GetLastError() ) ); } } } else { is_failed = true; Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) ); } } else { is_failed = true; Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) ); } //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { ResetLastError(); //--- int total_bars = Bars( "MIX-6.15", PERIOD_M1 ); if ( total_bars > 0 ) { total_bars = Bars( "RTS-6.15", PERIOD_M1 ); if ( total_bars > 0 ) { total_bars = Bars( "Si-6.15", PERIOD_M1 ); { if ( total_bars > 0 ) { Print( "Init OK." ); } else { is_failed = true; Print( "Get Bars failed Si-6.15 Last error = ", string(GetLastError() ) ); } } } else { is_failed = true; Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) ); } } else { is_failed = true; Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) ); } //--- if ( is_failed ) { Print( "Sorry! Get Bars failed." ); } else Print( "Bingo! We done."); //--- return value of prev_calculated for next call return(rates_total); }
Мультивалютный индикатор - это не так просто.
Для начала, проверьте доступность инструментов:
bool CorrectSymbol( string symbol ) { ResetLastError(); if ( SymbolInfoDouble( symbol, SYMBOL_BID ) > DBL_EPSILON ) return(true); // символ не выбран в "Обзоре рынка" (нет в списке доступных) if ( GetLastError() == 4302 ) { if ( SymbolSelect( symbol, true ) && SymbolInfoInteger( symbol, SYMBOL_SELECT ) ) return(true); } return(false); }
Потом откройте графики всех используемых инструментов (достаточно невидимого объекта-графика), чтоб нормально загружалась история.
И только потом пробуйте загружать историю с помощью CheckLoadHistory.
Но и этого может быть не достаточно.
Трачу 3 мин))
Михаил, так делать нельзя - однократным запросом в ините. Нет гарантии, что все данные уже готовы.
Вот так делайте - по смыслу, конечно.
Согласен, немного не корректно, переписал код (см. исходный код), НО результат тот же!
2015.03.26 16:20:55.564 Test (MIX-6.15,M1) Sorry! Get Bars failed. 2015.03.26 16:20:55.564 Test (MIX-6.15,M1) Get Bars failed Si-6.15 Last error = 4401
Согласен, немного не корректно, переписал код, НО результат тот же!
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Вы принимаете политику сайта и условия использования
Добрый день!
Опять сервисдекск не может воспроизвести ошибку!
Прошу откомпилировать этот код и "бросить" индикатор на символ MIX-6.15
( не из MetaEditor )
Результаты (будут выведены в закладку Эксперты) прошу опубликовать здесь.