I am looking for a MQL5 script calculating the performance of a product over X days.
Hello Pierre the digits are specified in the DoubleToString function as the second parameter.
Alert("The performance of "+_Symbol+" for the last "+IntegerToString(numberOfDays)+" days is "+DoubleToString(NormalizeDouble(performance,2),2));
Also:
Alert(StringFormat("The performance of %s for the last %d days is %.2f", symbol, numberOfDays, performance));
@Marco vd Heijden @Anthony Garot Thanks.
Hello,
I am looking for a MQL5 script calculating the performance of a product over X days.
I coded that, it must be improvable.
In particular how to remove the zeros after the 2 digits after the decimal point?
Regards,
Pierre