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 cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    162 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    157 views
    2 likes
    Last Post CaptainJack  
    Working...
    X