INDICATOR CANDLES DIRECTION

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #226656 quote
    ARLEQUIN49
    Participant
    Veteran

    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 quote
    ARLEQUIN49
    Participant
    Veteran

    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 quote
    Iván González
    Moderator
    Master

    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.

    //PRC_CANDLE DIRECTION
    //version = 0
    //15.02.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //Timeframe M1 / M5 / M15 / M30 / H1 / H4 / D1 / W1 / MN
    //////////////////////////////////////////////////////////
    DEFPARAM DRAWONLASTBARONLY = TRUE
    timeframe (1mn)
    IF OPEN > CLOSE THEN
    RT1M = 255
    GT1M = 0
    BT1M = 0  
    ELSIF OPEN < CLOSE THEN
    RT1M = 0
    GT1M = 255
    BT1M = 0
    ELSE
    RT1M = 125
    GT1M = 125
    BT1M = 125
    ENDIF
    DRAWTEXT("⏹ 1MN",100, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1M,GT1M,BT1M)
    timeframe (5mn)
    IF OPEN > CLOSE THEN
    RT5M = 255
    GT5M = 0
    BT5M = 0
    ELSIF OPEN < CLOSE THEN
    RT5M = 0
    GT5M = 255
    BT5M = 0
    ELSE
    RT5M = 125
    GT5M = 125
    BT5M = 125
    ENDIF
    DRAWTEXT("⏹ 5MN",150, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT5M,GT5M,BT5M)
    timeframe (15mn)
    IF OPEN > CLOSE THEN
    RT15M = 255
    GT15M = 0
    BT15M = 0
    ELSIF OPEN < CLOSE THEN
    RT15M = 0
    GT15M = 255
    BT15M = 0
    ELSE
    RT15M = 125
    GT15M = 125
    BT15M = 125
    ENDIF
    DRAWTEXT("⏹ 15MN ",200, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT15M,GT15M,BT15M)
    timeframe (30mn)
    IF OPEN > CLOSE THEN
    RT30M = 255
    GT30M = 0
    BT30M = 0
    ELSIF OPEN < CLOSE THEN
    RT30M = 0
    GT30M = 255
    BT30M = 0
    ELSE
    RT30M = 125
    GT30M = 125
    BT30M = 125
    ENDIF
    DRAWTEXT("⏹ 30MN",250, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT30M,GT30M,BT30M)
    timeframe (1H)
    IF OPEN > CLOSE THEN
    RT1H = 255
    GT1H = 0
    BT1H = 0
    ELSIF OPEN < CLOSE THEN
    RT1H = 0
    GT1H = 255
    BT1H = 0
    ELSE
    RT1H = 125
    GT1H = 125
    BT1H = 125
    ENDIF
    DRAWTEXT("⏹ 1HR",300, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1H,GT1H,BT1H)
    timeframe (4H)
    IF OPEN > CLOSE THEN
    RT4H = 255
    GT4H = 0
    BT4H = 0
    ELSIF OPEN < CLOSE THEN
    RT4H = 0
    GT4H = 255
    BT4H = 0
    ELSE
    RT4H = 125
    GT4H = 125
    BT4H = 125
    ENDIF
    DRAWTEXT("⏹ 4HR",350, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT4H,GT4H,BT4H)
    timeframe (DAILY)
    IF OPEN > CLOSE THEN
    RT1D = 255
    GT1D = 0
    BT1D = 0
    ELSIF OPEN < CLOSE THEN
    RT1D = 0
    GT1D = 255
    BT1D = 0
    ELSE
    RT1D = 125
    GT1D = 125
    BT1D = 125
    ENDIF
    DRAWTEXT("⏹  01D",400, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1D,GT1D,BT1D)
    timeframe (WEEKLY)
    IF OPEN > CLOSE THEN
    RT1W = 255
    GT1W = 0
    BT1W = 0
    ELSIF OPEN < CLOSE THEN
    RT1W = 0
    GT1W = 255
    BT1W = 0
    ELSE
    RT1W = 125
    GT1W = 125
    BT1W = 125
    ENDIF
    DRAWTEXT("⏹ 1W",450, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1W,GT1W,BT1W)
    timeframe (MONTHLY)
    IF OPEN > CLOSE THEN
    RT1MT = 255
    GT1MT = 0
    BT1MT = 0
    ELSIF OPEN < CLOSE THEN
    RT1MT = 0
    GT1MT = 255
    BT1MT = 0
    ELSE
    RT1MT= 125
    GT1MT = 125
    BT1MT = 125
    ENDIF
    DRAWTEXT("⏹ 1M",500, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1MT,GT1MT,BT1MT)
    
    RETURN
    #228223 quote
    ARLEQUIN49
    Participant
    Veteran

    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)
  • You must be logged in to reply to this topic.

INDICATOR CANDLES DIRECTION


Support ProBuilder

New Reply
Author
author-avatar
ARLEQUIN49 @arlequin49 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by ARLEQUIN49
1 year, 11 months ago.

Topic Details
Forum: Support ProBuilder
Language: French
Started: 01/21/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...