Questions from Beginners MQL5 MT5 MetaTrader 5 - page 32

 
Here, it's amazing.
void OnTick()
  {  for(int i=1,i=<60,i++){timeframe=i;
//---
   double J=iClose(   symbol_name,   timeframe,   start_pos);
   
   Print (J);}
  }
//+------------------------------------------------------------------+

'<' - unexpected token klose.mq5 35 20

'i' - variable already defined klose.mq5 35 18

'++' - semicolon expected klose.mq5 35 25

'J' - unexpected token klose.mq5 37 11

'=' - unexpected token klose.mq5 37 12

'=' - unexpected token klose.mq5 37 12



 
for(int x=1;x<=7000; x++)
  {
   
  }

At least look at the documentation, examples, terminal programs to see how the loop is written.

At least via ;

https://www.mql5.com/ru/docs/basis/operators/for

Документация по MQL5: Основы языка / Операторы / Оператор цикла for
Документация по MQL5: Основы языка / Операторы / Оператор цикла for
  • www.mql5.com
Основы языка / Операторы / Оператор цикла for - Документация по MQL5
 
I'll have a look.
 
Amongst the Return Codes of the trading server I found code 10026 "Auto-trading prohibited by server". I wondered how the server determines whether the trade is manual or automatic? It is clear that magic number or frequent trades and night trading can betray, but if everything is under control, then what other parameters can the server use to identify the Expert Advisor?
 
paladin800:

Amongst the Return Codes of the trading server I found code 10026 "Auto-trading prohibited by server". I wondered how the server determines whether the trade is manual or automatic? Sure, the magic number or frequent trades and night trades may betray this, but if the server controls everything, what other parameters are used to detect the Expert Advisor?
See ID MQL5_PROGRAM_TYPE
 
Yedelkin:
See ID MQL5_PROGRAM_TYPE
No, this property is not available to the server. The server simply sends a command to the terminal 'Forbid auto-trading', and the terminal executes it, and gives the specified code to the EA or script when it tries to execute a trade operation. The server does not know what the EA is trading, it just prohibits autotrading.
 
Valmars:
No, this property is not available to the server. The server simply sends a 'Forbid auto-trading' command to the terminal, and the terminal executes it, and issues the specified code to the EA or script when it tries to execute a trade. The server does not know what the EA is trading, it just prohibits autotrading.
Thank you, I have learned something new. I.e., if the server, after banning the trade, allows it, the client will only know about it after restarting the terminal?
 
Yedelkin:
Thank you, this is new. So, if the server allows the trade after it has been banned, the client can only find out about it after restarting the terminal?

In Lite it is prohibited by default. Consequently it does not work.

Then ask support to allow it. And it starts working. No overloading.

 

In the article Trading operations in MQL5 - it's just under "Buy/sell at current price" can anyone know there during action if(!trade.Buy(0.1)) {...} this trade class, before sending an order to the server, does it check for new quotes or should I put Refreshrates before this action?

 
paladin800:

In the article Trading operations in MQL5 - it's just under "Buy/sell at current price" can anyone know there during action if(!trade.Buy(0.1)) {...} this trade class, before sending an order to the server, does it check for new quotes or should I put Refreshrates before this action?

If we are talking about the Buy() method of the Ctrade class, there is Refreshrates() there. This Refreshrates() is triggered particularly if no price is specified in the input parameters of the Buy() method. Have a look at the library.