Please add "NormalizeDouble" block/function (or is there onboard solution?)
-
I tried for weeks to get my desired system running.. always failing at getting eg a fraction of indicator value as pips input.
Means eg calculating a fraction of bollinger bands.. then unsing this value as "GridSize" in grid pending orders.
The calculation outputs correct numbers for bollinger.. but with too many digits.
Hence it is displaying (output via comment block) something like 0.0009354757473274575e5 whereas the value would be 9 Pips.I was able to transform 0.009xx into pips via "Ticksize" and/or "Pointsize" but the calc will result in zero. I guess because of not being able to normalize the value.
In best case i need a way to get from 0.0009xxx to 9 pips.
Or being able to normalize the value to eg 5 digits.I tried to create custom block from this info:
https://docs.mql4.com/convert/normalizedoublebut failed.
I guess this affects all fxDreema users so i think this really would be great benefit in the core system.
What do you think?
How should i handle that numbers in a better way? -
0.0009354757473274575e5 == 0.0009354757473274575e5 * 0.0001 (PointSize) = 9.354757473274575
You can try this:
double CalcResult
double PipsCalcFormula block -> CalcResult * PointSize --> PipsCalc
(PointSize --> MarketProperties->PointSize [Customized or Original])

And display "PipsCalc".
You can add a "Custom MQL" block and apply the NormalizeDouble function to "PipsCalc".
-
@josecortesllobat said in Please add "NormalizeDouble" block/function (or is there onboard solution?):
0.0009354757473274575e5 == 0.0009354757473274575e5 * 0.0001 (PointSize) = 9.354757473274575
You can try this:
double CalcResult
double PipsCalcFormula block -> CalcResult * PointSize --> PipsCalc
(PointSize --> MarketProperties->PointSize [Customized or Original])

And display "PipsCalc".
You can add a "Custom MQL" block and apply the NormalizeDouble function to "PipsCalc".
Thank you very much for your reply.
I already tried with Pointsize (and also TickSize) .. but not working.
I also tried to set the Variable from "double" to "int" which was not working (expected.. but i took the chance..)Would you be able to show me how to do/make that Custom MQL block with NormalizeDouble function?
I tried, but failed

-

-
Ahhh... lightbulb on ..that easy?!
I was thinking way to complicated..Thank you very very much for your help!