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

 
Hola, ¿podríais decirme cómo enseñar a mi Expert Advisor a detectar fractales?
 
skyjet:
Hola, ¿puede decirme cómo enseñar a mi Asesor Experto a detectar fractales?

Me gustaría saber más detalles. Hay muchos índices diferentes que pueden dibujar y encontrar fractales. El Asesor Experto no necesita detectarlos. Se toma el indicador y se copian los valores de un determinado fractal de sus buffers. Nada complicado si se le presta atención.
 

¡Buenos días! Chicos, aconsejadme sobre este tema: en el Probador de Estrategias, el exp abre las órdenes según el algoritmo y esquema de aumento del tamaño del canal de las medias posteriores - lo podéis ver en la imagen - cada media posterior se abre a una distancia mayor de la anterior (como en Ilan). Pero al mismo tiempo, la impresora produce tales valores de expresiones, que el promedio no debe tener lugar, porque las condiciones para su apertura no se cumplen - 25 no es más que 2856, 2197, 1690. ¿Cómo entra en esta condición y abre posiciones en absoluto? Decidí rodear todo con corchetes, pero no sirve de nada.

Una prueba sobre los precios de apertura. Aquí está el código y la imagen:

...
// Внешние переменные (оптимизируются)
extern string A1 = " Параметры ММ ";
extern double Lots = 0.02;         // Стартовый лот

//-------------------                                  
extern double LotExponent = 2.7;  // на сколько умножать стартовый лот в степени - схема по Илану                                   

extern string A2 = " В настоящих пипсах ";
extern int StopLossPips_BUY = 100;   // уровень стартового усреднения в бай  объёма позиции в пипсах 


// Увеличение шага усреднений по схеме

extern double PipStepExponent_BUY  = 1.3; // на сколько умножать стартовый шаг в степени 

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

.....

// если стартовая открыта и достигнут уровень усреднения, то усреднить на  Lots * MathPow(LotExponent,NumberOfPositions(Symbol(), -1, MN_L));  
    if (NumberOfPositions(Symbol(), -1, MN_L)>=1 && 
       GetProfitOpenPosInCurrency(Symbol(), -1, MN_L)<0)   
      // if (MathAbs (GetProfitOpenPosInPoint(Symbol(), -1, MN_L)) > StopLossPips)  
          {
           if (GetTypeLastOpenPos(Symbol(), MN_L)==OP_BUY) 
              if (MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L)<0) // надо ли усреднять
                {
                 if (NumberOfPositions(Symbol(), -1, MN_L)==1) 
                    {// при первом усреднении, усреднять через стартовое количество пунктов - StopLossPips_BUY
                     if ( NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0)>StopLossPips_BUY)                 
                     {WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " первое усреднение вверх ", MN_L);
                      Print (" первое усреднение ");
                     }
                    } 
                 if (NumberOfPositions(Symbol(), -1, MN_L)>1) // при последующих - усреднять через  MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))  
                    {
                     if ( NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0) > 
                          NormalizeDouble((StopLossPips_BUY* MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1)),0))                                           
                     {
                       WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " усреднение вверх ", MN_L);          
                       Print (" последующие, если это больше ", NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0),
                              " этого, то открыть бай ", NormalizeDouble(StopLossPips_BUY*MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1),0));
                     }
                    }
                 }   
                     
              
           if (GetTypeLastOpenPos(Symbol(), MN_L)==OP_SELL) 
               if ((PriceOpenLastPos(Symbol(), OP_SELL, MN_L)-MarketInfo(OrderSymbol(), MODE_ASK))<0)
               
                  if (NumberOfPositions(Symbol(), -1, MN_L)==1)
                     {
                      if (NormalizeDouble((MathAbs(PriceOpenLastPos(Symbol(), OP_SELL, MN_L)-MarketInfo(OrderSymbol(), MODE_ASK))/Point),0)>StopLossPips_SELL)           
                      WmOrderSend(Symbol(), OP_SELL,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_SELL,MN_L))),Bid, 0, TP_START_SELL, " усреднение вниз ", MN_L);         
                     }
                     
          }           
