1 Adjunto(s) Hola a todos,
El indicador con el código a continuación está diseñado para dibujar e identificar líneas S/R; sin embargo, solo puedo ver puntos. ¿Qué puede estar mal? Ver foto adjunta también.
// -------------------------------------------------------- -------------------
//| Servicio KG Resistance.mq4 |
//| Copyright © 2007, MetaQuotes Software Corp. |
//|
http://www.metaquotes.net|
//| modificar por frantacech |
// -------------------------------------------------------- -------------------
#propiedad derechos de autor Kang_Gun
Hipervínculo de #propiedad http://www.free-knowledge.com
cadena Revisión = Revisión 2;
//------------------------------------------------ -------------------
//Revisión 1 = frantacech agregar opciones de alerta, correo electrónico y SR TF
//Revisión 2 = KG acelera el nivel SR
#propiedad indicador_chart_window
#propiedad indicador_buffers 8
#propiedad indicador_color1 Amarillo
#propiedad indicador_color2 Amarillo
#propiedad indicador_color3 verde lima
#propiedad indicador_color4 verde lima
#propiedad indicador_color5 Azul
#propiedad indicador_color6 Azul
#propiedad indicador_color7 Rojo
#propiedad indicador_color8 Rojo
//-- parámetros de entrada
booleano externo AlertPossible = verdadero;
extern bool AlertOnlySound = false;
cadena externa Sonido = tick.wav;
bool externo SendMailPossible = falso;
bool externo ShowM15 = verdadero;
bool externo ShowH1 = verdadero;
bool externo ShowH4 = verdadero;
booleano externo ShowD1 = verdadero;
//-- búferes
doble ExtMapBuffer1[];
doble ExtMapBuffer2[];
doble ExtMapBuffer3[];
doble ExtMapBuffer4[];
doble ExtMapBuffer5[];
doble ExtMapBuffer6[];
doble ExtMapBuffer7[];
doble ExtMapBuffer8[];
KG int;
// -------------------------------------------------------- -------------------
//| Función de inicialización de indicador personalizado |
// -------------------------------------------------------- -------------------
int inicial()
//-- adentro
si (MostrarM15)
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Amarillo);
SetIndexDrawBegin(0,KG-1);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexLabel(0,Resistencia M15);
EstablecerFlechaÍndice(0, 158);
SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Amarillo);
SetIndexDrawBegin(1,KG-1);
SetIndexBuffer(1,ExtMapBuffer2);
Establecer etiqueta de índice (1, compatible con M15);
EstablecerFlechaÍndice(1, 158);
si (MostrarH1)
SetIndexStyle(2,DRAW_ARROW,STYLE_DOT,1,LimeGreen);
SetIndexDrawBegin(2,KG-1);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexLabel(2,Resistencia H1);
EstablecerFlechaÍndice(2, 158);
SetIndexStyle(3,DRAW_ARROW,STYLE_DOT,1,LimeGreen);
SetIndexDrawBegin(3,KG-1);
SetIndexBuffer(3,ExtMapBuffer4);
Establecer etiqueta de índice (3, soporte H1);
EstablecerFlechaÍndice(3, 158);
si (MostrarH4)
SetIndexStyle(4,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexDrawBegin(4,KG-1);
SetIndexBuffer(4,ExtMapBuffer5);
EstablecerEtiquetaÍndice(4,Resistencia H4);
EstablecerFlechaÍndice(4, 158);
SetIndexStyle(5,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexDrawBegin(5,KG-1);
SetIndexBuffer(5,ExtMapBuffer6);
Establecer etiqueta de índice (5, soporte H4);
EstablecerFlechaÍndice(5, 158);
si (MostrarD1)
SetIndexStyle(6,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexDrawBegin(6,KG-1);
SetIndexBuffer(6,ExtMapBuffer7);
SetIndexLabel(6,Resistencia D1);
EstablecerFlechaÍndice(6, 158);
SetIndexStyle(7,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexDrawBegin(7,KG-1);
SetIndexBuffer(7,ExtMapBuffer8);
SetIndexLabel(7,Soporte D1);
EstablecerFlechaÍndice(7, 158);
//--
retorno(0);
// -------------------------------------------------------- -------------------
//| Función de desinicialización del indicador del cliente |
// -------------------------------------------------------- -------------------
definición int()
retorno(0);
//------------------------------------------------ ------------------
bool Fractal (cadena M, int P, int shift)
if (Período()gt;P) return(-1);
P=P/Periodo();
si (shiftlt;P)return(-1);
if (shiftgt;Bars-P)return(-1);
para (int I=1;ilt;=P;I )
si (M==U)
if (Alto[shift I]gt;Alto[shift])return(-1);
if (Alto[shift-i]gt;=Alto[shift])return(-1);
si (M==L)
if (Bajo[cambio I]lt;Bajo[cambio])return(-1);
if (Bajo[shift-i]lt;=Bajo[shift])return(-1);
retorno(1);
//------------------------------------------------ ------------------
inicio int()
int D1=1440, H4=240, H1=60, M15=15;
KG=Barras;
mientras(KGgt;=0)
si (MostrarM15)
si (Fractal(U,M15,KG)==1)
ExtMapBuffer1[KG]=Alto[KG];
if (ExtMapBuffer1[KG]==Oferta) MakeAlert(M15 Res, KG);
else ExtMapBuffer1[KG]=ExtMapBuffer1[KG 1]; if (ExtMapBuffer1[KG]==Oferta) MakeAlert(M15 Res, KG);
si (Fractal(L,M15,KG)==1)
ExtMapBuffer2[KG]=Bajo[KG];
if (ExtMapBuffer2[KG]==Oferta) MakeAlert(M15 Sup, KG);
else ExtMapBuffer2[KG]=ExtMapBuffer2[KG 1]; if (ExtMapBuffer2[KG]==Oferta) MakeAlert(M15 Sup, KG);
si (MostrarH1)
si (Fractal(U,H1,KG)==1)
ExtMapBuffer3[KG]=Alto[KG];
if (ExtMapBuffer3[KG]==Oferta) MakeAlert(H1 Res, KG);
else ExtMapBuffer3[KG]=ExtMapBuffer3[KG 1]; if (ExtMapBuffer3[KG]==Oferta) MakeAlert(H1 Res, KG);
si (Fractal(L,H1,KG)==1)
ExtMapBuffer4[KG]=Bajo[KG];
if (ExtMapBuffer4[KG]==Oferta) MakeAlert(H1 Sup, KG);
else ExtMapBuffer4[KG]=ExtMapBuffer4[KG 1]; if (ExtMapBuffer4[KG]==Oferta) MakeAlert(H1 Sup, KG);
si (MostrarH4)
si (Fractal(U,H4,KG)==1)
ExtMapBuffer5[KG]=Alto[KG];
if (ExtMapBuffer5[KG]==Oferta) MakeAlert(H4 Res, KG);
else ExtMapBuffer5[KG]=ExtMapBuffer5[KG 1]; if (ExtMapBuffer5[KG]==Oferta) MakeAlert(H4 Res, KG);
si (Fractal(L,H4,KG)==1)
ExtMapBuffer6[KG]=Bajo[KG];
if (ExtMapBuffer6[KG]==Oferta) MakeAlert(H4 Sup, KG);
else ExtMapBuffer6[KG]=ExtMapBuffer6[KG 1]; if (ExtMapBuffer6[KG]==Oferta) MakeAlert(H4 Sup, KG);
si (MostrarD1)
si (Fractal(U,D1,KG)==1)
ExtMapBuffer7[KG]=Alto[KG];
if (ExtMapBuffer7[KG]==Oferta) MakeAlert(D1 Res, KG);
else ExtMapBuffer7[KG]=ExtMapBuffer7[KG 1]; if (ExtMapBuffer7[KG]==Oferta) MakeAlert(D1 Res, KG);
si (Fractal(L,D1,KG)==1)
ExtMapBuffer8[KG]=Bajo[KG];
if (ExtMapBuffer8[KG]==Oferta) MakeAlert(D1 Sup, KG);
else ExtMapBuffer8[KG]=ExtMapBuffer8[KG 1]; if (ExtMapBuffer8[KG]==Oferta) MakeAlert(D1 Sup, KG);
KG--;
retorno(0);
// -------------------------------------------------------- -------------------
fecha y hora AlertTime;
void MakeAlert(string _Notice, int Index)
if (Índice gt;= 1) return;
if (AlertTime == iTime(Symbol(), Period(), Index)) return;
AlertTime = iTime(Símbolo(), Periodo(), Índice);
cadena Aviso = StringConenate(Cruz, Símbolo(),, _Aviso);
if (AlertaPosible) ReproducirSonido(Sonido); if (AlertaSoloSonido==falso) Alerta(Aviso);
if (SendMailPossible) SendMail(Aviso, );
https://www.forexycfds.com/crypto-tr...ng-profit.html