Función ICustom - página 22

 
SantaClaus:
El inglés no es mi lengua materna pero realmente no pensé que mi pregunta fuera tan errónea. En lugar de "marcar palabras", vamos a encontrar una solución a mi problema. Intento la pregunta de nuevo.

¿Cuál es la mejor manera de que mi EA reconozca las puts y calls simples desde mi indicador?

Obviamente mi código no funcionó y traté de cambiar el "1" por un "0" como me dijiste.

Publique (adjunte) su código que no funciona aquí - los archivos mql que está probando y que escribió hasta ahora

 

Es mi código privado, así que no quiero compartirlo. Pero, ¿qué más necesitas ver que el código que he proporcionado?

¿Hay algo que haya olvidado?

 
SantaClaus:
Es mi código privado así que no quiero compartirlo. Pero, ¿qué más necesita ver que el código que he proporcionado? ¿Hay algo que he olvidado?

¿Quieres decir que quieres que alguien te ayude con la codificación, pero no quieres mostrar el código para que se compruebe si hay errores, sino que afirmas que todos los consejos que has recibido, y que funcionan en miles y miles de otros códigos, no te funcionan?

DE ACUERDO. Ahora entiendo tu posición. Buena suerte con tu codificación

Feliz comercio

 

¿Código privado que no funciona? Interesante

 

Dos de mis posts han sido borrados por alguna razón que desconozco.

Sin embargo, el problema que encontré fue que tenía algunos otros búferes que perturbaban el que estaba tratando de leer. Ahora tengo una solución que funciona.

 

