Questions from Beginners MQL5 MT5 MetaTrader 5 - page 9

 
GARI27:

In one article there was a reference to a class of signals for crossing 2 MAs, located in the standard library. There is no such thing in my terminal, or am I dumb? Can you tell me where to download it?

Have a look here.
 
In the profile, in the calculations it says "withdrawal is only possible by the method used to deposit the money". If I top up with a credit card, how can I withdraw? If I deposit with webmoney e.g. If I add 10 Wmz to my account without using it, will I be able to withdraw it? When withdrawing, should it be the same account number or can it be a different number in the same payment system?
 
Withdrawal to WebMoney and PayPal only, but only to the one from which the first deposit was made.
 

In real trading, my EA writes the current Ask, Bid and Spread prices to a file during a trade action. Here is an example:

2012.05.04 16:00:03 Ask=1.31282 Bid=1.31272 Spread=0.00010

2012.05.04 16:00:03 Ask=1.31282 Bid=1.31272 Spread=0.00010

2012.05.04 16:00:03 Ask=1.31282 Bid=1.31272 Spread=0.00010

2012.05.04 16:00:03 Ask=1.31282 Bid=1.31272 Spread=0.00010

2012.05.04 16:00:03 Ask=1.31282 Bid=1.31272 Spread=0.00010

2012.05.04 16:29:26 Ask=1.31468 Bid=1.31452 Spread=0.00016

2012.05.04 16:29:26 Ask=1.31468 Bid=1.31452 Spread=0.00016

2012.05.04 16:29:26 Ask=1.31468 Bid=1.31452 Spread=0.00016

2012.05.04 16:29:26 Ask=1.31468 Bid=1.31452 Spread=0.00016

2012.05.04 16:29:27 Ask=1.3149 Bid=1.31469 Spread=0.00021

2012.05.04 16:29:27 Ask=1.3149 Bid=1.31469 Spread=0.00021

2012.05.04 16:31:25 Ask=1.31219 Bid=1.31201 Spread=0.00018

2012.05.04 16:31:25 Ask=1.31219 Bid=1.31201 Spread=0.00018

2012.05.04 16:31:25 Ask=1.31219 Bid=1.31201 Spread=0.00018

2012.05.04 16:31:27 Ask=1.31194 Bid=1.31175 Spread=0.00019

2012.05.04 16:31:27 Ask=1.31194 Bid=1.31175 Spread=0.00019

2012.05.04 16:31:29 Ask=1.31177 Bid=1.31156 Spread=0.00021

2012.05.04 16:31:29 Ask=1.31177 Bid=1.31156 Spread=0.00021

2012.05.04 16:31:30 Ask=1.31185 Bid=1.31166 Spread=0.00019

2012.05.04 16:31:55 Ask=1.31169 Bid=1.31156 Spread=0.00019

When I run this EA in the tester, the Spread values for the same time may differ from those in the real trade several times, here is an example:

2012.05.04 16:00:00 Ask=1.3128 Bid=1.3127 Spread=0.00010

2012.05.04 16:00:00 Ask=1.3128 Bid=1.3127 Spread=0.00010

2012.05.04 16:29:00 Ask=1.31412 Bid=1.3132 Spread=0.00092

2012.05.04 16:29:00 Ask=1.31412 Bid=1.3132 Spread=0.00092

2012.05.04 16:29:00 Ask=1.31412 Bid=1.3132 Spread=0.00092

2012.05.04 16:29:00 Ask=1.31412 Bid=1.3132 Spread=0.00092

2012.05.04 16:29:00 Ask=1.31412 Bid=1.3132 Spread=0.00092

2012.05.04 16:29:41 Ask=1.31573 Bid=1.31481 Spread=0.00092

2012.05.04 16:29:41 Ask=1.31573 Bid=1.31481 Spread=0.00092

2012.05.04 16:29:41 Ask=1.31573 Bid=1.31481 Spread=0.00092

2012.05.04 16:29:41 Ask=1.31573 Bid=1.31481 Spread=0.00092

2012.05.04 16:29:41 Ask=1.31573 Bid=1.31481 Spread=0.00092

2012.05.04 16:31:31 Ask=1.31228 Bid=1.31202 Spread=0.00026

2012.05.04 16:31:31 Ask=1.31228 Bid=1.31202 Spread=0.00026

2012.05.04 16:31:31 Ask=1.31228 Bid=1.31202 Spread=0.00026

Why is there such a big difference in Spread in testing and real ? I would understand it if the Spread on the real was several times bigger than the Spread in the test, but not the other way around!
 
Spread values during testing are taken from the one-minute history for the instrument. And the maximum spread for the specified minute is written in the history for each minute. You can visually assess the spread values on the history, using the indicator. For example, from the help in the CopySpread section
 

Can you tell me how the TEXT visual component works in the tester?

In trade and debug mode everything is fine, but in tester: d_Lot = StringToDouble(ObjectGetString(0, g_s_Edit_Start_SizeLot, OBJPROP_TEXT));

I get values only == 0

Can you tell me how to get the value of a visual component in the tester?

Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте - Документация по MQL5
 
Graphical objects are not emulated during testing. Therefore, it is better not to rely on them in experts, to do all calculations independently and in such a way that the logic does not depend on the presence of the object on the graph.
 

Good day to all!

i may have searched very badly and the answer to my question has been explained fifty times already, but....

i would like to know if i can drop the optimization task on history from text file to agent calculation?

 

Good day to you all.

I have such a problem:

I need to make a drop down list in the graphical shell of an EA in case of a change in an EA parameter that has the enum type.

I don't understand how to make a "search" with unknown enum type to put values of elements of this type in the list.

Example: Input parameters

-variable of ENUM_TIMEFRAMES type;

output parameters:

-string EnumsNames[]

or

-int EnumsValues[]

so that the function is universal and fits both enums where the numeric representation is {0...n} and to those where the numeric representation is {0..n, p..t ...} or {x1,x2,x3,x4....}

in other words unpredictable.

Since it is meaningless to write a function for each enum type, maybe someone knows how to write one?

Thanks in advance.

Документация по MQL5: Основы языка / Типы данных / Целые типы / Перечисления
Документация по MQL5: Основы языка / Типы данных / Целые типы / Перечисления
  • www.mql5.com
Основы языка / Типы данных / Целые типы / Перечисления - Документация по MQL5
 
mi__x__an:

Good day to you all.

I have such a problem:

It is necessary to make a drop down list in the graphical shell of the Expert Advisor in case of a change in an Expert Advisor parameter, which has the enum type.



Since for each type of enum it is meaningless to write a function, maybe someone knows how to write such a?

I am grateful in advance.

Try to see CComboBox class and function EnumToString. See also this article Create your own graphical panels in MQL5.