implicit conversion from 'number' to 'string' warning

 

Hey guys,

Ive got a little problem with my mql4 script. I wanted to detect the market for special candlestick patterns. So I wrote a code with a specific condition(1). To keep it easy and short, Ive declared period[x] with all the different timeframes and witha specific chart symbol(2). To check several symbols a time, i thaught that it would be clever to write a and b in one condition with &&. That would save a lot of time and I shouldnt write the whole condition for every symbol. But, as you can probably imagine: It didnt work. It always says: implicit conversion from 'number' to 'string'.

I hope for your help.

if(iClose(a && b,period[x],1)>iOpen(a && b,period[x],0)...
string a="NZDJPY";
string b="GBPUSD";
 
cant find the SRC button..
 
If you are trying to use an array like logic, you failed miserably. Write an array so that it would check the symbol correctly.
 
Timerider:

Hey guys,

Ive got a little problem with my mql4 script. I wanted to detect the market for special candlestick patterns. So I wrote a code with a specific condition(1). To keep it easy and short, Ive declared period[x] with all the different timeframes and witha specific chart symbol(2). To check several symbols a time, i thaught that it would be clever to write a and b in one condition with &&. That would save a lot of time and I shouldnt write the whole condition for every symbol. But, as you can probably imagine: It didnt work. It always says: implicit conversion from 'number' to 'string'.

I hope for your help.

What is the meaning of "NZDJPY" && "GBPUSD" ?

By the way : "a && b" give you a bool (true or false), but iClose and iOpen first parameter is a string.

 
amir_avatar: cant find the SRC button..

Don't paste code
Play video
Please edit your post.
For large amounts of code, attach it.
Reason: