# PositionOpen volume param

36

Hello!

The function definition does not give you any info on it, so I do not know what the volume is based on but I am guessing that it means how many lots, so 1 is one lot. And if that is the case, is there a way of finding out the lot size programmatically? Also, is it possible to open positions with a fraction of a lot like 0.7 ?

Ideally what I am really looking for is a way to open positions based on how much money I want to invest and with how much margin in the simplest way possible.

Thanks in advance for the help.

Documentation on MQL5: Standard Library / Trade Classes / CTrade / PositionOpen
• www.mql5.com
Successful completion of the PositionOpen(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request (trade server return code) using ResultRetcode() and value returned by ResultDeal().
Moderator
35417

Azkron:

Hello!

The function definition does not give you any info on it, so I do not know what the volume is based on but I am guessing that it means how many lots, so 1 is one lot. And if that is the case, is there a way of finding out the lot size programmatically? Also, is it possible to open positions with a fraction of a lot like 0.7 ?

Thanks in advance for the help.

Yes volume is always "how many lots".

The value you can use depends of the symbol specifications. Please check the documentation.

36

Alain Verleyen:

Yes volume is always "how many lots".

The value you can use depends of the symbol specifications. Please check the documentation.

Thank you, I found the link very useful. Also is the lot size equal to SYMBOL_TRADE_CONTRACT_SIZE ?

Moderator
35417

Azkron:

Thank you, I found the link very useful. Also is the lot size equal to SYMBOL_TRADE_CONTRACT_SIZE ?

That's the size of 1 lot.

Example: EURUSD, contract size is 100,000 (1 standard lot).

Volume = 0.7 so that means you will trade 70,000 EUR

36

Alain Verleyen:

That's the size of 1 lot.

Example: EURUSD, contract size is 100,000 (1 standard lot).

Volume = 0.7 so that means you will trade 70,000 EUR

Thank you very much! Btw I saw that you live in Belgium and I am currently living in Brussels, let me know if you want to have a beer sometime, I´ll pay of course, given that you are the one answering to all my posts I think is the least I could do :)

Moderator
35417

Azkron:

Thank you very much! Btw I saw that you live in Belgium and I am currently living in Brussels, let me know if you want to have a beer sometime, I´ll pay of course, given that you are the one answering to all my posts I think is the least I could do :)

Maybe one day ;-)