Está perdiendo oportunidades comerciales:
- Aplicaciones de trading gratuitas
- 8 000+ señales para copiar
- Noticias económicas para analizar los mercados financieros
Registro
Entrada
Usted acepta la política del sitio web y las condiciones de uso
Si no tiene cuenta de usuario, regístrese
No puedo acceder. Me registré en metatrader.info pero parece que no tengo acceso todavía.
Ok lo tengo ahora.... Hummm soy novato en la programación ... Instrucción no muy claro en cuanto a lo que parte del código necesario para ser añadido a la existente Indicador de compra / venta de la señal como la de asctrend_sound.mq4 ... Obtengo errores de compilación...
HI CG,
Creo que la función sleep() sólo se puede llamar en EA's.¿Hay alguna función similar disponible, para ser llamado en el indicador personalizado.Gracias.
¡hola, codersguru!
He revisado tus lecciones, y no he notado nada sobre el uso de un archivo de inclusión, el concepto es nuevo para mí, y me preguntaba si podrías explicar algo que podría estar haciendo mal con el archivo, y cómo usarlo.
El trabajo que he hecho, (con 110 errores?)
//| Day Off.mq4.mq4 |
//| Eaglehawk |
//| https://www.forex-tsd.com/suggestions-trading-systems/3191-day-off-safety-detector.html |
//+------------------------------------------------------------------------------------------+
#property copyright "Eaglehawk"
#property link "https://www.forex-tsd.com/suggestions-trading-systems/3191-day-off-safety-detector.html"
//Global Variables
//I used variables to manually put in when Good Friday occurs, (I dont think it's possible to automate cycles of the moon, if you think so, go for it. I am, after all, a newcomer to coding )
extern int GoodFridaysMonth = 4; //Used to see what month Good Friday is in. (either 4 or 5)
extern int GoodFridaysDay = 12; //says the day of the month good friday is on.
bool DayOff = False; // the days interbankfx takes off
bool DayOffClose = False; //operates the last minute close if none of the minimization techniques are met by the deadline
//local variables (both used to determine what trend we are in)
double CurrentClose = iClose(NULL, 0, 1); //looks at the close of the most recent period
double TrendClose = iClose(NULL, 0, 3); //looks at the close of three periods
/*Counts the DayOff Function as true about two days before the time interbankfx is not running, (you can edit this to how fast you think your individual strategy will take to close)
In case this code is tampered with, the dates interbankfx takes off are here
New Years Day January 1
Martin Luther King Jr. Day January 20
Washington's Birthday February 17
Good Friday Friday before Easter
Memorial Day May 26
Independence Day July 4
Labor Day September 1
Thanksgiving Day Fourth Thurday of November
Christmas December 25*/
//DayOff variable tests
if ( Month() == 12 && Day() >= 30 || Month() == 1 && Day() <= 1 ) //New Years Day
{
DayOff = True;
}
if (Month() == 1 && (Day() >= 18 && Day() <= 20)) //Martin Luther King Jr. Day
{
DayOff = True;
}
if (Month() == 2 && (Day() >= 15 && Day() <= 17)) //Washington's Birthday
{
DayOff = True;
}
if (Month() == GoodFridaysMonth && (Day() = GoodFridaysDay - 2)) //Good Friday
{
DayOff = True;
}
if (Month() == 5 && (Day() >= 24 && Day() <= 26)) //Memorial Day
{
DayOff = True;
}
if (Month() == 7 && (Day() >= 2 && Day() <= 4)) //Independece Day
{
DayOff = True;
}
if ( Month() == 8 && Day() >= 30 || Month() == 9 && Day()== 1 ) //Labor Day
{
DayOff = True;
}
if (Month() == 11 && (DayOfWeek() >= 3 && DayOfWeek() =21) //Thanksgiving Day
{
DayOff = True;
}
if (Month() == 12 && (Day() >= 23 && Day() <= 25)) //Christmas Day
{
DayOff = True;
}
//DayOffClose variable tests, currently set to 9:00 P.M.
if (Month() == 12 && Day() == 31 && Hour() == 21) //New Years Day
{
DayOffClose = True;
}
if (Month() == 1 && (Day() == 19 && Hour() <= 21)) //Martin Luther King Jr. Day
{
DayOffClose = True;
}
if (Month() == 2 && Day() == 16 && Hour() == 21) //Washington's Birthday
{
DayOffClose = True;
}
if ( Month() == GoodFridaysMonth && Day() == GoodFridaysDay - 1 && Hour() == 21) //Good Friday
{
DayOffClose = True;
}
if (Month() == 5 && Day() == 25 && Hour() == 21) //Memorial Day
{
DayOffClose = True;
}
if (Month() == 7 && Day() == 3 && Hour() == 21) //Independece Day
{
DayOffClose = True;
}
if (Month() == 8 && Day()== 31 && Hour() == 21) //Labor Day
{
DayOffClose = True;
}
if (Month() == 11 && Day() >=21 && DayOfWeek() <=6) //Thanksgiving Day
{
DayOffClose = True;
}
if (Month() == 12 && Day() == 24 && Hour() == 21) //Christmas Day
{
DayOffClose = True;
}
//these next two functions will minimize loss on long, non-profitable trades before the close of interbankfx
if (DayOff == True && Ask-OrderOpenPrice() 0)
{
TrailingStopMode = True;
}
if (DayOff == True && Ask-OrderOpenPrice() < 0 && CurrentClose - TrendClose < 0)
{
Order = SIGNAL_CLOSEBUY;
}
//these next two functions will minimize loss on short, non-profitable trades before the close of interbankfx
if (DayOff == True && OrderOpenPrice()-Bid <0 && CurrentClose - TrendClose < 0)
{
TrailingStopMode = True;
}
if (DayOff == True && OrderOpenPrice()-Bid 0)
{
Order = SIGNAL_CLOSESELL;
}
//this next function will end all trades if not closed by 9:00 P.M. the day before the close of interbankfx
if (DayOffClose == True)
{
Order = SIGNAL_CLOSESELL;
}
if (DayOffClose == True)
{
Order = SIGNAL_CLOSEBUY;
}
//post this at the end of all your open Logics
if (/*your open logics*/ && DayOff == False) //order open
//post this as one of your exit short logics, closes trades when they are profitable
if (DayOff == True && OrderOpenPrice()-Bid >0)
{
Order = SIGNAL_CLOSESELL;
}
//post this as one of your exit long logics, also closes profitable trades.
if (DayOff == True && Ask-OrderOpenPrice() >0)
{
Order = SIGNAL_CLOSEBUY;
}
//+------------------------------------------------------------------+Hola, quiero saber cómo puedo obtener la parte superior e inferior de la ventana del gráfico actual.
¿hay alguna forma de obtener la parte superior e inferior (en pixel y precio) de la ventana del gráfico actual?
Otra, ¿cómo crear un procedimiento de temporizador por widows API en MetaTrader4?
¿Es posible utilizar .NET DLL para MT4?
¿Cómo se utiliza?
Estaría bien tener más información sobre cómo hacer indicadores ya que los EAs se basan en ellos. Alpari tiene algunos buenos tutores pero están en ruso:
http://www.alpari-idc.ru/ru/experts/articles/14.html
Ayuda de Period_Converter_opt
"Utilizo este convertidor de periodos adjunto a un gráfico para actualizar los gráficos personalizados en tiempo real. Esto funciona muy bien, excepto que si abro varios gráficos del mismo marco temporal personalizado, sólo uno de ellos se actualiza en tiempo real. Los otros gráficos aparecen fuera de línea y sólo se actualizan con la opción del menú de actualización. Por ejemplo, si abro 2 o 3 gráficos de 16M sólo uno se actualiza con nuevos ticks; los otros deben ser refrescados manualmente. ¿Es esta limitación por diseño? (Period_Converter_Opt) ¿Hay alguna solución para esta situación? ¿Sugerencias, alguien?"
He publicado esto en otro hilo anteriormente. ¿Alguna idea sobre esto?
Saludos,
Diby
Código de Period_converter_Opt
Ampliación del post anterior:
He mirado brevemente el código y mi curiosidad sería: qué devuelve WindowHandle en un caso de múltiples ventanas abiertas con el mismo símbolo y marco temporal.
if(hwnd == 0) {
//tratando de detectar la ventana del gráfico para actualizar.... ventana offline
hwnd = WindowHandle(Symbol(), NewPeriod);
}
Saludos,
Diby
Buy 3 Sell 3 straddle script o EA - ¿Alguien por ahí?
Hola CG y también Newdigital si su alrededor.
Estoy buscando un EA o script que una vez que he introducido los parámetros colocará por encima de las operaciones con SL y TP en los niveles especificados sólo mediante la introducción manual de un nivel de precios.
Esencialmente un straddle x 3.
¿Conoceis alguno en alguna parte?
Gracias y saludos,
Ian.