INDICATOR CANDLES DIRECTION
Forums › ProRealTime forum Français › Support ProBuilder › INDICATOR CANDLES DIRECTION
- This topic has 3 replies, 2 voices, and was last updated 9 months ago by ARLEQUIN49.
-
-
01/21/2024 at 11:32 AM #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 1extern 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);
}
//+——————————————————————+01/27/2024 at 10:03 AM #226935Bonjour,
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 1extern 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);
}
//+——————————————————————+02/15/2024 at 1:00 PM #228220Bonjour
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.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145//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 = TRUEtimeframe (1mn)IF OPEN > CLOSE THENRT1M = 255GT1M = 0BT1M = 0ELSIF OPEN < CLOSE THENRT1M = 0GT1M = 255BT1M = 0ELSERT1M = 125GT1M = 125BT1M = 125ENDIFDRAWTEXT("⏹ 1MN",100, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1M,GT1M,BT1M)timeframe (5mn)IF OPEN > CLOSE THENRT5M = 255GT5M = 0BT5M = 0ELSIF OPEN < CLOSE THENRT5M = 0GT5M = 255BT5M = 0ELSERT5M = 125GT5M = 125BT5M = 125ENDIFDRAWTEXT("⏹ 5MN",150, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT5M,GT5M,BT5M)timeframe (15mn)IF OPEN > CLOSE THENRT15M = 255GT15M = 0BT15M = 0ELSIF OPEN < CLOSE THENRT15M = 0GT15M = 255BT15M = 0ELSERT15M = 125GT15M = 125BT15M = 125ENDIFDRAWTEXT("⏹ 15MN ",200, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT15M,GT15M,BT15M)timeframe (30mn)IF OPEN > CLOSE THENRT30M = 255GT30M = 0BT30M = 0ELSIF OPEN < CLOSE THENRT30M = 0GT30M = 255BT30M = 0ELSERT30M = 125GT30M = 125BT30M = 125ENDIFDRAWTEXT("⏹ 30MN",250, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT30M,GT30M,BT30M)timeframe (1H)IF OPEN > CLOSE THENRT1H = 255GT1H = 0BT1H = 0ELSIF OPEN < CLOSE THENRT1H = 0GT1H = 255BT1H = 0ELSERT1H = 125GT1H = 125BT1H = 125ENDIFDRAWTEXT("⏹ 1HR",300, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1H,GT1H,BT1H)timeframe (4H)IF OPEN > CLOSE THENRT4H = 255GT4H = 0BT4H = 0ELSIF OPEN < CLOSE THENRT4H = 0GT4H = 255BT4H = 0ELSERT4H = 125GT4H = 125BT4H = 125ENDIFDRAWTEXT("⏹ 4HR",350, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT4H,GT4H,BT4H)timeframe (DAILY)IF OPEN > CLOSE THENRT1D = 255GT1D = 0BT1D = 0ELSIF OPEN < CLOSE THENRT1D = 0GT1D = 255BT1D = 0ELSERT1D = 125GT1D = 125BT1D = 125ENDIFDRAWTEXT("⏹ 01D",400, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1D,GT1D,BT1D)timeframe (WEEKLY)IF OPEN > CLOSE THENRT1W = 255GT1W = 0BT1W = 0ELSIF OPEN < CLOSE THENRT1W = 0GT1W = 255BT1W = 0ELSERT1W = 125GT1W = 125BT1W = 125ENDIFDRAWTEXT("⏹ 1W",450, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1W,GT1W,BT1W)timeframe (MONTHLY)IF OPEN > CLOSE THENRT1MT = 255GT1MT = 0BT1MT = 0ELSIF OPEN < CLOSE THENRT1MT = 0GT1MT = 255BT1MT = 0ELSERT1MT= 125GT1MT = 125BT1MT = 125ENDIFDRAWTEXT("⏹ 1M",500, -100)ANCHOR(TOPLEFT,XSHIFT,YSHIFT)coloured(RT1MT,GT1MT,BT1MT)RETURN02/15/2024 at 2:00 PM #228223Buenos dias,
Hermosa, muchas gracias. Todavía no he encontrado cómo ocultar los tiempos verbales inferiores.
-
AuthorPosts
Find exclusive trading pro-tools on