additional decimal points for lotsize

 

Hello everyone,

im trying to add the decimal points for the lotsize that my expert advisor can handle. currently it is only using 2 decimal places that is 0.01 but i would like it to use 0.015, i have tried to do this with NormalizeDouble function but im not getting the desired result. is there another way of doing this?

 
nduru22 :

Hello everyone,

im trying to add the decimal points for the lotsize that my expert advisor can handle. currently it is only using 2 decimal places that is 0.01 but i would like it to use 0.015, i have tried to do this with NormalizeDouble function but im not getting the desired result. is there another way of doing this?

Are you validating your Lot size against MarketInfo() MODE_LOTSTEP and MODE_MINLOT ? for example, if your LOTSTEP is 0.01 then 0.015 is not valid
 
RaptorUK :
Are you validating your Lot size against MarketInfo() MODE_LOTSTEP and MODE_MINLOT ? for example, if your LOTSTEP is 0.01 then 0.015 is not valid


Let me check on that...
 
RaptorUK :
Are you validating your Lot size against MarketInfo() MODE_LOTSTEP and MODE_MINLOT ? for example, if your LOTSTEP is 0.01 then 0.015 is not valid


thanks, you are right. SO there is no way that I can add the last point??
 
  1. No. There is no way. Your broker does NOT allow it.

    The standard lot is 100,000 (~$10.00 USD/pip/lot.) Some brokers have mini accounts where one lot is 10,000 (symbols are different, like "EURUSDm" or "EURUSD.."). In those accounts, 0.01 lot is $0.01 per pip and a 100 pip SL risks $1.00.

  2. Do not use NormalizeDouble, ever - it's use is always wrong. You are assuming that lotStep is a multiple of 10 (0.1 or 0.01) The code fails for any other step. Do it right.
Reason: