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

Mohon Bantuan SoeHoe

Discussion in 'Belajar MQL dari Nol' started by arifx1618, 12 May 2020.

  1. arifx1618

    arifx1618 New Member

    Equity
    Credit
    Ref Point
    Saya sangat pemula membuat indikator Mql4, Sudah berhasil dan tidak ada eror. Tapi pada saat pindah candle indikatornya tidak refresh. mohon solusinya
     
    Last edited by a moderator: 13 May 2020
  2. stadevata

    stadevata Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    saya bantu dalam doa bang ... :giggle::giggle::giggle:
     
  3. blackking

    blackking Well-Known Member Credit Hunter

    Equity
    Credit
    Ref Point
    Apalagi saya yang tidak memahami bahasa pemrograman yang rumit
    mungkin jawabanya ada di google
     
  4. arifx1618

    arifx1618 New Member

    Equity
    Credit
    Ref Point
    Anda Super sekali :rofl:
     
  5. stadevata

    stadevata Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    lha khan ga tau mas nya bikin apa ...
    klo tau mungkin ... mungkin lho yha ... bisa saya bantuin selain doa
    maksudnya upload atau copas code nya di sini mas... biar ada yg mbenerin klo ada yg salah
     
  6. arifx1618

    arifx1618 New Member

    Equity
    Credit
    Ref Point
    Baiklah, ini saya copas kesini yoo..
     
  7. arifx1618

    arifx1618 New Member

    Equity
    Credit
    Ref Point
    input color Color_Fibo = clrAqua;
    input int Style_Level = 2;
    input color Golden_ratio = clrDarkOrange;
    //+------------------------------------------------------------------+
    //|
    //+------------------------------------------------------------------+
    int init()
    {
    T1();
    return(0);
    }
    //+------------------------------------------------------------------+
    //| GASKEUN BRAYYYY !!!!! |
    //+------------------------------------------------------------------+
    int deinit()
    {
    ObjectDelete("EQ_FIBO_");
    ObjectDelete("goldenratio");
    ObjectDelete("GRA");
    ObjectDelete("GRB");
    return(0);
    }
    //+------------------------------------------------------------------+
    //| CALCULATE |
    //+------------------------------------------------------------------+
    int OnCalculate(const int rates_total,
    const int prev_calculated,
    const datetime &time[],
    const double &open[],
    const double &high[],
    const double &low[],
    const double &close[],
    const long &tick_volume[],
    const long &volume[],
    const int &spread[])
    {
    return(rates_total);
    }
    //+------------------------------------------------------------------+
    //| NYIYEUN PUNGSI BRAYYY |
    //+------------------------------------------------------------------+
    void T1()
    {
    ///T1
    int S0 = iLowest(NULL,NULL,MODE_LOW,2,1);
    double s0 = Low[S0];
    double s1 = s0+(High[1]-Open[1]);
    double sd = s1-s0;
    double s2 = s1+sd;

    int D0 = iHighest(NULL,NULL,MODE_HIGH,2,1);
    double d0 = High[D0];
    double d1 = d0-(Open[1]-Low[1]);
    double ds = d0-d1;
    double d2 = d1-ds;

    double Pd = (s1-s2)/(2-1);
    double Pdd = (-1*Pd)+s1;
    double Ps = (d2-d1)/(1-2);
    double Pss = (-1*Ps)+d1;
    double Qe = (Pdd-Pss)/((-1*Pd)+Ps);
    double Pe = (Ps*Qe)+Pss;
    ///T4
    int hisH_4=iHighest(NULL,NULL,MODE_HIGH,4,1);
    int hisL_4=iLowest(NULL,NULL,MODE_LOW,4,1);
    double HisH_4=High[hisH_4];
    double HisL_4=Low[hisL_4];

    int S0_4 = iLowest(NULL,NULL,MODE_LOW,8,1);
    double s0_4 = Low[S0_4];
    double s1_4 = s0_4+(HisH_4-Open[4]);
    double sd_4 = s1_4-s0_4;
    double s2_4 = s1_4+sd_4;

    int D0_4 = iHighest(NULL,NULL,MODE_HIGH,8,1);
    double d0_4 = High[D0_4];
    double d1_4 = d0_4-(Open[4]-HisL_4);
    double ds_4 = d0_4-d1_4;
    double d2_4 = d1_4-ds_4;

    double Pd_4 = (s1_4-s2_4)/(2-1);
    double Pdd_4 = (-1*Pd_4)+s1_4;
    double Ps_4 = (d2_4-d1_4)/(1-2);
    double Pss_4 = (-1*Ps_4)+d1_4;
    double Qe_4 = (Pdd_4-Pss_4)/((-1*Pd_4)+Ps_4);
    double Pe_4 = (Ps_4*Qe_4)+Pss_4;

    double max=MathMax(Pe,Pe_4);
    double min=MathMin(Pe,Pe_4);

    ObjectCreate("EQ_FIBO_",OBJ_FIBO,0,Time[21],max,Time[21],min);
    ObjectSet("EQ_FIBO_",OBJPROP_RAY_RIGHT,1);
    ObjectSet("EQ_FIBO_",OBJPROP_COLOR,clrBlack);
    ObjectSet("EQ_FIBO_",OBJPROP_LEVELCOLOR,clrAqua);
    ObjectSet("EQ_FIBO_",OBJPROP_LEVELSTYLE,2);
    ObjectSet("EQ_FIBO_",OBJPROP_FIBOLEVELS,8);
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+0,-0.618);
    ObjectSetFiboDescription("EQ_FIBO_",0,"GRB~%$");
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+1,-0.382);
    ObjectSetFiboDescription("EQ_FIBO_",1,"GRB~%$");
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+2,0.0);
    ObjectSetFiboDescription("EQ_FIBO_",2,"EQ Low~%$");
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+3,0.382);
    ObjectSetFiboDescription("EQ_FIBO_",3,"GoldenRatio~%$");
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+4,0.618);
    ObjectSetFiboDescription("EQ_FIBO_",4,"GoldenRatio~%$");
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+5,1.000);
    ObjectSetFiboDescription("EQ_FIBO_",5,"EQ High~%$");
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+6,1.382);
    ObjectSetFiboDescription("EQ_FIBO_",6,"GRA~%$");
    ObjectSet("EQ_FIBO_",OBJPROP_FIRSTLEVEL+7,1.618);
    ObjectSetFiboDescription("EQ_FIBO_",7,"GRA~%$");
    }

    Nah itu.. Outputnya fibonacci.. diharapkan pada saat pindah candle ikut berubah juga berdasarkan rumus. tapi ga berubah :(
     
  8. stadevata

    stadevata Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    nah itu ...
    aku ga pinter masalah ginian bang ...

    kliatannya masalahnya karena ga di loop itu bang

    dan

    T1()
    di init hanya load di awal indicator jalan aja ...
    bukannya seharusnya di taruh di oncalculate yha
     
  9. arifx1618

    arifx1618 New Member

    Equity
    Credit
    Ref Point
    siap makasih ..;)
    tak coba pindahin ke oncalculate
    tapi untuk looping itu masalahnya, saya ga pandai buat looping mbanya :(
     

Share This Page