Questions from Beginners MQL5 MT5 MetaTrader 5 - page 41

 
Can anyone suggest how to get (catch) the moment when a position is closed in MT5? Actually we need to get the properties of the last position closed.
 
meaning programmatically
 
SkyTreker:
Can anyone suggest how to get (catch) the moment when a position is closed in MT5? Actually, you need to get the properties of the last closed position.
See OnTrade() and HistoryOrderGet()
 
Good afternoon! Can you give me a hint, I can't manage the query structure. I must have forgotten. Probably something stupid, tympiracy. Actually, I wanted to know what the lot is equal to.
//+------------------------------------------------------------------+
//|                                                     депозита.mq5 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
  Print ( ACCOUNT_BALANCE );
  
   MqlTradeRequest request={0};
      MqlTradeResult result={0};
      
 struct MqlTradeRequest
  {
   ENUM_TRADE_REQUEST_ACTIONS    action=TRADE_ACTION_DEAL;           // Тип выполняемого действия
  
   double                        volume=1;           // Запрашиваемый объем сделки в лотах     
   ENUM_ORDER_TYPE               type=ORDER_TYPE_SELL;             // Тип ордера
   }
   
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
 

I'm switching from MQL4, I cannot understand how to find high and low bar using time+TF. It simply means shift by time and high and low by shifft.

---------------------------------------------------------------

it looks like CopyHigh etc.

int  CopyHigh(
   string           symbol_name,      // имя символа
   ENUM_TIMEFRAMES  timeframe,        // период
   datetime         start_time,       // с какой даты
   int              count,            // сколько копируем
   double           high_array[]      // массив для копирования максимальных цен
   );

Do I have to warp an array to get one value?

+ One more question: for example if i set the hour chart to 19:20 it will give me a high bar that opened at 19:00\and i don't get anything at all\and i get a high bar that opened at 20:00 ?

 
Here, I really don't get it. It's not like that either.
struct MqlTradeRequest
  {
    request.    action=TRADE_ACTION_DEAL;           // Тип выполняемого действия
  
    request.                        volume=1;           // Запрашиваемый объем сделки в лотах     
    request.               type=ORDER_TYPE_SELL;             // Тип ордера
    OrderSend(request,result);
   }
   

'MqlTradeRequest' - struct or class already defined deposit.mq5 20 9

And this is not the case.

struct MqlTradeRequest
  {
    request.    action=TRADE_ACTION_DEAL;           // Тип выполняемого действия
  
    request.                        volume=1;           // Запрашиваемый объем сделки в лотах     
    request.               type=ORDER_TYPE_SELL;             // Тип ордера
    
   }
   
  OrderSend(request,result); 
//---

'MqlTradeRequest' - struct or class already defined deposit.mq5 20 9

I would assume that if stops-profits are not specified, then they don't exist, if a currency pair is not specified, then it is the one on whose chart the robot is, the price of a nimble order according to my intellect also doesn't seem to be necessary! I read English. I am guessing.

And what class is not defined in this structure? The compiler has got stuck in its brain!

AAH! The structure is already defined! It compiled!!!

 
You know, I did.
Print ( ACCOUNT_BALANCE );
   Print (SYMBOL_MARGIN_INITIAL);//Начальная (инициирующая) маржа обозначает размер необходимых залоговых средств в маржинальной валюте для открытия позиции объемом в один лот. Используется при проверке средств клиента при входе в рынок.
  
Got 37 and 42 !!!!!. What's thirty-seven? What's forty-two? I see a balance of 17 155, 43 and what are those numbers?
 
Dimka-novitsek:
You know, put in 37 and 42 !!!!! What's thirty-seven? What's forty-two? I see a balance of 17,155, 57 and what are those numbers?
What does the reference say? https://www.mql5.com/ru/docs/constants/environment_state/accountinformation
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о счете
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о счете
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация о счете - Документация по MQL5
 
Dimka-novitsek:
You know, I put in 37 and 42 !!!!! What is thirty-seven? What's forty-two? I see a balance of 17 155, 43 and what are these numbers?

ACCOUNT_BALANCE is a numeric identifier

correct isAccountInfoDouble(ACCOUNT_BALANCE) andSymbolInfoDouble( Symbol(),SYMBOL_MARGIN_INITIAL)

in other words, the identifier can be represented both alphabetic and numeric

in other words ACCOUNT_BALANCE andSYMBOL_MARGIN_INITIAL are simply numbers

 
THANK YOU!!!
Reason: