I write EA's under MT4 - what better to do?

 

If I would like to send order to market and I have to round the function or variable (double type) to 4 or 5 decimal points then better to use NormalizeDouble or DoubleToStr function ?


For example we have:


double price_ask, price_bid, lots;


price_ask = Ask+my_function()*Points;

price_bid = Bid+my_function()*Points;

lots = lots_optimized();


What better to do:

NormalizeDouble(lots,2)

or

DoubleToStr(lots,2)

etc ... in order o use it on

OrderSend()

function ?

 

NormalizeDouble.

Otherwise you'll end up passing a string to a function which expects to have a double passed to it.


CB

Reason: