Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1193

 
Artem Mordvinkin:

got it, let's go like this

Given (characters name)


Code (fragments)


Select cable in the tester for example


Run it and

2020.03.09 19:19:45.766 symbol EURUSDrfd does not exist

2020.03.09 19:19:45.766 symbol USDJPYrfd does not exist

2020.03.09 19:19:45.766 symbol AUDUSDrfd does not exist

There is no error on cable - it is selected by default in the tester

Check the history - with such an exotic name it is likely that the history is only two weeks old (exaggerated). Always check the test on a test server MetaQuotes-Demo, and only then all sorts of exotics.

And read the help a hundred times - you cannot just do SymbolSelect - without checking the RESULT of execution.

 
Vladimir Karputov:

Example of creating an iMA indicator on 'USDJPY' symbol, with the tester running on 'EURUSD'.

The result is correct. First the symbol is selected and then the indicator is created based on it.


And where did you specify the name of the symbol (so that it also works out the euro)?

 
Artem Mordvinkin:

And where did you specify the name of the symbol (so that it also works out the euro)?

Example of creating an iMA indicator on 'USDJPY' symbol, with the tester running on 'EURUSD'.'USDJPY' is defined in parameters. The tester is run on'EURUSD'. What exactly is not clear?

 
Vladimir Karputov:

Check the history - with such an exotic name it is likely that the history is only two weeks old (exaggerated). Always check the test on MetaQuotes-Demo test server, and only then on exotics.

And read the help a hundred times - you can not just do SymbolSelect - without checking the RESULT of execution.

There's a nuance - not the first year I read and do something in MQL, and it works, damn it:)

Maybe a bug in symbols (in their names), but then it wouldn't work at all.

 
Vladimir Karputov:

Example of creating an iMA indicator on 'USDJPY' symbol, with the tester running on 'EURUSD'.'USDJPY' - set in parameters. The tester runs on'EURUSD'. What exactly is not clear?

I've already done it - I thought it was not in the code itself.

And

2020.03.09 20:12:36.212 2010.01.01 00:00:00 cannot load indicator 'Moving Average' [4801]

2020.03.09 20:12:36.212 2010.01.01 00:00:00 Failed to create handle of the iMA indicator for the symbol GBPUSDrfd/PERIOD_H1, error code 4801


UPD

handle_iMA=iMA("EURUSDrfd",Period(),Inp_MA_ma_period,Inp_MA_ma_shift,
                  Inp_MA_ma_method,Inp_MA_applied_price);

Set to euro symbol - works.

Selecting cable... and the rest you've already read from above :)

To sum it up, the issue is in the build, not in the board. Broker - well known Russian (in the register of the Central Bank, and there are only 4 of them) On the battle - it works. In the tester - does not add symbols to market overview. Why - question to developers. They have thrown the topic into "newcomers' questions", and should not.

 
Artem Mordvinkin:

Done already - thought it wasn't in the code itself.

And.

2020.03.09 20:12:36.212 2010.01.01 00:00:00 cannot load indicator 'Moving Average' [4801]

2020.03.09 20:12:36.212 2010.01.01 00:00:00 Failed to create handle of the iMA indicator for the symbol GBPUSDrfd/PERIOD_H1, error code 4801


UPD

Set to euro symbol - works.

Selecting cable... well, you've already read the rest at the top :)

Forum on trading, automated trading systems & strategy testing

FAQ from Beginners MQL5 MT5 MetaTrader 5

Vladimir Karputov, 2020.03.09 18:07

You should check the history - with such an exotic name, the history is probably only two weeks old (exaggerated). Always check the test on the test server MetaQuotes-Demo, and only then on any exotics.

***


What are the settings in the TERMINAL, by the number of BARS on the chart?

 
Vladimir Karputov:

History since 2000 and everything worked 2 days ago (not an argument - I understand)

Read the help a hundred times - well isn't that the result:

2020.03.09 19:19:45.766symbol EURUSDrfd does not exist

2020.03.09 19:19:45.766 symbol USDJPYrfd does not exist

2020.03.09 19:19:45.766 symbol AUDUSDrfd does not exist

 
Vladimir Karputov:


What is the setting in the TERMINAL, for the number of BARs on the chart?

100,000 bars in the window

Does this affect the "symbol does not exist"?

 
Artem Mordvinkin:

100,000 bars in the window

Does this affect the "symbol doesn't exist"?

If there are few bars and the test date is very early and does not overlap the bars, there will be errors.

And I gave you the code that works on all my servers. I don't understand what you have there. Test it on a normal server, and then find out why it doesn't work on an exotic server.
 
Artem Mordvinkin:

History since 2000 and everything worked 2 days ago (not an argument - I understand)

Read the help a hundred times - well isn't that the result:

2020.03.09 19:19:45.766 symbol EURUSDrfd does not exist

2020.03.09 19:19:45.766 symbol USDJPYrfd does not exist

2020.03.09 19:19:45.766 symbol AUDUSDrfd does not exist

A string of the following form

symbol ИМЯСИМВОЛА does not exist

only indicates that the symbol name does not exist - you are doing something wrong. You are setting the symbol name incorrectly. Before selecting a symbol, print the value of the symbol. Maybe you put a space on the left or right in the name - you don't see a space, but the symbol turns out to have the wrong name.

Документация по MQL5: Предопределенные переменные / _Symbol
Документация по MQL5: Предопределенные переменные / _Symbol
  • www.mql5.com
Предопределенные переменные / _Symbol - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Reason: