Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1205

 

Implemented the Lot increase from the Balance value using the methods suggested above.

double Balance=AccountInfoDouble(ACCOUNT_BALANCE);
//---
double Bal_Flor = Balance/1000;
Lots = MathFloor(Bal_Flor)*0.1;

Everything works and turned out beautifully, thanks.

But ran into a problem when when buying 500 lots there is a breakdown.

2020.04.10 18:27:16.144 2015.01.23 11:04:40   CTrade::OrderSend: instant buy 480.90 position #13406  EURUSD at 1.12743 [done at 1.12743]
2020.04.10 18:27:16.144 2015.01.23 11:04:40   CloseAllPositions
2020.04.10 18:27:16.144 2015.01.23 11:04:40   instant buy 495.1 EURUSD at 1.12743, close #13418 (1.12731 / 1.12743 / 1.12731)
2020.04.10 18:27:16.144 2015.01.23 11:04:40   deal #13419  buy 495.1 EURUSD at 1.12743 done (based on order #13420)
2020.04.10 18:27:16.144 2015.01.23 11:04:40   deal performed [#13419  buy 495.1 EURUSD at 1.12743]
2020.04.10 18:27:16.144 2015.01.23 11:04:40   order performed buy 495.1 at 1.12743 [#13420  buy 495.1 EURUSD at 1.12743]
2020.04.10 18:27:16.145 2015.01.23 11:04:40   CTrade::OrderSend: instant buy 495.10 position #13418  EURUSD at 1.12743 [done at 1.12743]
2020.04.10 18:27:16.145 2015.01.23 11:04:40   -------------Закрыли по Эквити для Sell ---------------
2020.04.10 18:27:16.145 2015.01.23 11:04:40   failed sell limit 515.9 EURUSD at 1.13031 sl: 1.13493 tp: 1.12543 [Invalid volume]
2020.04.10 18:27:16.145 2015.01.23 11:04:40   CTrade::OrderSend: sell limit 515.90 EURUSD at 1.13031 sl: 1.13493 tp: 1.12543 [invalid volume]
2020.04.10 18:27:16.145 2015.01.23 11:04:40   Метод Sell_Limit() потерпел неудачу. Код возврата=10014. Описание кода: invalid volume
2020.04.10 18:27:16.147 2015.01.23 11:04:59   failed sell limit 527 EURUSD at 1.13058 sl: 1.13520 tp: 1.12570 [Invalid volume]
2020.04.10 18:27:16.147 2015.01.23 11:04:59   CTrade::OrderSend: sell limit 527.00 EURUSD at 1.13058 sl: 1.13520 tp: 1.12570 [invalid volume]
2020.04.10 18:27:16.147 2015.01.23 11:04:59   Метод Sell_Limit() потерпел неудачу. Код возврата=10014. Описание кода: invalid volume
2020.04.10 18:27:16.147 2015.01.23 11:05:00   failed sell limit 527 EURUSD at 1.13057 sl: 1.13521 tp: 1.12571 [Invalid volume]

Question.

In our tester, is there a limit on buying the number of lots?

Is there any way around this in the tester?


 
Vladpedro:

Implemented the Lot increase from the Balance value using the methods suggested above.

Everything works and turned out beautifully, thanks.

But ran into a problem when when buying 500 lots there is a breakdown.

Question.

In our tester, is there a limit on buying the number of lots?

Is there any way around this in the tester?


Read the article "What tests a trading robot must pass before it can be published in the Marketplace". All the checks are described there.
Какие проверки должен пройти торговый робот перед публикацией в Маркете
Какие проверки должен пройти торговый робот перед публикацией в Маркете
  • www.mql5.com
Все продукты Маркета перед публикацией проходят обязательную предварительную проверку, так как небольшая ошибка в логике советника или индикатора может привести к убыткам на торговом счете. Именно поэтому нами разработана серия базовых проверок, призванных обеспечить необходимый уровень качества продуктов Маркета. Если в процессе проверки...
 
Vladimir Karputov:
Read the article "What tests a trading robot must pass before it is published in the Marketplace". All the checks are described there.

Thank you, I've read and looked at it. Some of it's already in use.

Restriction on buying lots. found it. It's in the properties of the symbol.

Question removed.

 
Good afternoon. I've been working on this for a long time now and I'm still working on it, but I don't know if I canget it to work or not. The indicator is not visible because of them, when it goes to the top of the basement... The indicator has a small window, but it eats up a lot of space.
 
good evening, any advice for a newbie -...


If I buy a commisioner(5 copies) will all subsequent updates be available? Will they be free for all 5 copies?

 
Councillor
 

Ladies and men, hello to you all! It turns out that I can't learn the language by examples, because everything is either too complicated or too unnecessary like "a+b=c".

I have specific queries, which I cannot figure out. For example, this is the dumbest question. How do I write an EA that draws a line on a chai on a candlestick? Where can I look. If someone is suddenly too lazy to give me an answer, I will be grateful.

 
TestReal:

Ladies and men, hello to you all! It turns out that I can't learn the language by examples, because everything is either too complicated or too unnecessary like "a+b=c".

I have specific queries, which I cannot figure out. For example, this is the dumbest question. How do I write an EA that draws a line on a chai on a candlestick? Where can I look. If someone suddenly feels lazy to give me an answer, I will be grateful.

Example:Four horizontal lines

Four horizontal lines
Four horizontal lines
  • www.mql5.com
Индикатор строит четыре горизонтальные линии: две основные (по умолчанию красные) выше High и ниже Low бара Bar number и вспомогательные (по умолчанию зеленые) с отступом от основных. Правило построения основных линий Правило построений вспомогательных линий Линия DifferenceUP строится по цене HighLowUP ПЛЮС разница между ценами HighLowUP и...
 

Good afternoon.

Can you tell me how to change the size of an array in a structure?

struct NNC
{
   double            nnc_arr_in[];
   double            nnc_arr_out[];
};
NNC my_nnc[];

The structure array changes without any problems

ArrayResize(my_nnc,ind+1);

And how to resize nnc_arr_in[] ?

 
Сергей Таболин:

Good afternoon.

Can you tell me how to change the size of an array in a structure?

The structure array changes without any problems

But how to resize nnc_arr_in[] ?

Resize array nnc_arr_in by 1 more than its size in cell 0 of structure array:

ArrayResize(my_nnc[0].nnc_arr_in,ArraySize(my_nnc[0].nnc_arr_in)+1);