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

Suggestion [HELP] Buat Indikator MT4 base candlestick

Discussion in 'Belajar MQL dari Nol' started by abdul azis, 23 Sep 2016.

  1. abdul azis

    abdul azis New Member

    Equity
    Credit
    Ref Point
    Bantu Buatin indikatornya! Logikanya jika candle2 bear candle3 bear arrow bear di candle2 dan candle3 [vice versa jika bull] .... jika candle2 bear candle3 bull, arrow candle2 sama dengan candle1 bull/bear ... maaf kalo ga jelas.. seperti ini lah gambaranya [​IMG]
     
  2. abdul azis

    abdul azis New Member

    Equity
    Credit
    Ref Point
    ###Update baru segini hasil dari copy paste masih kurang jika candle 2 dan 3 bull bear tidak muncul buffernya

    //--------------------------------------------------------------------
    // indicatorstyle.mq4
    // The code should be used for educational purpose only.
    //--------------------------------------------------------------- 1 --
    [HASHTAG]#property[/HASHTAG] indicator_chart_window // Indic. is drawn in the main window
    [HASHTAG]#property[/HASHTAG] indicator_buffers 2 // Amount of buffers
    [HASHTAG]#property[/HASHTAG] indicator_color1 Red // Color of the first line
    [HASHTAG]#property[/HASHTAG] indicator_color2 Blue // Color of the first line
    double Buf_0[];
    double Buf_1[]; // Indicator array opening
    // Indicator array opening
    //--------------------------------------------------------------- 2 --
    int init() // Special function init()
    {
    SetIndexBuffer(0,Buf_0); // Assigning the array to the buffer
    SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,2);// Line style
    SetIndexLabel (0,"High Line");

    SetIndexBuffer(1,Buf_1); // Assigning the array to the buffer
    SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,2);// Line style
    SetIndexLabel (1,"Low Line");
    return; // Exit spec. function init()
    }
    //--------------------------------------------------------------- 3 --
    int start() // Special function start()
    {
    int i, // Bar index
    Counted_bars; // Amount of calculated bars
    Counted_bars=IndicatorCounted(); // Amount of calculated bars
    i=Bars-Counted_bars-1; // Index of the first uncounted
    while(i>=0) // Cycle for the uncounted bars
    {
    if (Open > Close && Open[i-1] > Close[i-1]) {Buf_0=High; Buf_0[i-1]=High[i-1];} // value 0 of the buffer on ith bar
    if (Open < Close && Open[i-1] < Close[i-1]) {Buf_1=Low; Buf_1[i-1]=Low[i-1]; }
    i--; // Index calculation for the next bar
    }
    return; // Exit spec. function start()
    }
    //--------------------------------------------------------------- 4 --

     
  3. Spetznas

    Spetznas Member Credit Hunter

    Equity
    Credit
    Ref Point
    pls fix sam errors and upoad it thar
     
  4. AutoProfit

    AutoProfit Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    ga paham gan.
     

Share This Page