• Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)

tanya : warning : implicit conversion from 'number' to 'string'

pejantan_tangguh

New Member
Credits
0
Salam profit untuk semua member di forum ini.

Nyubie baru belajar MQL4 mengenai array utk mempersingkat baris perintah

berikut code nya :

string ArrHigh[] = {"H500","H200","H15"};
int ArrWS[] = {30,15,2};

for(int i=0;i<ArraySize(ArrWS);i++)
{
ArrHigh = iHighest(_Symbol,_Period,MODE_HIGH,ArrWS,0); // <--warning
int H500 = iHighest(_Symbol,_Period,MODE_HIGH,ArrWS,0); // <-- running well kl dibikin var statis
}

warning : implicit conversion from 'number' to 'string'

*) bila ada baris perintah yang hilang, barisan perintah sudah dilampirkan.

Sebenarnya ini sudah jalan; tetapi karena ada warning sepertinya ga enak dilihatnya.
Sudah coba menggunakan int, double, (string) tetapi malah muncul error.
Minta tolong bagaimana caranya agar warning tersebut tidak muncul.

Mohon arahan dari para suhu di forum ini.

Terima kasih.
 

Attachments

thanks Godwin, but could you show if ArrHigh[1] is H500 but it's.
I try using stingtoint but error; is there anything command to solve this case.

I'll be thankful if you can show me the way
 
implicit conversion from 'number' to 'string'

This means that you are assigning a numeric value to a string. The message is there to inform you that there may be a bug in your code.
If you are doing this intentionally, you need to cast the number to a string.
This can be done like so:

ArrHigh = (string)iHighest(_Symbol,_Period,MODE_HIGH,ArrWS,0);
 
This means that you are assigning a numeric value to a string. The message is there to inform you that there may be a bug in your code.
If you are doing this intentionally, you need to cast the number to a string.
This can be done like so:

ArrHigh = (string)iHighest(_Symbol,_Period,MODE_HIGH,ArrWS,0);

ngacok, mana bisa seperti ini, ArrHigh adalah array
 
Back
Top