Get reserved margin PER position for MT5 (MQL5)

 

I've been google and searching in the forum but still not able to find the solution, what i need to know is how to get the reserved margin PER position, like:
Position 1: 50$
Position 2: 75$
Position3: 33$

...

You get the idea, important, i'll have DIFFERENT symbols too.

Thanks!

 

OrderCalcMargin().

Please don't post randomly in any section. Your question is not related to the section you posted.

I have moved your topic to the correct section later, please don't create another topic.
 
Alain Verleyen #:

OrderCalcMargin().

Please don't post randomly in any section. Your question is not related to the section you posted.

I have moved your topic to the correct section later, please don't create another topic.
Thanks for the reply, i really don't post it randomly, i though this was the correct section... this is a bout EAs, so i put it in the EA section...

Also " OrderCalcMargin " calcs the margin for a position which is not opened yet, i want to GET, RETRIEVE, the margin used for an OPENED, EXISTING position, thanks.

 
Jose Ma Gassin Perez Traverso #: i really don't post it randomly, i though this was the correct section... this is a bout EAs, so i put it in the EA section...

No, it was moved to "EA" section from the "General" section.

Jose Ma Gassin Perez Traverso #: Also " OrderCalcMargin " calcs the margin for a position which is not opened yet, i want to GET, RETRIEVE, the margin used for an OPENED, EXISTING position, thanks.

It is the exact same thing, whether you want to calculate it before or after, you use the OrderCalcMargin.

Documentation on MQL5: Trade Functions / OrderCalcMargin
Documentation on MQL5: Trade Functions / OrderCalcMargin
  • www.mql5.com
OrderCalcMargin - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Fernando Carreiro #:

No, it was moved to "EA" section from the "General" section.

It is the exact same thing, whether you want to calculate it before or after, you use the OrderCalcMargin.

Actually it was from "Trading Systems", but I think I moved it to "General" firstly, before changing my mind.
 
Fernando Carreiro #:

No, it was moved to "EA" section from the "General" section.

It is the exact same thing, whether you want to calculate it before or after, you use the OrderCalcMargin.

I'm gonna give it a try, will be back with the results :)