Cualquier pregunta de novato, para no saturar el foro. Profesionales, no pasen de largo. En ninguna parte sin ti - 6. - página 221

 
penzacity:

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?

Está en la página que enlazaste en tu post. Léelo con atención.
 
artmedia70:
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.

 
Yikes... Soy tan estúpido)))) No lo entiendes, no toques las funciones init(), deinit() y start() en vano. Sólo en la forma en que las grandes metacitas te dicen que ))))
 
¿Cómo puedo canjear mis bonificaciones por dinero?
 
Alexs65:
¿Cómo puedo canjear mis bonificaciones por dinero?

¿Las bonificaciones de quién?
[Eliminado]  

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...

[Deleted]  

¡¡¡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));

 
Buenos días a todos. Señores, tengo una pregunta, por favor iluminarme, si trabajo con Alpari y Master_Forex pruebo un Asesor Experto en las historias que descargo de mi terminal de trabajo, nada de fuera, no hay historias de la izquierda, como de Dukas, no hay programas auxiliares como Tick Data Suite, sólo el 90% de modelado desde el terminal de mi DS específicamente Alpari o Master_Forex, método ........ pruebo medio año en diferentes condiciones y parámetros, elegir el mejor, a continuación, volver a probar y el siguiente medio año, por lo que 2-5 años entonces todo en la pila y el búho está listo. ¿Puede esto ser un prepper fiable o todavía necesita el 99% y todo lo que se adjunta a ella.
¡¡¡Gracias!!! ........
 

¿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.

//+------------------------------------------------------------------+
//|                                           Dvigubas fraktalas.mq4 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_buffers 1

double FRACTAL[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,119);
   SetIndexBuffer(0,FRACTAL);
   SetIndexLabel(0,"Fractal");
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   int limit;
   
   
   
//---- последний посчитанный бар будет пересчитан
   if(counted_bars > 0) 
       counted_bars--;
   limit = Bars - counted_bars;
//---- основной цикл
   for(int i = limit; i > 0; i--)
     {           
         int f1 = GetFractal("", 0, 0);
         int f2 = GetFractal("", 0, 1);
         
        if( f1 == 1 && f2 == 1) FRACTAL[i] = High[i]+100*Point;
        else 
         if( f1 == 0 && f2 == 0) FRACTAL[i] = Low[i]- 100*Point;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+
        |
//+----------------------------------------------------------------------------+
int GetFractal(string sy="0", int tf=0, int nf=0) 
{
  if (sy=="" || sy=="0") sy=Symbol();
  int f=-1;
  int    i, k=iBars(sy, tf), kf;
  for (i=3; i<k; i++) 
  {
    if(iFractals(sy, tf, MODE_UPPER, i)>0)f=1;
    else
      if(iFractals(sy, tf, MODE_LOWER, i)>0)f=0;
    kf++;
    if (kf>nf) return(f);    
  }
  
}

¿Tal vez alguien ha visto un indicador de este tipo listo?