Results 1 to 2 of 2
 3 Attachment(s)    

Thread: How to use iMaOnArray function in EA system?

  1. #1

    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

    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 Attached Files

Similar Threads

  1. Close function
    By fxtester in forum MQL programming
    Replies: 0
    Last Post: 08-20-2014, 14:36
  2. Delete function
    By fxtester in forum MQL programming
    Replies: 0
    Last Post: 08-20-2014, 14:33
  3. Replies: 8
    Last Post: 04-12-2011, 18:28
  4. MT4 e mail function
    By JXBlack in forum MQL programming
    Replies: 4
    Last Post: 07-29-2010, 06:45

Tags for this Thread

100, color, custom indicator, how to, indicator, mql, rsi, system

Posting Permissions

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