How to remove a warning in MLQ4?
In this code used to close operations,
appears a warning "possible loss of data due to type conversion" in the line shown below.
Thanks in advance for any possible help. I will appreciate it.
just put (int) before OrderOpenTime()
So it will looks like: ordticket[orders][0] = (int)OrderOpenTime();
just put (int) before OrderOpenTime()
So it will looks like: ordticket[orders][0] = (int)OrderOpenTime();
- You can do that but a long (a datetime) will not fit in an int.
int ordticket[][2]; : ordticket[orders][0] = OrderOpenTime(); ordticket[orders][1] = OrderTicket();
Don't use a 2D array. Use a 1D array of a structure.struct Orders{ int ticket; datetime OOT; } Orders ordticket[]; : ordticket[orders].OOT = OrderOpenTime(); ordticket[orders].ticket = OrderTicket();
just put (int) before OrderOpenTime()
So it will looks like: ordticket[orders][0] = (int)OrderOpenTime();
Thank you. The (int) addition worked fine. Have a good day.
- You can do that but a long (a datetime) will not fit in an int.
- Don't use a 2D array. Use a 1D array of a structure.
I tried your code and appeared not only several warnings, but many mistakes too. Maybe need to be positioned differently. Thank you for the clarification. Have a good day too.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How to remove a warning in MLQ4?
In this code used to close operations,
appears a warning "possible loss of data due to type conversion" in the line shown below.
Thanks in advance for any possible help. I will appreciate it.