.....

 
skyjet:
Hola, ¿pueden decirme cómo enseñar al Asesor Experto a detectar fractales?

Ver navegador. Si se trata de esto, es así.
 
Roman.:

¡Buenos días! Chicos, aconsejadme sobre este tema: en el Probador de Estrategias, el exp abre las órdenes según el algoritmo y esquema de aumento del tamaño del canal de las medias posteriores - lo podéis ver en la imagen - cada media posterior se abre a una distancia mayor de la anterior (como en Ilan). Pero al mismo tiempo, la impresora produce tales valores de expresiones, que el promedio no debe tener lugar, ya que las condiciones para su apertura no se cumplen - 25 no es más que 2856, 2197, 1690. ¿Cómo entra en esta condición y abre posiciones en absoluto? Decidí rodear todo con tirantes, pero no ayuda.

Una prueba sobre los precios de apertura. Aquí está el código y la imagen:


Según tengo entendido, sin ver todo el código y aprender cómo funciona aquí, es poco probable que alguien te lo diga. Todas las funciones que se utilizan en este bloque sólo las conoces tú. Lo mejor es imprimirlo todo sobre la marcha y vigilar la salida de los mensajes.
 
hoz:

Según tengo entendido, sin ver todo el código y aprender cómo funciona aquí, no creo que nadie pueda decírtelo. Todas las funciones que se utilizan en este bloque sólo las conoces tú. Lo mejor es imprimir todo sobre la marcha y vigilar la salida del mensaje.

Todas las funciones funcionan correctamente - son funciones de Kim I.V. "Sólo funciones útiles de Kim I.V." Por el nombre de las funciones - su propósito es claro.
 

Lo he resuelto: todo funciona correctamente. Debería haber sido impreso ANTES de abrir la posición.

 if (GetTypeLastOpenPos(Symbol(), MN_L)==OP_BUY) 
              if (MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L)<0) // надо ли усреднять
                {
                 if (NumberOfPositions(Symbol(), -1, MN_L)==1) 
                    {// при первом усреднении, усреднять через стартовое количество пунктов - StopLossPips_BUY
                     if ( NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0)>StopLossPips_BUY)                 
                        {
                         Print (" первое усреднение ",NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0),
                                " StopLossPips_BUY = ",StopLossPips_BUY, " MODE_BID = ", DoubleToStr(MarketInfo(OrderSymbol(), MODE_BID),Digits), " PriceOpenLastPos = ", DoubleToStr(PriceOpenLastPos(Symbol(), OP_BUY, MN_L),Digits), "P = ", DoubleToStr(Point,Digits));                 
                         WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " первое усреднение вверх ", MN_L);
                        }
                    } 
                 if (NumberOfPositions(Symbol(), -1, MN_L)>1) // при последующих - усреднять через  MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))  
                    {
                     if (NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0) > 
                         NormalizeDouble((StopLossPips_BUY* MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1)),0))                                           
                     {
                        Print (" последующие, если это больше ", DoubleToStr(NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0),Digits),
                              " этого, то открыть бай ", DoubleToStr(NormalizeDouble(StopLossPips_BUY*MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1),0),Digits),
                              " MODE_BID = ", DoubleToStr(MarketInfo(OrderSymbol(), MODE_BID),Digits), " PriceOpenLastPos = ", DoubleToStr(PriceOpenLastPos(Symbol(), OP_BUY, MN_L),Digits));
                       WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " усреднение вверх ", MN_L);          
                                           }
                    }
                 }   
           

La posición media se abrió según el algoritmo y la función PriceOpenLastPos(Symbol(), OP_BUY, MN_L) devolvió el valor de la posición recién abierta, por eso tenía dudas.

Gracias, hoz.

 

Roman, me alegro de que te haya funcionado :) Y además, tan rápido.

Básicamente, mi compilador ha empezado a insultar de nuevo. Hay una biblioteca que utiliza una clase en ella. La clase, por supuesto, está incluida en la biblioteca:

