string as_string(WaveNoB no){ return EnumToString(no); }
thanks, sorry, I don't understand how to incorporate it, could you rewrite it as for a complete amateur please?
enum WaveNoB { W3, W_3, W4, W_4, W5, W_5 }; extern WaveNoB WaveLong = W3; double delka2 = W2 * Waves / 10000 ; double delka_2 = W_2 * Waves / 10000; double W3 = W2 + delka2; double W_3 = W_2 - delka_2; ObjectCreate("VBox1s3", OBJ_LABEL, "X", 0, 0); ObjectSetText("VBox1s3", "The value selected is " + as_string(WaveLong), 11, "Baskerville Old Face", clrWhite); ObjectSet("VBox1s3", OBJPROP_CORNER, 1); // CORNER MEANS POSITION ON THE CHART 1-4 ObjectSet("VBox1s3", OBJPROP_XDISTANCE, 20); // XDISTANCE ObjectSet("VBox1s3", OBJPROP_YDISTANCE, 40); // YDISTANCE string as_string(WaveNoB no) { return(EnumToString(no)); }
![](https://c.mql5.com/3/394/971027857464.png)
-
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problemWe can't see your broken code.
-
You "can't solve it via if else."
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
Please take some time to first learn the basics of coding in general.
For now just use the following instead ...
ObjectSetText("VBox1s3", "The value selected is " + EnumToString(WaveLong), 11, "Baskerville Old Face", clrWhite);
Please take some time to first learn the basics of coding in general.
For now just use the following instead ...
You are mixing up concepts.
In your code you have variables of the double data-type, named "W3" and "W_3", and you also have an enum with an elements with the same names "W3" and "W_3". Even though you named them the same thing, they are complete different concepts.
You mixing them up because you still don't know the basics of coding, both in general and regarding MQL.
So, please take some time to improve your knowledge about coding basics first before continuing.
You are mixing up concepts.
In your code you have variables of the double data-type, named "W3" and "W_3", and you also have an enum with an elements with the same names "W3" and "W_3". Even though you named them the same thing, they are complete different concepts.
You mixing them up because you still don't know the basics of coding, both in general and regarding MQL.
So, please take some time to improve your knowledge about coding basics first before continuing.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use