position status

 

hello

If my expert is processing several different positions, how can I automatically define separate counters for each position and update these counters in the timer function based on specific conditions? In fact, my goal is to: By selecting each position, as we can get the name of the symbol and its ticket, this time I want to see the counter that I have defined. Note that I do not mean the counter index of the position.

 
Mohammadreza Rahimi :

hello

If my expert is processing several different positions, how can I automatically define separate counters for each position and update these counters in the timer function based on specific conditions? In fact, my goal is to: By selecting each position, as we can get the name of the symbol and its ticket, this time I want to see the counter that I have defined. Note that I do not mean the counter index of the position.

Can not understand anything. Try to write your question in other words (for example, describe ALL the positions and show what you need).

 
Vladimir Karputov:

Can not understand anything. Try to write your question in other words (for example, describe ALL the positions and show what you need).

In fact, I want to define a variable (counter) for each available position.
For example, now when we select a position, we can access information such as price, date, volume, etc. by writing the positiongetdouble code.
It seems that the terminal or server creates a MqlTradeRequest structure variable for each position, I want to make changes within this structure(MqlTradeRequest) to add a new element like counter to this structure

 
Mohammadreza Rahimi :

In fact, I want to define a variable (counter) for each available position.
For example, now when we select a position, we can access information such as price, date, volume, etc. by writing the positiongetdouble code.
It seems that the terminal or server creates a MqlTradeRequest structure variable for each position, I want to make changes within this structure(MqlTradeRequest) to add a new element like counter to this structure

All the same, nothing is clear.

 
Vladimir Karputov:

All the same, nothing is clear.

Vladimir Karputov:

All the same, nothing is clear.

Can I optimize the MqlTradeRequest structure for myself, for example by adding some new variables inside?
 
Mohammadreza Rahimi :
Can I optimize the MqlTradeRequest structure for myself, for example by adding some new variables inside?

No you can not. MqlTradeRequest is a system structure.

 
Vladimir Karputov:

No you can not. MqlTradeRequest is a system structure.

thanks
 
Vladimir Karputov:

No you can not. MqlTradeRequest is a system structure.

You can inherit it into your custom structure to add custom functionality.
 
Mohammadreza Rahimi:

hello

If my expert is processing several different positions, how can I automatically define separate counters for each position and update these counters in the timer function based on specific conditions? In fact, my goal is to: By selecting each position, as we can get the name of the symbol and its ticket, this time I want to see the counter that I have defined. Note that I do not mean the counter index of the position.

If I understand the question correctly you can always define your counters and add them in the comment in your position. On next iteration when you update the counter just update the position comment. This way when select one position and get its comment you can see what is the value of your counter.
 
Georgi Gaydarov:
If I understand the question correctly you can always define your counters and add them in the comment in your position. On next iteration when you update the counter just update the position comment. This way when select one position and get its comment you can see what is the value of your counter.
Thanks, i need two counter 
 
Anonymous3 Geek:
You can inherit it into your custom structure to add custom functionality.
How can customize this structure?