Necesito ayuda por favor.. Si no utilizo una función, pongo el nombre del símbolo entre comillas dobles y funciona, por ejemplo, icustom("EURUSDmicro",0,channel-signal",2,1), pero cuando utilizo una función, las comillas dobles no se pasan.

void OnTick()

{

CalcDisplay("EURUSDmicro"); //--------FUNCTION CALL-------

}

void CalcDisplay(string TxtCurrency) //--------FUNCTION-------

{

double Value=icustom(TxtDivisa,0,canal-señal",2,1);

...

...

..

}

 
Richard Sidric:
Necesito ayuda por favor.. Si no utilizo una función, pongo el nombre del símbolo entre comillas dobles y funciona, por ejemplo, icustom("EURUSDmicro",0,channel-signal",2,1), pero cuando utilizo una función, las comillas dobles no se pasan.

void OnTick()

{

CalcDisplay("EURUSDmicro"); //--------FUNCTION CALL-------

}

void CalcDisplay(string TxtCurrency) //--------FUNCTION-------

{

double Value=icustom(TxtDivisa,0,canal-señal",2,1);

...

...

..

}

No es necesario pasar las comillas. Todo lo que se necesita es que sea una cadena.

___________________

PD: en tu llamada a iCiustom te falta una comilla. Ahora es así:

double Value=icustom(TxtCurrency,0,channel-signal",2,1);

y tiene que ser así :

double Value=icustom(TxtDivisa,0, "canal-señal",2,1);

 

hola a todos tengo un indicador t4 abajo adjunto solo quiero saber como puedo usar esto para robo trading y robo trading o ea son iguales o no

( i allready utilizarlo manual de comercio se sientan en frente de la computadora, pero )

si utilizo esto para el comercio automatizado entonces cómo por favor me ayude a cualquiera gracias de antemano

//------------------------------------------------------------------

// ised original y primera implementación por mony

// versión tris por mladen

//------------------------------------------------------------------

#propiedad copyright "mony & mladen"

#property link "made at www.forex.tsd.com"

#property indicator_chart_window

#property indicator_buffers 5

#property indicator_color1 MediumBlue

#property indicator_color2 Red

#property indicator_color3 MediumBlue

#propiedad indicador_color4 Rojo

#propiedad indicador_color5 Rojo

#propiedad indicator_width3 3

#propiedad indicator_width4 3

#property indicator_width5 3

#property estricto

//

//

//

//

//

//

enum esDisplay

{

dis_line, // Mostrar línea de color

dis_bars, // Mostrar barras de color

dis_both // Mostrar tanto las líneas como las barras de color

};

extern int CCIperiod = 3; // Periodo CCI

extern int ATRperiod = 300; // Periodo ATR

extern ENUM_APPLIED_PRICE applied_price = PRICE_TYPICAL; // Precio a utilizar

extern enDisplay DisplayType = dis_line; // Tipo de pantalla

extern bool alertsOn = true; // Activar las alertas

extern bool alertsOnCurrent = false; // Alertas en la barra actual (aún abierta)

extern bool alertsMessage = true; // Las alertas deben mostrar un mensaje emergente

extern bool alertsSound = true; // Las alertas deben reproducir un sonido

extern bool alertsNotify = true; // Las alertas deben enviar una notificación

extern bool alertsEmail = false; // Las alertas deben enviar un correo electrónico

extern string soundFile = "o.wma"; // Archivo de sonido para las alertas sonoras

double TrLine[];

double TrendDowna[];

double TrendDownb[];

double HistUp[];

double HistDn[];

double trend[];

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int init()

{

IndicatorBuffers(6);

int styleLine = DRAW_LINE; if (DisplayType==dis_bars) styleLine=DRAW_NONE;

int styleBars = DRAW_HISTOGRAM; if (DisplayType==dis_line) styleBars=DRAW_NONE;

SetIndexBuffer(0, HistUp); SetIndexStyle(0,styleBars);

SetIndexBuffer(1, HistDn); SetIndexStyle(1,styleBars);

SetIndexBuffer(2, TrLine); SetIndexStyle(2,styleLine);

SetIndexBuffer(3, TrendDowna); SetIndexStyle(3,styleLine);

SetIndexBuffer(4, TrendDownb); SetIndexStyle(4,styleLine);

SetIndexBuffer(5, trend);

return(0);

}

int deinit(){ return(0); }

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int inicio()

{

int barras_contadas=IndicadorContado();

if(counted_bars<0) return(-1);

if(barras_contadas>0) barras_contadas--;

int límite = MathMin(Bares-barras contadas,Bares-1);

//

//

//

//

//

if (trend[limit]==-1) CleanPoint(limit,TrendDowna,TrendDownb);

for(int i=límite; i >= 0; i--)

{

double cciTrendNow = iCCI(NULL, 0, CCIperiod, applied_price, i);

si (cciTrendNow >= 0)

{

TrLine = NormalizeDouble(Low - iATR(NULL, 0, ATRperiod, i),Digits);

if (i<(Bars-1) && TrLine < TrLine) TrLine = TrLine;

}

if (cciTrendNow <= 0)

{

TrLine = NormalizeDouble(High + iATR(NULL, 0, ATRperiod, i),Digits);

si (i TrLine) TrLine = TrLine;

}

//

//

//

//

//

TrendDowna = EMPTY_VALUE;

TrendDownb = EMPTY_VALUE;

if (i<(Bars-1))

{

trend = trend;

si (TrLine> TrLine) trend = 1;

si (TrLine< TrLine) trend =-1;

si (trend == -1) PlotPoint(i,TrendDowna,TrendDownb,TrLine);

si (trend == 1) { HistUp = Alto; HistDn = Bajo; }

si (trend == -1) { HistDn = Alto; HistUp = Bajo; }

}

}

manageAlerts();

return(0);

}

//+-------------------------------------------------------------------

//|

//+-------------------------------------------------------------------

//

//

//

//

//

void manageAlerts()

{

si (alertsOn)

{

int whichBar = 1; if (alertsOnCurrent) whichBar = 0;

if (trend[whichBar] != trend[whichBar+1])

{

if (trend[whichBar] == 1) doAlert(whichBar, "up");

si (trend[whichBar] ==-1) doAlert(whichBar, "down");

}

}

}

//

//

//

//

//

void doAlert(int forBar, string doWhat)

{

static string previousAlert="nada";

static datetime previousTime;

string mensaje;

if (previousAlert != doWhat || previousTime != Time[forBar]) {

previousAlert = doWhat;

previousTime = Time[forBar];

//

//

//

//

//

message = Symbol()+" en "+TimeToStr(TimeLocal(),TIME_SECONDS)+" SP MI tendencia cambió a "+doWhat;

if (alertsMessage) Alert(message);

if (alertsNotify) SendNotification(mensaje);

if (alertsEmail) SendMail(Symbol()+" S P MY",mensaje);

if (alertsSound) PlaySound(soundFile);

}

}

//-------------------------------------------------------------------

//

//-------------------------------------------------------------------

//

//

//

//

//

void CleanPoint(int,double& first[],double& second[])

{

if (i>=Bars-3) return;

if ((second != EMPTY_VALUE) && (second != EMPTY_VALUE))

second = VALOR_VACÍO;

si no

if ((first != EMPTY_VALUE) && (first != EMPTY_VALUE) && (first == EMPTY_VALUE))

first = EMPTY_VALUE;

}

void PlotPoint(int,double& first[],double& second[],double& from[])

{

if (i>=Bars-2) return;

if (first == EMPTY_VALUE)

if (first == EMPTY_VALUE)

{ first = from; first = from; second = EMPTY_VALUE; }

else { second = from; second = from; first = EMPTY_VALUE; }

else { first = from; second = EMPTY_VALUE; }

}

s_p_mony__alerts_1.01.mq4

Archivos adjuntos:
 
mony:
hola a todos tengo un indicador t4 abajo adjunto solo quiero saber como puedo usar esto para robo trading y robo trading o ea son lo mismo o no

( ya lo uso manualmente me siento frente a la computadora pero )

si utilizo esto para el comercio automatizado entonces cómo por favor me ayude a cualquiera gracias de antemano

//------------------------------------------------------------------

// ised original y primera implementación por mony

// versión tris por mladen

//------------------------------------------------------------------

#propiedad copyright "mony & mladen"

#property link "made at www.forex.tsd.com"

#property indicator_chart_window

#property indicator_buffers 5

#property indicator_color1 MediumBlue

#property indicator_color2 Red

#property indicator_color3 MediumBlue

#propiedad indicador_color4 Rojo

#propiedad indicador_color5 Rojo

#propiedad indicator_width3 3

#propiedad indicator_width4 3

#property indicator_width5 3

#property estricto

//

//

//

//

//

//

enum esDisplay

{

dis_line, // Mostrar línea de color

dis_bars, // Mostrar barras de color

dis_both // Mostrar tanto las líneas como las barras de color

};

extern int CCIperiod = 3; // Periodo CCI

extern int ATRperiod = 300; // Periodo ATR

extern ENUM_APPLIED_PRICE applied_price = PRICE_TYPICAL; // Precio a utilizar

extern enDisplay DisplayType = dis_line; // Tipo de pantalla

extern bool alertsOn = true; // Activar las alertas

extern bool alertsOnCurrent = false; // Alertas en la barra actual (aún abierta)

extern bool alertsMessage = true; // Las alertas deben mostrar un mensaje emergente

extern bool alertsSound = true; // Las alertas deben reproducir un sonido

extern bool alertsNotify = true; // Las alertas deben enviar una notificación

extern bool alertsEmail = false; // Las alertas deben enviar un correo electrónico

extern string soundFile = "o.wma"; // Archivo de sonido para las alertas sonoras

double TrLine[];

double TrendDowna[];

double TrendDownb[];

double HistUp[];

double HistDn[];

double trend[];

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int init()

{

IndicatorBuffers(6);

int styleLine = DRAW_LINE; if (DisplayType==dis_bars) styleLine=DRAW_NONE;

int styleBars = DRAW_HISTOGRAM; if (DisplayType==dis_line) styleBars=DRAW_NONE;

SetIndexBuffer(0, HistUp); SetIndexStyle(0,styleBars);

SetIndexBuffer(1, HistDn); SetIndexStyle(1,styleBars);

SetIndexBuffer(2, TrLine); SetIndexStyle(2,styleLine);

SetIndexBuffer(3, TrendDowna); SetIndexStyle(3,styleLine);

SetIndexBuffer(4, TrendDownb); SetIndexStyle(4,styleLine);

SetIndexBuffer(5, trend);

return(0);

}

int deinit(){ return(0); }

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int inicio()

{

int barras_contadas=IndicadorContado();

if(counted_bars<0) return(-1);

if(barras_contadas>0) barras_contadas--;

int límite = MathMin(Bares-barras contadas,Bares-1);

//

//

//

//

//

if (trend[limit]==-1) CleanPoint(limit,TrendDowna,TrendDownb);

for(int i=límite; i >= 0; i--)

{

double cciTrendNow = iCCI(NULL, 0, CCIperiod, applied_price, i);

si (cciTrendNow >= 0)

{

TrLine = NormalizeDouble(Low - iATR(NULL, 0, ATRperiod, i),Digits);

if (i<(Bars-1) && TrLine < TrLine) TrLine = TrLine;

}

if (cciTrendNow <= 0)

{

TrLine = NormalizeDouble(High + iATR(NULL, 0, ATRperiod, i),Digits);

si (i TrLine) TrLine = TrLine;

}

//

//

//

//

//

TrendDowna = EMPTY_VALUE;

TrendDownb = EMPTY_VALUE;

if (i<(Bars-1))

{

trend = trend;

si (TrLine> TrLine) trend = 1;

si (TrLine< TrLine) trend =-1;

si (trend == -1) PlotPoint(i,TrendDowna,TrendDownb,TrLine);

si (trend == 1) { HistUp = Alto; HistDn = Bajo; }

if (trend == -1) { HistDn = Alto; HistUp = Bajo; }

}

}

manageAlerts();

return(0);

}

//+-------------------------------------------------------------------

//|

//+-------------------------------------------------------------------

//

//

//

//

//

void manageAlerts()

{

si (alertsOn)

{

int whichBar = 1; if (alertsOnCurrent) whichBar = 0;

if (trend[whichBar] != trend[whichBar+1])

{

if (trend[whichBar] == 1) doAlert(whichBar, "up");

si (trend[whichBar] ==-1) doAlert(whichBar, "down");

}

}

}

//

//

//

//

//

void doAlert(int forBar, string doWhat)

{

static string previousAlert="nada";

static datetime previousTime;

mensaje de cadena;

if (previousAlert != doWhat || previousTime != Time[forBar]) {

previousAlert = doWhat;

previousTime = Time[forBar];

//

//

//

//

//

message = Symbol()+" en "+TimeToStr(TimeLocal(),TIME_SECONDS)+" SP MI tendencia cambió a "+doWhat;

if (alertsMessage) Alert(message);

if (alertsNotify) SendNotification(mensaje);

if (alertsEmail) SendMail(Symbol()+" S P MY",mensaje);

if (alertsSound) PlaySound(soundFile);

}

}

//-------------------------------------------------------------------

//

//-------------------------------------------------------------------

//

//

//

//

//

void CleanPoint(int,double& first[],double& second[])

{

if (i>=Bars-3) return;

if ((second != EMPTY_VALUE) && (second != EMPTY_VALUE))

second = VALOR_VACÍO;

si no

if ((first != EMPTY_VALUE) && (first != EMPTY_VALUE) && (first == EMPTY_VALUE))

first = EMPTY_VALUE;

}

void PlotPoint(int,double& first[],double& second[],double& from[])

{

if (i>=Bars-2) return;

if (first == EMPTY_VALUE)

if (first == EMPTY_VALUE)

{ first = from; first = from; second = EMPTY_VALUE; }

else { second = from; second = from; first = EMPTY_VALUE; }

else { first = from; second = EMPTY_VALUE; }

}

s_p_mony__alerts_1.01.mq4

¿Has probado ya a utilizar la llamada iCustom() desde el EA?

Todo lo que tienes que hacer es llamar al indicador usando la función iCustom(), leer el buffer de tendencia (buffer 5 en la nominación de metatrader) y cuando cambia el valor de -1 a +1 o de +1 a -1 tienes una señal

 

señor señor por favor lo siento señor ......... no sé lo que es iCustom() llamada.. y donde se puede tratar ??? ...... donde lo encontré en mt4 o cuando modificar el indicador sólo dime cómo puedo utilizar este indicador S P dinero en el comercio automático / robo de comercio que es el señor ..................

si esto es todo un proceso largo entonces por favor disculpenme y por favor olviden los mensajes anteriores gracias señor

Razón de la queja: