+ Reply to Thread
Results 1 to 2 of 2
 3 Attachment(s)    

Thread: How to use iMaOnArray function in EA system?

  1. #1
    Member
    Join Date
    Nov 2008
    Posts
    257

    Default How to use iMaOnArray function in EA system?

    I know how to draw Ma of CCi or RSi on the screen, but how write function witch can be very usefull in almost all ea with CCI,RSi,Laguerre?
    I'm trying to do indi, but bad results .
    Please look:




    #property indicator_separate_window
    #property indicator_buffers 2
    #property indicator_color1 Red
    extern int MA_Period=13;
    extern int MA_Shift=0;
    extern int MA_Method=0;


    extern double gamma=100;
    extern int CountBars=950;
    //---- buffers
    double ExtBuffer0[], ExtBuffer1[];
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function |
    //+------------------------------------------------------------------+
    int init()
    {
    //---- indicators
    IndicatorBuffers(2);

    SetIndexBuffer(0, ExtBuffer0);
    SetIndexStyle(0,DRAW_LINE);
    SetIndexBuffer(1, ExtBuffer1);
    SetIndexDrawBegin(0,gamma);
    // SetIndexStyle(1,DRAW_LINE);
    // SetIndexBuffer(0,ExtMapBuffer1);
    //if(!SetIndexBuffer(0, ExtBuffer0) &&
    // !SetIndexBuffer(1, ExtBuffer1)) return(-1);
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Custom indicator deinitialization function |
    //+------------------------------------------------------------------+
    int deinit()
    {
    //----

    //----
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Custom indicator iteration function |
    //+------------------------------------------------------------------+
    int start()
    {
    int cbars=IndicatorCounted(),i;

    //----
    if(cbars > 0) cbars--;
    for(i = Bars - cbars - 1; i >= 0; i--)
    {
    ExtBuffer1[i] = iCCI(NULL, 0,gamma, PRICE_CLOSE, i);
    // Alert("ema =",ExtBuffer0[i]);
    ExtBuffer0[i] = iMAOnArray(ExtBuffer1[i], Bars, MA_Period, MA_Shift, MA_Method, i);
    //Alert("ema =",ExtBuffer0[i]);

    }
    //----
    return(0);
    }

  2. #2
    Member
    Join Date
    Nov 2008
    Posts
    257

    Default

    ok
    i found one on mql4 forum and modify for CCI,RSI and laguerre.
    try in ea please
    I'm suppose that other indi can use the same way
    Attached Files

+ Reply to Thread

Similar Threads

  1. Function call problem
    By jeandl in forum MQL programming
    Replies: 3
    Last Post: 02-28-2009, 09:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts