Sorry. I'm not sure how to articulate this. Can I add a number to a variable?
So if I have a variable named double Wave1. How could I add a number to that to rename and create a new variable named double wave2?
dasilvja: Sorry. I'm not sure how to articulate this. Can I add a number to a variable? So if I have a variable named double Wave1. How could I add a number to that to rename and create a new variable named double wave2?
MQL is a compiled language, not an interpreted language, so you cannot change the names of variables during runtime.
You will have to use another mechanism to achieve your goals.
Describe your issue and what you want to achieve and we can try to help you out.
However, I suggest you first dedicate some time to properly learning the MQL coding language properly before attempting to code anything!
dasilvja: So if I have a variable named double Wave1. How could I add a number to that to rename and create a new variable named double wave2?
Use an array, Wave[1], wave[2].
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register