Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

GetLotForOpeningPos - MetaTrader 5 Library - MT4/MT5 Resources

author EAcpu | 5 reads | 0 comments |

GetLotForOpeningPos - library for MetaTrader 5

This function returns the lot size based on the deposit currency amount used. Input parameters are represented by three variables:

 Double acquisition of opening position (symbol of string , // currency pair symbol used for lot calculation
 ENUM_POSITION_TYPE direction, // trading direction
 Double the lot size margin // the deposit currency amount used, used to calculate the lot size )

The function uses the library GetLotForOpeningPos.mqh (to be copied to Terminal_data_directory\MQL5\Include), its content should be included in the developed code using the #include directive before using the function at the global level:

 #include


Attachment download

📎getlotforopeningpos.mqh (2.09 KB)

Source: MQL5 #961

Verification code Refresh