Mon compte
Déjà membre ? S'identifier
Non inscrit ? S'inscrire
 
+ Répondre à la discussion
Affichage des résultats 1 à 2 sur 2
  1. #1
    Nouveau membre Cqilosa est sur la route de la réputation...
    Date d'inscription
    June 2011
    Messages
    1
    Pouvoir de réputation
    3

    Installer une alerte sonore ou visuel pour l'indicateur programmé "centre" Installer une alerte sonore ou visuel pour l'indicateur programmé "centre"

    Je trouve cette indicateur vraiment utile pour un débutant comme moi , et j'aimerai y ajouté une alerte sonore (ou visuel dans le pire des cas) pour pouvoir être alerté quand la courbe touche une borne..

    Voila merci beaucoup pour votre aide , voici le script de centre pour ceux qui ne l'on pas :


    //+------------------------------------------------------------------+
    //| Center of Gravity.mq4 |
    //| Original Code from Franc
    //| Linuxser 2011 for TSD
    //+------------------------------------------------------------------+
    #property copyright "Franc"
    //---------ang_PR (Din)--------------------
    #property indicator_chart_window
    #property indicator_buffers 5
    #property indicator_color1 Aqua
    #property indicator_color2 Orange
    #property indicator_color3 Lime
    #property indicator_color4 Red
    #property indicator_color5 Green
    //-----------------------------------
    extern int bars_back = 125;
    extern int m = 2;
    extern int i = 0;
    extern double kstd = 2.0;
    extern int sName = 1102;
    //-----------------------
    double fx[], sqh[], sql[], stdh[], stdl[];
    double ai[10,10], b[10], x[10], sx[20];
    double sum;
    int ip, p, n, f;
    double qq, mm, tt;
    int ii, jj, kk, ll, nn;
    double sq, std;
    //*******************************************
    int init()
    {
    IndicatorShortName("Center of Gravity");
    SetIndexStyle(0, DRAW_LINE);
    SetIndexBuffer(0, fx);
    SetIndexBuffer(1, sqh);
    SetIndexBuffer(2, sql);
    SetIndexBuffer(3, stdh);
    SetIndexBuffer(4, stdl);
    p = MathRound(bars_back);
    nn = m + 1;
    ObjectCreate("pr" + sName, 22, 0, Time[p], fx[p]);
    ObjectSet("pr" + sName, 14, 159);
    return(0);
    }
    //----------------------------------------------------------
    int deinit()
    {
    ObjectDelete("pr" + sName);
    }
    //************************************************** ********************************************
    int start()
    {
    int mi;
    //-------------------------------------------------------------------------------------------
    ip = iBarShift(Symbol(), Period(), ObjectGet("pr" + sName, OBJPROP_TIME1));
    p = bars_back;
    sx[1] = p + 1;
    SetIndexDrawBegin(0, Bars - p - 1);
    SetIndexDrawBegin(1, Bars - p - 1);
    SetIndexDrawBegin(2, Bars - p - 1);
    SetIndexDrawBegin(3, Bars - p - 1);
    SetIndexDrawBegin(4, Bars - p - 1);
    //----------------------sx-------------------------------------------------------------------
    for(mi = 1; mi <= nn * 2 - 2; mi++)
    {
    sum = 0;
    for(n = i; n <= i + p; n++)
    {
    sum += MathPow(n, mi);
    }
    sx[mi + 1] = sum;
    }
    //----------------------syx-----------
    for(mi = 1; mi <= nn; mi++)
    {
    sum = 0.00000;
    for(n = i; n <= i + p; n++)
    {
    if(mi == 1)
    sum += Close[n];
    else
    sum += Close[n] * MathPow(n, mi - 1);
    }
    b[mi] = sum;
    }
    //===============Matrix============================= ================================================== ========================
    for(jj = 1; jj <= nn; jj++)
    {
    for(ii = 1; ii <= nn; ii++)
    {
    kk = ii + jj - 1;
    ai[ii, jj] = sx[kk];
    }
    }
    //===============Gauss============================== ================================================== ========================
    for(kk = 1; kk <= nn - 1; kk++)
    {
    ll = 0; mm = 0;
    for(ii = kk; ii <= nn; ii++)
    {
    if(MathAbs(ai[ii, kk]) > mm)
    {
    mm = MathAbs(ai[ii, kk]);
    ll = ii;
    }
    }
    if(ll == 0)
    return(0);

    if(ll != kk)
    {
    for(jj = 1; jj <= nn; jj++)
    {
    tt = ai[kk, jj];
    ai[kk, jj] = ai[ll, jj];
    ai[ll, jj] = tt;
    }
    tt = b[kk]; b[kk] = b[ll]; b[ll] = tt;
    }
    for(ii = kk + 1; ii <= nn; ii++)
    {
    qq = ai[ii, kk] / ai[kk, kk];
    for(jj = 1; jj <= nn; jj++)
    {
    if(jj == kk)
    ai[ii, jj] = 0;
    else
    ai[ii, jj] = ai[ii, jj] - qq * ai[kk, jj];
    }
    b[ii] = b[ii] - qq * b[kk];
    }
    }
    x[nn] = b[nn] / ai[nn, nn];
    for(ii = nn - 1; ii >= 1; ii--)
    {
    tt = 0;
    for(jj = 1; jj <= nn - ii; jj++)
    {
    tt = tt + ai[ii, ii + jj] * x[ii + jj];
    x[ii] = (1 / ai[ii, ii]) * (b[ii] - tt);
    }
    }
    //================================================== ================================================== =======================
    for(n = i; n <= i + p; n++)
    {
    sum = 0;
    for(kk = 1; kk <= m; kk++)
    {
    sum += x[kk + 1] * MathPow(n, kk);
    }
    fx[n] = x[1] + sum;
    }
    //-----------------------------------Std-----------------------------------------------------------------------------------
    sq = 0.0;
    for(n = i; n <= i + p; n++)
    {
    sq += MathPow(Close[n] - fx[n], 2);
    }
    sq = MathSqrt(sq / (p + 1)) * kstd;
    std = iStdDev(NULL, 0, p, MODE_SMA, 0, PRICE_CLOSE, i) * kstd;
    for(n = i; n <= i + p; n++)
    {
    sqh[n] = fx[n] + sq;
    sql[n] = fx[n] - sq;
    stdh[n] = fx[n] + std;
    stdl[n] = fx[n] - std;
    }
    //-------------------------------------------------------------------------------
    ObjectMove("pr" + sName, 0, Time[p], fx[p]);
    //----------------------------------------------------------------------------------------------------------------------------
    return(0);
    }
    //================================================== ================================


  2. #2
    Membre lvl 25 pymouss est sur la route de la réputation...
    Date d'inscription
    February 2011
    Messages
    29
    Pouvoir de réputation
    3

    eu perso je srai toi je coderai un EA simple qui fait appel à l'indic ( via iCustom ), et dès que la courbe que tu veux passe en dessous de zero, tu balances un Alert.

Discussions similaires

  1. Indicateur centre gravite sonore
    Par pierrepernel dans le forum Novice sur le Forex
    Réponses: 2
    Dernier message: 12/04/2012, 18h37
  2. Réponses: 3
    Dernier message: 21/01/2011, 17h38
  3. alerte sonore
    Par remez dans le forum Utilisation des Plateformes de Trading
    Réponses: 0
    Dernier message: 18/05/2010, 17h31
  4. alerte sonore pour croisement de sma par ema
    Par jfp75 dans le forum Programmation
    Réponses: 1
    Dernier message: 03/05/2010, 14h24
  5. Recherche alerte sonore sur MT4
    Par amrouch dans le forum Trading Divers
    Réponses: 1
    Dernier message: 14/02/2009, 20h20

Ajouter aux Favoris | Plan du site | Archives | Forex | Contact