Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CCI Moving Average Cross-Over Indicator Development Request

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CCI Moving Average Cross-Over Indicator Development Request

    This is how the indicator looks on MT4.


    The MT4 script are as follows:

    #property indicator_separate_window
    #property indicator_buffers 3
    #property indicator_color1 SteelBlue
    #property indicator_color2 Red
    #property indicator_color3 Yellow

    int cci50 = 50; //initiate the CCI lookup period as 50
    int ma144 = 144; //initiate the MA lookup period as 144
    int ma233 = 233; //initiate the MA lookup period as 233
    double g_ibuf_88[];
    double g_ibuf_92[];
    double g_ibuf_96[];
    double gd_124;
    double gd_132;
    double g_icci_140;

    int init() {
    IndicatorBuffers(3);
    SetIndexBuffer(0, g_ibuf_88);
    SetIndexStyle(0, DRAW_HISTOGRAM);
    SetIndexBuffer(1, g_ibuf_92);
    SetIndexStyle(1, DRAW_HISTOGRAM);
    SetIndexBuffer(2, g_ibuf_96);
    SetIndexStyle(2, DRAW_HISTOGRAM);
    return (0);
    }

    int deinit() {
    return (0);
    }

    int start() {
    int l_ind_counted_4 = IndicatorCounted();
    if (l_ind_counted_4 < 0) return (-1);
    int li_8 = Bars - l_ind_counted_4;
    if (li_8 > Bars) li_8 = Bars;
    for (int li_0 = li_8; li_0 >= 0; li_0--) {
    g_icci_140 = iCCI(NULL, 0, cci50, PRICE_TYPICAL, li_0);
    gd_124 = iMA(NULL, 0, ma144, 0, MODE_EMA, PRICE_CLOSE, li_0) - iMA(NULL, 0, ma233, 0, MODE_EMA, PRICE_CLOSE, li_0);
    gd_132 = iMA(NULL, 0, ma144, 0, MODE_EMA, PRICE_CLOSE, li_0 + 1) - iMA(NULL, 0, ma233, 0, MODE_EMA, PRICE_CLOSE, li_0 + 1);
    g_ibuf_88[li_0] = 0.0;
    g_ibuf_92[li_0] = 0.0;
    g_ibuf_96[li_0] = 0.0;
    if (g_icci_140 > 0.0 && gd_124 > gd_132) g_ibuf_88[li_0] = 1.0;
    else {
    if (g_icci_140 < 0.0 && gd_124 < gd_132) g_ibuf_92[li_0] = 1.0;
    else g_ibuf_96[li_0] = 1.0;
    }
    }
    return (0);
    }

    #2
    Thanks for sharing this and welcome to our forums - if you want to start converting this on your own, please have a look at those helpful tutorials -



    If you would like this professionally coded out for you, consider checking into services provided by those NinjaScript consultants -

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    580 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    335 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    102 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X