Incorrectly displaying the standard deviation figure despite correct formatting. [SOLVED - CORRECT CODE DISPLAYED]
Right, quite frankly, I have just about had enough of this..
I currently have a snippet of code which returns the standard deviation of a currency pair and displays this in an email which is subsequently sent.
The standard deviation is calculated in the #include file called:
The standard deviation is declared as a variable under:
& is calculated of the variable is as follows:
& so - depending on whether the JPY is present on the chart, an email is sent display the differing standard deviation limits.
The standard deviation variable is a `double ' variable and so it's a floating variable, so it's correctly formatted.
Stick it on a chart, and guess what, I get a standard deviation of 0. Not the actual standard deviation, oh no - because that would be way too simple - I get "0".
If I see an email with 0 as the standard deviation one more time, I will scream.
Why is it incorrectly displaying a standard deviation of zero.
StringFormat("Standard Deviation %0.0f Min %0.0f Max %0.0f",standardDeviation, minStandardDeviationHamVol, maxStandardDeviationHamVol);
StringFormat("Standard Deviation %f Min %f Max %f",standardDeviation, minStandardDeviationHamVol, maxStandardDeviationHamVol);
Print(sqrtEyMinusAveragePow2 / Point);
Saying 0
Print(sqrtEyMinusAveragePow2 / Point);
2023.07.14 09:26:15.395 experimental EURAUD,H1: 0.0
This is despite this exact same code in another function which works perfectly, this is what's infuriating me. It's utter bullshit to be honest.
Right, there is an ongoing issue with Metquotes software which may or may not have been reported:
This:
present = isStandardDeviationNor ? "PASS | " : "FAIL | " + StringFormat("Standard Deviation %f Min %f Max %f", standardDeviation, minStandardDeviationHam, maxStandardDeviationHam);
is resulting in this:
How absolutely stupid is this? Completely ignoring a key element of the code. I have been coding for 10 years and I have never come across such stupidity as I am today. How do you report bugs to Metaquotes?
Furthermore, just to prove my point:
present = isStandardDeviationNor ? "PASS | " : "FAIL | " + "You should be able to see this text.";
is still returning:
Right, there is an ongoing issue with Metquotes software which may or may not have been reported:
This:
is resulting in this:
How absolutely stupid is this? Completely ignoring a key element of the code. I have been coding for 10 years and I have never come across such stupidity as I am today. How do you report bugs to Metaquotes?
Furthermore, just to prove my point:
is still returning:
present = isStandardDeviationNor ? "PASS | " : "FAIL | " + "You should be able to see this text.";
Ternary operator definition: expression1 ? expression2 : expression3
Yellow background is expression printed when true, red background when false.
If you want to append last string to the result of the ternary operator, then use round brackets:
present = ( isStandardDeviationNor ? "PASS | " : "FAIL | " ) + "You should be able to see this text.";
Thank you for your time. All the best :)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Right, quite frankly, I have just about had enough of this..
I currently have a snippet of code which returns the standard deviation of a currency pair and displays this in an email which is subsequently sent.
The standard deviation is calculated in the #include file called:
The standard deviation is declared as a variable under:
double standardDeviation;
& is calculated of the variable is as follows:
& so - depending on whether the JPY is present on the chart, an email is sent display the differing standard deviation limits.
The standard deviation variable is a `double ' variable and so it's a floating variable, so it's correctly formatted.
Stick it on a chart, and guess what, I get a standard deviation of 0. Not the actual standard deviation, oh no - because that would be way too simple - I get "0".
If I see an email with 0 as the standard deviation one more time, I will scream.
Why is it incorrectly displaying a standard deviation of zero.