Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 401

 
If such questions arise, I ask and get an answer on the Frechev forum, of course it's hard to choose the right one out of all the advice.
 

sergeev:

yan720:


Can you tell me, does AccountEquity() query the terminal or the broker?

to the terminal

Thank you. It appears that this information is sent to the terminal with every packet...

And where can I see which functions are addressed to the broker and which to the terminal? Or maybe there is a list of data (variables) that are transmitted from the broker to the terminal all the time, and/or those that need to be received on a separate request?

 
//|+-------------------------------------------------------------------------------------------------------+
int Accounting_Orders()
{
int Counter_Orders = 0;
//|+-------------------------------------------------------------------------------------------------------+
ArrayCopy (Massif_Old_Orders, Massif_New_Orders);
Counter_Orders = 0;
ArrayInitialize (Massif_New_Orders,0);
ArrayInitialize (Massif_All_Orders,0);
//|+-------------------------------------------------------------------------------------------------------+
for(int q = 0; q < OrdersTotal(); q++)
{
if( (OrderSelect(q,SELECT_BY_POS)==true) && (OrderSymbol() == Symbol()) )
{
Counter_Orders++;
Massif_New_Orders[Counter_Orders][1] = OrderOpenPrice();
Massif_New_Orders[Counter_Orders][2] = OrderStopLoss();
Massif_New_Orders[Counter_Orders][3] = OrderTakeProfit();
Massif_New_Orders[Counter_Orders][4] = OrderTicket();
Massif_New_Orders[Counter_Orders][5] = OrderLots();
Massif_All_Orders[OrderType()]++;
Massif_New_Orders[Counter_Orders][6] = OrderType();
Massif_New_Orders[Counter_Orders][7] = OrderMagicNumber();
//|+-------------------------------------------------------------------------------------------------------+
if ( OrderComment() == "" )
{
Massif_New_Orders[Counter_Orders][8] = Order_False;   
}
else
{
Massif_New_Orders[Counter_Orders][8] = Order_True;
}
//|+-------------------------------------------------------------------------------------------------------+
Massif_New_Order[0][0] = Counter_Orders;
//|+-------------------------------------------------------------------------------------------------------+
return;
  }
//|+-------------------------------------------------------------------------------------------------------+
How do I use the order accounting function, specifically the arrays that make it up?

Option 1.
I assume you have to insert certain arrays in identified places in the code.
For example:
OrderSend(Massif_New_Orders[Counter_Orders][4], // Уникальный номер 1.
Massif_New_Orders[Counter_Orders][6],           // Тип .
Massif_New_Orders[Counter_Orders][5],           // Кол - во лотов, при торге.
Massif_New_Orders[Counter_Orders][1],           // Тип части бара, на котором происходит открытие позиции.
10,                                             // Допустимое проскальзование.
Massif_New_Orders[Counter_Orders][2],           // Остановка потерь.
Massif_New_Orders[Counter_Orders][3],           // Принятие прибыли. 
Massif_New_Orders[Counter_Orders][7]);          // Уникальный номер 2.
Then my mind begs another question:

- Is it worth using arrays at all? -.
I understand that arrays are used for single-type variables, but the order-keeping function "doesn't smell" of single-type variables.

Option 2.
I think the already assigned array function is called when there is a need to use stored order (order) data.
For example:

if(Old_Sistem = 12475)                         //Если расчет объема торга надо вести по объему торга предыдущих ордеров,
{                                              //то 
O_Lots = Massif_New_Orders[Counter_Orders][5]; //вызывается значение лота предыдущего ордера из накопленной информации о ордерах.
}                                              //Конец.
 
yan720:



Thank you. It appears that this information is transmitted to the terminal with each packet...

And where can I see which functions are addressed to the broker and which to the terminal? Or maybe there is a list of data (variables) that are transmitted from the broker to the terminal all the time, and/or those that need to be received on a separate request?

Trading functions. Only they send a request specifically to the trade server and receive a response from it.
 
Link_x:
How to use the order accounting function, specifically the arrays that make it up?

Option 1.
I assume you have to insert certain arrays in identified places in the code.
For example:
Then my mind begs another question:

- Is it worth using arrays at all? -.
I understand that arrays are used for single-type variables, but the order-keeping function "doesn't smell" of single-type variables.

Option 2.
I think the already assigned array function is called when there is a need to use stored order (order) data.
For example:

I think it's a waste of time. All information about open and closed orders is stored in the terminal. Why duplicate it in arrays? It is important to learn how to extract it from the terminal.
 
yan720:

Thank you. It appears that this information is transmitted to the terminal with every packet...

It's not a fact that Equity is transmitted all the time.

It is more likely that it is calculated by the terminal itself, based on your open positions.

And where can you see which functions are addressed to the broker and which to the terminal?

Nowhere. Just use your common sense.

 
khorosh:
I think it is a waste of time. All information about open and closed orders is stored in the terminal. Why duplicate it in arrays? The important thing is to learn how to extract it from the terminal.


Such information is probably extracted by certain command.
Is it OrderSend?
 
Link_x:

Such information is probably retrieved by a specific command.
Is it OrderSend?
This is sending a trade request to the server.
 
Link_x:

Such information is probably retrieved by a specific command.
Is it OrderSend?
Read up on KimIV functions and you will see that most of them are designed to retrieve some kind of information about open or closed orders.
 
artmedia70:
This is sending a trade request to the server.


Ouch.

I meant OrderSelect.


khorosh:
Read about KimIV functions and you will see that most of them are designed to retrieve some information about open or closed orders.

Once again, while trawling through the pages of the tutorial, came across a misunderstanding about the use of the "Order Accounting" function. Decided to ask.
The KimIV functions are difficult to grasp, but I will consider every detail (even though it is irrational).
Ooh, about the PC, TV, phone example - very good example. Now I've been thinking about the structure of my TV and I've come to the conclusion that I know very well how my TV is set up (it was three years ago when my parents caught me disassembling it that I first got access to the Internet).
Reason: