EA shutting down and synchronizing USDBRL without my command

 

Hi everybody.

 

I am starting to develop EA on MetaTrader 5 and I am having some problems to test it with bovespa. 

I took the example in https://www.mql5.com/en/articles/100 to understand the sintax and develop my algorithm on it because a lot of treatments are already implemented in this example.

I loged in MetaBrasil-Demo to do the tests using VALE3.

When it got the first short signal and created the sell order, it worked succesfully. But when the function OnTick() ended, the EA stops and it calls the function OnDeinit() with result 1 (REASON_REMOVE )

It is also throwing some errors of looking for USDBRL. Why it tries to synchronize USDBRL in a chart of VALE3? That does not make any sense. The EA always uses the _Symbol.

Here is the log generated. Look that I sent the short order, it have synchronized USDBRL(?) and it got errors, the trade worked and it stated the shutdown. 


RQ      0       23:14:47.687    Tester    StopLoss=30
DR      0       23:14:47.687    Tester    TakeProfit=100
FH      0       23:14:47.687    Tester    ADX_Period=8
DF      0       23:14:47.687    Tester    MA_Period=8
QR      0       23:14:47.687    Tester    EA_Magic=12345
FJ      0       23:14:47.687    Tester    Adx_Min=22.00
JH      0       23:14:47.687    Tester    Lot=1000
OO      0       23:14:54.424    Symbols USDBRL: symbol to be synchronized
KG      0       23:14:54.425    Symbols USDBRL: symbol synchronized, 3384 bytes of symbol info received
KL      0       23:14:54.425    History USDBRL: history synchronization started
FH      3       23:14:54.526    History no data synchronized, 27 bytes read
RQ      2       23:14:54.526    Symbols symbol USDBRL history synchronization error
KO      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
EI      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
GK      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
QD      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
RI      0       23:14:54.526    Trade   2016.01.04 10:05:00   exchange sell 1.00K VALE3 at 12.66 sl: 12.96 tp: 11.66 (12.66 / 12.67 / 12.66)
GI      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
QO      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
CN      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
ML      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
OR      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
IQ      2       23:14:54.526    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
DF      0       23:14:54.526    Trades  2016.01.04 10:05:00   deal #2 sell 1.00K VALE3 at 12.66 done (based on order #2)
FE      2       23:14:54.527    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
HK      2       23:14:54.527    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
KE      0       23:14:54.527    Trade   2016.01.04 10:05:00   deal performed [#2 sell 1.00K VALE3 at 12.66]
EP      0       23:14:54.527    Trade   2016.01.04 10:05:00   order performed sell 1.00K at 12.66 [#2 sell 1.00K VALE3 at 12.66]
LS      2       23:14:54.527    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
FR      2       23:14:54.527    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
IR      0       23:14:54.598    my_first_ea (VALE3,M5)  2016.01.04 10:05:00   Alert: A Sell order has been successfully placed with Ticket#:2!!
JS      0       23:14:54.677    Trade   2016.01.04 10:05:00   position closed due end of test at 12.66 [#2 sell 1.00K VALE3 12.66 sl: 12.96 tp: 11.66]
HM      2       23:14:54.677    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
RL      2       23:14:54.677    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
LJ      2       23:14:54.677    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
FH      2       23:14:54.677    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
PG      2       23:14:54.677    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
JE      2       23:14:54.677    Symbols 2016.01.04 10:05:00  no prices for symbol USDBRL (1970.01.01 00:00:00 0.00000, 0.00000)
KN      0       23:14:54.677    Trades  2016.01.04 10:05:00   deal #3 buy 1.00K VALE3 at 12.66 done (based on order #3)
CQ      0       23:14:54.677    Trade   2016.01.04 10:05:00   deal performed [#3 buy 1.00K VALE3 at 12.66]
MR      0       23:14:54.677    Trade   2016.01.04 10:05:00   order performed buy 1.00K at 12.66 [#3 buy 1.00K VALE3 at 12.66]
GK      0       23:14:54.677    Tester  final balance 100000.00 USD
HO      0       23:14:54.714    my_first_ea (VALE3,M5)  2016.01.04 10:05:00   Alert: Reason Deinit: 1
IL      0       23:14:54.754    Tester  VALE3,M5: 61 ticks, 2 bars generated. Environment synchronized in 0:00:00.235. Test passed in 0:00:07.156 (including ticks preprocessing 0:00:00.219).
HN      0       23:14:54.754    Tester  VALE3,M5: total time from login to stop testing 0:00:07.391 (including 0:00:00.344 for history data synchronization)
MJ      0       23:14:54.755    Tester  299 Mb memory used including 7 Mb of history data, 64 Mb of tick data
IQ      0       23:14:54.755    Tester  log file "C:\Users\vinicius\AppData\Roaming\MetaQuotes\Tester\D0E8209F77C8CF37AD8BF550E51FF075\Agent-127.0.0.1-3000\logs\20160720.log" written
OI      0       23:14:55.323    Tester  tester agent shutdown started
NQ      0       23:14:55.456    Tester  shutdown tester machine
CS      0       23:14:55.588    Tester  tester agent shutdown finished


 I thought it would be because it is configured to show values in Dollar(USD), so I tried to change to Brazilian Real(BRL) but i don't  found it.

 I tested the EA in forex with MetaQuotes-Demo and it worked properly.

Does somebody knows whats is happening and how solve it? 

Thank you very much.

 



Guia passo a passo para iniciantes para escrever um Expert Advisor no MQL5
Guia passo a passo para iniciantes para escrever um Expert Advisor no MQL5
  • 2013.12.24
  • Samuel Olowoyo
  • www.mql5.com
A programação de Expert Advisors no MQL5 é simples, e você pode aprender facilmente. Neste guia passo a passo, você verá os passos básicos necessários para escrever um simples Expert Advisor com base em uma estratégia de negócio de desenvolvimento. São apresentados, a estrutura de um Expert Advisor, o uso de indicadores técnicos embutidos e funções de negociação, os detalhes do modo de Depuração e uso do Strategy Tester.
 

Solved.

 

to help those who have the same problem as me, The problem is with MetaBrazil-Demo.

I changed the server and the EA worked properly.