1. 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 :)
    Dismiss Notice

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

Discussion in 'Belajar MQL dari Nol' started by pejantan_tangguh, 10 Feb 2021.

Tags:
  1. pejantan_tangguh

    pejantan_tangguh New Member

    Equity
    Credit
    Ref Point
    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.
     

    Attached Files:

  2. pejantan_tangguh

    pejantan_tangguh New Member

    Equity
    Credit
    Ref Point
    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
     
  3. Onyx MIB

    Onyx MIB Member

    Equity
    Credit
    Ref Point
    Bro, ini sepertinya sudah pernah aku share solusi nya di t.me/codeMQL ya..
     
  4. 9nix6

    9nix6 New Member

    Equity
    Credit
    Ref Point
    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);
     
  5. AutoProfit

    AutoProfit Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    ngacok, mana bisa seperti ini, ArrHigh adalah array
     
  6. stadevata

    stadevata Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    coba pake ini bang
    https://docs.mql4.com/convert/doubletostring

    mungkin jadinya seperti ini
    Code:
    ArrHigh[i] = DoubleToString(iHighest(_Symbol,_Period,MODE_HIGH,ArrWS[i],0));
     

Share This Page