INDICATOR CANDLES DIRECTION

Forums ProRealTime forum Français Support ProBuilder INDICATOR CANDLES DIRECTION

Viewing 4 posts - 1 through 4 (of 4 total)
  • #226656

    Bonjour,

    Est ce que quelqu’un saurait convertir l’indicateur CANDLES DIRECTION de Metatrader 4 et le placer en haut à gauche dans le graphique principal.

    //+——————————————————————+
    //| Candle Direction.mq4 |
    //| Copyright 2014, Luis Andrianto |
    //| https://login.mql5.com/en/users/lou15 |
    //+——————————————————————+
    #property copyright “”
    #property link “”

    #property indicator_chart_window
    #property indicator_buffers 1

    extern color LabelColor=DodgerBlue;
    extern int Corner=0;
    extern color UpColor=LimeGreen;
    extern color DownColor=Red;
    extern color NetralColor=White;

    int TF[]={1,5,15,30,60,240,1440,10080,43200};
    string Label[]={“M1″,”M5″,”M15″,”M30″,”H1″,”H4″,”D1″,”W1″,”MN”};
    double ExtBuff[];

    //+——————————————————————+
    //| Custom indicator initialization function |
    //+——————————————————————+
    int init()
    {
    //—- indicators
    SetIndexBuffer(0,ExtBuff,INDICATOR_DATA);

    for(int i=0;i<=8;i++)
    {
    ObjectCreate(Label[i],OBJ_LABEL,0,0,0);
    ObjectCreate(Label[i]+” ARROW”,OBJ_LABEL,0,0,0);
    }
    //—-
    return(0);
    }
    //+——————————————————————+
    //| Custom indicator deinitialization function |
    //+——————————————————————+
    int deinit()
    {
    //—-
    for(int i=0;i<=8;i++)
    {
    ObjectDelete(Label[i]);
    ObjectDelete(Label[i]+” ARROW”);
    }
    //—-
    return(0);
    }
    //+——————————————————————+
    //| Custom indicator iteration function |
    //+——————————————————————+

    double OCandle(int tf){double OC=iOpen(Symbol(),tf,0);return(OC);}
    double CCandle(int tf){double CC=iClose(Symbol(),tf,0);return(CC);}

    void ObSetLabel(string name,string text,int x,int y)
    {
    ObjectSetText(name,text,10,”Impact”,LabelColor);
    ObjectSet(name,OBJPROP_CORNER,Corner);
    ObjectSet(name,OBJPROP_XDISTANCE,x);
    ObjectSet(name,OBJPROP_YDISTANCE,y);
    ObjectSet(name,OBJPROP_BACK,0);
    }
    void ObSetArrow(string name,int code,int x,int y,color clr)
    {
    ObjectSetText(name,CharToStr(code),14,”Wingdings”,clr);
    ObjectSet(name,OBJPROP_CORNER,Corner);
    ObjectSet(name,OBJPROP_XDISTANCE,x);
    ObjectSet(name,OBJPROP_YDISTANCE,y);
    ObjectSet(name,OBJPROP_BACK,0);
    }

    int start()
    {

    //—-

    int X_Start=0;
    int Y_Start=20;
    color clr;
    for(int i=0;i<=8;i++)
    {
    X_Start=X_Start+30;

    ObSetLabel(Label[i],Label[i],X_Start,Y_Start);

    if(CCandle(TF[i])>OCandle(TF[i])){clr=UpColor;ExtBuff[i]=1;}
    else if(CCandle(TF[i])<OCandle(TF[i])){clr=DownColor;ExtBuff[i]=2;}
    else {clr=NetralColor;ExtBuff[i]=0;}

    ObSetArrow(Label[i]+” ARROW”,110,X_Start,Y_Start+20,clr);
    }
    //—-
    return(0);
    }
    //+——————————————————————+

    #226935

    Bonjour,

    J’aurais besoin d’une conversion de code d’un indicateur MT4.

    //+——————————————————————+
    //| Candle Direction.mq4 |
    //| Copyright 2014, Luis Andrianto |
    //| https://login.mql5.com/en/users/lou15 |
    //+——————————————————————+
    #property copyright “”
    #property link “”

    #property indicator_chart_window
    #property indicator_buffers 1

    extern color LabelColor=DodgerBlue;
    extern int Corner=0;
    extern color UpColor=LimeGreen;
    extern color DownColor=Red;
    extern color NetralColor=White;

    int TF[]={1,5,15,30,60,240,1440,10080,43200};
    string Label[]={“M1″,”M5″,”M15″,”M30″,”H1″,”H4″,”D1″,”W1″,”MN”};
    double ExtBuff[];

    //+——————————————————————+
    //| Custom indicator initialization function |
    //+——————————————————————+
    int init()
    {
    //—- indicators
    SetIndexBuffer(0,ExtBuff,INDICATOR_DATA);

    for(int i=0;i<=8;i++)
    {
    ObjectCreate(Label[i],OBJ_LABEL,0,0,0);
    ObjectCreate(Label[i]+” ARROW”,OBJ_LABEL,0,0,0);
    }
    //—-
    return(0);
    }
    //+——————————————————————+
    //| Custom indicator deinitialization function |
    //+——————————————————————+
    int deinit()
    {
    //—-
    for(int i=0;i<=8;i++)
    {
    ObjectDelete(Label[i]);
    ObjectDelete(Label[i]+” ARROW”);
    }
    //—-
    return(0);
    }
    //+——————————————————————+
    //| Custom indicator iteration function |
    //+——————————————————————+

    double OCandle(int tf){double OC=iOpen(Symbol(),tf,0);return(OC);}
    double CCandle(int tf){double CC=iClose(Symbol(),tf,0);return(CC);}

    void ObSetLabel(string name,string text,int x,int y)
    {
    ObjectSetText(name,text,10,”Impact”,LabelColor);
    ObjectSet(name,OBJPROP_CORNER,Corner);
    ObjectSet(name,OBJPROP_XDISTANCE,x);
    ObjectSet(name,OBJPROP_YDISTANCE,y);
    ObjectSet(name,OBJPROP_BACK,0);
    }
    void ObSetArrow(string name,int code,int x,int y,color clr)
    {
    ObjectSetText(name,CharToStr(code),14,”Wingdings”,clr);
    ObjectSet(name,OBJPROP_CORNER,Corner);
    ObjectSet(name,OBJPROP_XDISTANCE,x);
    ObjectSet(name,OBJPROP_YDISTANCE,y);
    ObjectSet(name,OBJPROP_BACK,0);
    }

    int start()
    {

    //—-

    int X_Start=0;
    int Y_Start=20;
    color clr;
    for(int i=0;i<=8;i++)
    {
    X_Start=X_Start+30;

    ObSetLabel(Label[i],Label[i],X_Start,Y_Start);

    if(CCandle(TF[i])>OCandle(TF[i])){clr=UpColor;ExtBuff[i]=1;}
    else if(CCandle(TF[i])<OCandle(TF[i])){clr=DownColor;ExtBuff[i]=2;}
    else {clr=NetralColor;ExtBuff[i]=0;}

    ObSetArrow(Label[i]+” ARROW”,110,X_Start,Y_Start+20,clr);
    }
    //—-
    return(0);
    }
    //+——————————————————————+

    #228220

    Bonjour
    Voici le code pour afficher la couleur des bougies dans les différents timeframes.
    Gardez à l’esprit que si vous voulez tout voir, vous devrez travailler sur des graphiques de 1 minute.
    Si vous voulez utiliser un graphique en 1 heure, vous devrez cacher les temps inférieurs.

    #228223

    Buenos dias,

    Hermosa, muchas gracias. Todavía no he encontrado cómo ocultar los tiempos verbales inferiores.

     

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login