Download MetaTrader 5

CMoneyFixedLot::ValidationSettings - Using micro-lots = 0.01 lots

To add comments, please log in or register
scls19fr
20
scls19fr  

Hello,


I would like to make an expert advisor..

this is my first try....

but I want this EA work with small account... so micro-lots are needed

When I try to run the EA I get this message


2011.10.26 12:21:01    MyFirstEA (EURUSD,M15)    CMoneyFixedLot::ValidationSettings: lots amount must be in the range from 0.100000 to 1000.000000


I would like to know where I should modify the minimal lot value

(I don't want to overwrite MT5 header files... I hope there is a clean way to do this)



Kind regards


Sebastien

Amir Yacoby
1256
Amir Yacoby  

Hello Sebastian,

CMoneyFixedLot is the class money management algorithm, based on trading with predefined fixed lot size.

You need to set the lot size after creating the CMoneyFixedLot object, with Lots method.

Then you need to check the correctness of the setting with ValidationSettings method.

The class is documented here CMoneyFixedLot

 

Regards,

Amir. 

Amir Yacoby
1256
Amir Yacoby  

You can see an example here: http://www.forexnirvana.com/21205-post26.html

Althogh, the Percent() method had already been removed from the class so you don't need it. 

MT5 advisors
  • alan
  • www.forexnirvana.com
Hi Jayman. Btw, if you don't have MT5 you can download Notepad++ and open the mq5 file with that. Notepad++ link: Notepad++ | 5.8.6 It's free btw. Here is the code
Amir Yacoby
1256
Amir Yacoby  

From second reading, I guess you mean to ask another question.

The Micro-Lot account is set when you open the account at the broker level.  

scls19fr
20
scls19fr  
amir_avatar:

From second reading, I guess you mean to ask another question.

The Micro-Lot account is set when you open the account at the broker level.  


Hello,


sorry for being so late to reply...

In fact the problem seems to be that CMoneyFixedLot is not designed for micro-lots account

but I don't know where I should set that mimal lot is 0.01 (and not 0.1 !)


Kind regards


Sebastien

To add comments, please log in or register