Auftrag beendet
Spezifikation
Доброго дня. Есть исходник моего робота .mq5
Ошибок при компиляции нет. Нареканий по работе нет.
Необходимо сделать две копии исходников:
1 в одной из счетов будет прописана блокировка при торговле на реальном счёте, если имя держателя счёта не совпадает с прописанным в коде. В тестере и на демо советник должен работать;
2 в другой необходимо сделать так, чтоб он прошёл проверку на маркете. Сейчас ошибка при тестировании у них:
тест на EURUSD, H1 (неттинг) нет торговых операций тест на XAUUSD, D1 (неттинг) нет торговых операций тест на GBPUSD, M30 (неттинг) нет торговых операций тест на EURUSD, M1 (неттинг) торговых операций соответственно, надо сделать так, чтоб чтоб выскакивала ошибка в журнал. Как рекомендуется:
Рекомендуем тестировать своего торгового робота при заведомо малом размере начального депозита, например, 1 доллар США или 1 евро.
Если проверка показала, что средств на совершение показала операции не хватает, вместо вызова функции OrderSend () выдать в журнал сообщение об ошибке. Примеры проверки:
MQL5
bool CheckMoneyForTrade ( символьная строка двойные лоты, тип ENUM_ORDER_TYPE ) { // --- получим цену открытия MqlTick mqltick; SymbolInfoTick (симв, mqltick); двойная цена = mqltick.ask; если (введите == ORDER_TYPE_SELL ) цена = mqltick.bid; // --- значения необходимой и свободной маржи двойной маржа, free_margin = AccountInfoDouble ( ACCOUNT_MARGIN_FREE ); // --- вызовем функцию проверки если (! OrderCalcMargin (тип, симв, лоты, цена, маржа)) { // --- что-то пошло не так, сообщим и вернем false Распечатать ( "Ошибка в" , __ФУНКЦИЯ__ , "код =" , GetLastError ()); возврат ( ложь ); } // --- если не хватает средств на проведение операции если (маржа> free_margin) { // --- сообщим об ошибке и вернем false Распечатать ( "Недостаточно денег для" , EnumToString (тип), "" , лоты, "" , сим, «Код ошибки =» , GetLastError ()); возврат ( ложь ); } // --- проверка прошла успешно возвращение ( истинный ); }У меня ничего не получается ...