Cualquier pregunta de novato, para no saturar el foro. Profesionales, no pasen de largo. En ninguna parte sin ti - 6. - página 221
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
He encontrado en el foro que esto es posible: https://www.mql5.com/ru/forum/141467
¿Y dónde puedo encontrar un emulador de garrapatas?
¿Así que no es posible implementar la emulación de ticks en los fines de semana con MQL4?
Justo en esa página, cuyo enlace has puesto en tu post. Léalo allí con más atención.
Sí, fui estúpido. Sólo necesito iniciar(); iniciar adicionalmente mediante init(){}...
int init(){inicio();}
...
void start(){...}
Gracias, lo he resuelto.
¿Cómo puedo canjear mis bonificaciones por dinero?
¿Las bonificaciones de quién?
Tengo el siguiente código:
extern datetime start = D'2013.10.17 23:59';
int inicio()
{
int b1=iBarShift(Symbol(),0,start,0);
double hb=iHigh(Symbol(),0,b1); //barra
double hb2=iHigh(Symbol(),0,b1-1); //barra de mañana desde la fecha especificada
Podrían decirme cómo poner el día de ayer de la fecha especificada, porque double hb3=iHigh(Symbol(),0,b1+1); no funciona...
¡¡¡Hola a todos!!! Tengo un EA que abre órdenes contra el movimiento, ¿cómo cambiar o aconsejar dónde cambiar?
cadena GLOB_START;
int init()
{
GLOB_START = "@" + DoubleToStr(ID,0) + "@" + "_start";
if !GlobalVariableCheck( GLOB_START )GlobalVariableSet(GLOB_START,TimeCurrent());
return(0);
}
int deinit()
{
switch( UninitializeReason() )
{
case REASON_REMOVE: delete_glob ("@" + DoubleToStr(ID,0) + "@" );
}
if ( IsTesting() )delete_glob ("@" + DoubleToStr(ID,0) + "@" );
return(0);
}
void delete_glob ( cadena c )
{
int i;
for ( i = GlobalVariablesTotal()-1; i>= 0 ; i-- )if ( StringFind(GlobalVariableName(i),c) >= 0 )GlobalVariableDel(GlobalVariableName(i))
}
int inicio()
{
Comentario(Info());
int KOL_BUY = pedido_total(0);
int KOL_SELL = total_de_pedido(1);
doble l;
if ( order_total() == 0 )
{
abierto(0,Lot,0,TP);
abierto(1,Lot,0,TP);
}
if ( KOL_BUY == 0 && KOL_SELL != 0 )
{
abierto(0,Lot,0,TP);
l = last_trade(1);
abierto(1,l,0,0);
modificar_órdenes(1);
}
if ( KOL_BUY != 0 && KOL_SELL == 0 )
{
abierto(1,Lot,0,TP);
l = last_trade(0);
abierto(0,l,0,0);
modificar_órdenes(0);
}
return(0);
}
string Info()
{
int i;
double buff_1 = 0, buff_2 = 0, buff_3 = 0;
string res = "\n";
for( i = OrdersHistoryTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
if( OrderMagicNumber() == ID )
{
if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,0) )buff_1 += OrderProfit();
if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,1) && OrderOpenTime() < iTime(NULL,PERIOD_D1,0) )buff_2 += OrderProfit();
if ( OrderOpenTime() >= GlobalVariableGet(GLOB_START) )buff_3 += OrderProfit();
}
}
res = res + "Beneficio en la moneda del depósito para " + TimeToStr(iTime(NULL,PERIOD_D1,0)) + ": " + DoubleToStr(buff_1,0) + "\n
res = res + "Beneficio en la moneda del depósito para " + TimeToStr(iTime(NULL,PERIOD_D1,1)) + ": " + DoubleToStr(buff_2,0) + "\n
res = res + "Beneficio en la moneda del depósito total:" + DoubleToStr(buff_3,0) + "\n";
return(res);
}
void modify_orders( int type )
{
int i;
datetime time_last = 0, time_first = TimeCurrent();
double SPREAD = MarketInfo(Symbol(),MODE_SPREAD)*MarketInfo(Symbol(),MODE_POINT), op_pr_last, op_pr_first, level;
for( i = OrdersTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == type )
{
if ( OrderOpenTime() > time_last )
{
op_pr_last = OrderOpenPrice();
time_last = OrderOpenTime();
}
if ( OrderOpenTime() < time_first )
{
op_pr_first = OrderOpenPrice();
time_first = OrderOpenTime();
}
}
}
si ( tipo == 0 )nivel = op_pr_last + MathAbs(op_pr_last-op_pr_first) * (SL/100);
si ( tipo == 1 )nivel = op_pr_last - MathAbs(op_pr_last-op_pr_first) * (SL/100);
for( i = OrdersTotal() - 1; i >= 0; i -- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == type && NormalizeDouble(OrderTakeProfit(),Digits) != NormalizeDouble(level,Digits) )OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),level,0)
}
}
double last_trade( int t )
{
int i;
doble res = -1;
datetime time=0;
for(i=Total de pedidos()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderOpenTime()>time && OrderMagicNumber()==ID && OrderType() == t)
{
res = OrderLots();
tiempo = OrderOpenTime();
}
}
if ( multiplicador )return(res * Lot_koeff);
si ( !multiplicador )devolver(res + Lot_koeff);
}
int open(int type, double l, double sl=0, double tp=0, string comm = "")
{
int isOpened = 0, try = 0;
doble s,t;
while ( IsTradeContextBusy() ){Sleep(500);}
RefreshRates();
if ( sl != 0 && sl < MarketInfo(Symbol(),MODE_STOPLEVEL) )sl = MarketInfo(Symbol(),MODE_STOPLEVEL);
if ( tp != 0 && tp < MarketInfo(Symbol(),MODE_STOPLEVEL) )tp = MarketInfo(Symbol(),MODE_STOPLEVEL);
si ( tipo == 0 )
{
si ( tp == 0 )t = 0;
if ( tp != 0 )t = Ask + tp * Point;
si ( sl == 0 )s = 0;
si ( sl != 0 )s = Oferta - sl * Punto;
}
si ( tipo == 1 )
{
si ( tp == 0 )t = 0;
si ( tp != 0 )t = Oferta - tp * Punto;
si ( sl == 0 )s = 0;
if ( sl != 0 )s = Ask + sl * Point;
}
s = NormalizarDoble(s,Dígitos);
t = NormalizarDoble(t,Dígitos);
if(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID);
if(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID);
Dormir(500);
while(isOpened<0)
{
while ( IsTradeContextBusy() ){Sleep(500);}
RefreshRates();
si ( tipo == 0 )
{
si ( tp == 0 )t = 0;
si ( tp != 0 )t = Oferta + tp * Punto;
si ( sl == 0 )s = 0;
si ( sl != 0 )s = Oferta - sl * Punto;
}
si ( tipo == 1 )
{
si ( tp == 0 )t = 0;
si ( tp != 0 )t = Ask - tp * Point;
si ( sl == 0 )s = 0;
if ( sl != 0 )s = Ask + sl * Point;
}
s = NormalizarDoble(s,Dígitos);
t = NormalizarDoble(t,Dígitos);
Inténtalo;
if(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID);
if(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID);
if(try > 5) break;
if(isOpened>=0)break;
Dormir(500);
}
if(isOpened<0) Alert("Pedido no abierto, error :", GetLastError());
return(isOpened);
}
int pedido_total( int tipo_1 = -1, int tipo_2 = -1 )
{
int i;
int kol=0;
for(i=Total de pedidos()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderMagicNumber()==ID && (OrderType() == type_1 | OrderType() == type_2) )kol++;
if(OrderMagicNumber()==ID && type_1 == -1 && type_2 == -1 )kol++;
}
return(kol);
}
double check_lot(double &lo)
{
double l = MarketInfo(Symbol(),MODE_LOTSTEP);
int ok = 0;
while ( l < 1 ){l*=10;ok++;}
if( lo < MarketInfo(Symbol(),MODE_MINLOT) )lo = MarketInfo(Symbol(),MODE_MINLOT);
if( lo > MarketInfo(Symbol(),MODE_MAXLOT) )lo = MarketInfo(Symbol(),MODE_MAXLOT);
return(NormalizarDoble(lo,ok));
¿Cómo puedo hacer una búsqueda de "Fondos:" (AccountEquity())?
Parámetros
extern double TrailingStart = 10000; // Nivel de salida
extern double TrailingStop = 100; // Tamaño de la cola
extern double TrailingStep = 10; // Paso final
¿Cómo puedo encontrar dos fractales superiores/inferiores seguidos? La imagen de abajo.
Intenté escribir un indicador, pero no lo pensé bien.
¿Tal vez alguien ha visto un indicador de este tipo listo?