Download MetaTrader 5

Libraries: Lot_Volume

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
188043
MetaQuotes Software Corp.  

Lot_Volume:

The automatic calculation of the lot size from the specified percent of free assests.

Author: Andrey

James Malwitz
34
James Malwitz  

could you please tell me where in the code do you specify the (10%) i keep getting errors if possible post a syntax example

thanks

Jim

MQL4 Comments
16319
MQL4 Comments  
Jedimedic77:

could you please tell me where in the code do you specify the (10%) i keep getting errors if possible post a syntax example

thanks

Jim


Same problem i'm going through!!!

How do we specify whether in % or just digit...

Roberto Dasso
99
Roberto Dasso  
Jedimedic77:

could you please tell me where in the code do you specify the (10%) i keep getting errors if possible post a syntax example

thanks

Jim

Hi Jedimec

I did not originated this discussion but I am very interested in having some help with the same issue.

I am using this code to calculate lot size:


double Lots=NormalizeDouble(AccountBalance()*Risk/100000/Digits/Trail_Stop/10,2);

But this code is only suitable for a USD pair, where USD is the terms currency and the other exchange is the base currency.

I am using another code for pair that uses USD as the base currency, the code I use in that case is:

double Lots=NormalizeDouble(AccountBalance()*Risk*Ask/100000/Digits/Trail_Stop/10,2);

But neither of this two codes can calculate the lot size for other pairs, like EURGBP, EURJPY,CHFJPY, where there is no USD currency.

In the case of not USD pairs, what can I do?

By the way, my AccountBalance is un USD Dollars.

best regards

To add comments, please log in or register