#include <HOZ_Code\Classes\CLogging.mqh>

CLogging logging;

Al compilar esta biblioteca, que utiliza la clase CLogging.mqh, el compilador jura lo siguiente

'#property' - name expected     CLogging.mqh    6       1

En la clase de esta línea:

¿Qué puede significar todo esto?

 
¿Cómo habilita/deshabilita el script la visualización de los niveles de negociación?
 

¡¡Ayuda!!

En un EA del foro público adjunté un patrón de 3 barras a una condición de entrada de la operación.

Después de la optimización y las pruebas (3,5 años) he instalado diez ventanas en una cuenta de demostración con la configuración individual en cada uno, que proporcionó la velocidad de ofertas de búho al menos 1,5 por día. La misma velocidad está garantizada en 10 ordenadores virtuales de mi servidor - una ventana en cada uno.

Ha pasado una semana pero no se ha llegado a ningún acuerdo en ninguna parte.

¿Qué hacer?

=========================

int GetSignal()
{
double LevelADX = iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,0);
double Delta_01_ADX =(iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,0)
- iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,2));
double mas,maf;
mas=iMA(NULL,TF_MA,Slow.period,0,Slow.metod,Slow.price,1);
maf=iMA(NULL,TF_MA,Fast.period,0,Fast.metod,Fast.price,1);
//------------------
double delta1,delta2;

delta1=NormalizeDouble((Close[1]-Close[2])/Point,5);
delta2=NormalizeDouble((Close[2]-Close[3])/Point,5);

double body3=NormalizeDouble((Open[3]-Close[3])/Point,5)
//------------------
int STsig=-1;
if(CrossLevel && Lines>0) {
int up,dw;
int up_l,dw_l;
for(jj=0;jj<8;jj++) {
if(ST[jj][0]<LevelDw) dw++; else{
if(ST[jj][0]>LevelUp) up++;
}
if(ST[jj][1]<LevelDw) dw_l++; else{
if(ST[jj][1]>LevelUp) up_l++;
}
}
if(up<=8-Lines && up_l>8-Lines) STsig=1;
if(dw<=8-Lines && dw_l>8-Lines) STsig=0;
}
if(STsig==-1 && BreakSweep) {
double big,small;
double big_l,small_l;
for(jj=0;jj<8;jj++) {
if(ST[jj][1]>big_l) big_l=ST[jj][1];
if(ST[jj][1]<small_l || small_l==0) small_l=ST[jj][1];
}
if(big_l-small_l<=Sweep && (small_l>=LevelUp || big_l<=LevelDw)) {
for(jj=0;jj<8;jj++) {
if(ST[jj][0]>big) big=ST[jj][0];
if(ST[jj][0]<small | small==0) small=ST[jj][0];
}
if(big-small>Sweep)

{

//--------------- mis complementos Volumen [] y Abrir [] y Cerrar [] ------------------------------

if(Close[1]>Close[2]&& Close[2]>Close[3]&& Close[3]<Open[3] && Close[2]>High[3]
&& body3>=Body3 && delta1>=Delta1 && delta2>Delta2 && big_l<=LevelDw && maf>mas)
STsig=0;

if(Close[1]<Close[2]&& Close[2]<Close[3]&& Close[3]>Open[3] && Close[2]<Low[3]
&& body3>=Body3 && delta1>=Delta1 && delta2>Delta2 && small_l>=LevelUp && maf<mas)
STsig=1;
}

}

}

if(Volumen[0]<2 && Volumen[1]>Volumen1 && Volumen[2]>Volumen2
&& Delta_01_ADX > DeltaADX && LevelADX < StopADX && STsig==0) return(OP_BUY);

if(Volumen[0]<2 && Volumen[1]>Volumen1 && Volumen[2]>Volumen2
&& Delta_01_ADX > DeltaADX && LevelADX < StopADX && STsig==1) return(OP_SELL);
return(-1);

}

=================================================

Gracias de antemano.

Razón de la queja: