Ayuda a la codificación - página 630

 
Hola Mladen, necesito de la imagen del filtro adjunto a continuación.
Archivos adjuntos:
filter.jpg  114 kb
 

Solicito un simple EA de Aroon.

Comprar: Cuando aroon up cruza por encima de aroon down. Salir cuando el aroon up cruce el nivel 50 down o cuando se produzca una señal opuesta, lo que ocurra primero. (Señal opuesta significa cuando el aroon up cruza por debajo del aroon down)

Vender: Cuando el aroon down cruza por encima del aroon up. Salga cuando el aroon down cruce el nivel 50 hacia abajo o cuando se produzca una señal opuesta, lo que ocurra primero. (Señal opuesta significa cuando el aroon down cruza por debajo del aroon up)

Todas las operaciones deben abrirse en la apertura de la siguiente vela después de que se produzca la señal.

Establezca el stop loss en el máximo o mínimo de la oscilación anterior. Si no es posible hacerlo, utilice el stoploss ATR o el stoploss manual.

Si es posible, por favor, añada la función de gestión de dinero también.

Su tiempo, habilidades y generosidad son muy apreciados. Saludos

Reymaq.

 
Hola, ¿alguien tiene fps buysell señal mq4? si sí significa puede por favor compartir aquí .. he visto sólo ex4 archivos..
 

de lo contrario quiero una ayuda. en este indicador alta baja se muestran con líneas amarillas cortas ... le gusta que después de que el precio de la baja del zigzag .. desde el precio en sí necesitan líneas cortas para 0,326% ,0.5%, 0.618% , 1%, 1.618%,2.27%,2.618%,3.33%, 4.236% i significa que el fibo retracement es para ese precio solo que es como (después de poner el low) low+(low*0.326/100)............ low +(low*0.5/100)........... como...

después de eso para el alto hecho significa .... mismo procedimiento como líneas cortas punteadas

alto(alto*0,326/100)........... alto -(alto*0,5/100)........

¿puede por favor alguien hacer esto por mi?

Estaré muy agradecido a u..

Archivos adjuntos:
 

Hola,

Me gustaría probar sus dos indicadores en un EA.

1 - SAR parabólico de KAMA 1_5. mq4

2 - Macd - std normalized.mq4 1_2 (Filtro)


Estoyprobando con el código de abajo para abrir órdenes .
Hice una prueba durante 3 meses en H1.
El resultado fue muy malo.

¿Hay alguna manera de mejorar la forma de apertura de las órdenes?

Resultado

extern int    BarToUse    = 1;       // Bar to test (0, for still opened, 1 for first closed, and so on)
extern string     IndicatorsSettings   = "===== INDICATORS SETTINGS=====";
extern string     _Indicator           = "===== Parabolic SAR =====";
extern double    AccStep         = 0.02;      // Accumulation step
extern double    AccLimit        = 0.2;       // Accumulation limit
extern int       AmaPeriod       = 10;        // Kaufman AMA period
extern int  AmaPrice        = 0;  // Price to be used by Kaufman AMA
extern double    FastEnd         = 2;         // Kaufman AMA fast end
extern double    SlowEnd         = 30;        // Kaufman AMA slow end
extern double    SmoothPower     = 2;         // Smooth power
extern bool      JurikFDAdaptive = true;      // Should the Kaufman AMA be Jurik fractal dimension adaptive?
//extern enDisplayType DisplayType = "" ; // What should be displayed?
extern int       LineWidth       = 2;         // Lines width
extern int       ArrowsWidth     = 0;         // Arrows (dots) width
extern bool      Interpolate     = true;      // Interpolate in multi time frame mode?
extern string PARAMETERS_INDICATOR_TWO = "Macd";
extern int                FastMAPeriod  = 23;            // Fast macd period
extern int                SlowMAPeriod  = 50;            // Slow macd period
extern int                SignalPeriod  = 9;             // Signal period
extern int                StdPeriod     = 50;            // Standard deviation used for normalization
extern int Price         = 0;   // Price to use 
extern double             Filter        = 0;             // Filter to apply to macd value
extern int                FilterPeriod  = 0;             // Filter period to use (<= to use the slow macd period)
extern colorOn            ColorChangeOn = clrOnSlope;    // Color change on : 

#define _doNothing 0
#define _doBuy     1
#define _doSell    2
int start()
{
   //MagicWarning();//Display a warning in case MagicNumber is changed
   AutoMagic();//Generate Magic Number based on Symbol and Long/Short params
   
      int doWhat = _doNothing;
      double sarUp = iCustom(NULL,0,"Parabolic SAR of KAMA 1_5",0,AccStep,AccLimit,AmaPeriod,AmaPrice,FastEnd,SlowEnd,SmoothPower,JurikFDAdaptive,0,BarToUse); 
      double sarDn = iCustom(NULL,0,"Parabolic SAR of KAMA 1_5",0,AccStep,AccLimit,AmaPeriod,AmaPrice,FastEnd,SlowEnd,SmoothPower,JurikFDAdaptive,1,BarToUse+1); 
      
      double macdUp= iCustom(NULL,0,"Macd - std normalized 1_2 histo",0,FastMAPeriod,SlowMAPeriod,SignalPeriod,StdPeriod,Price,Filter,FilterPeriod,ColorChangeOn,0,BarToUse);
      double macdDn= iCustom(NULL,0,"Macd - std normalized 1_2 histo",0,FastMAPeriod,SlowMAPeriod,SignalPeriod,StdPeriod,Price,Filter,FilterPeriod,ColorChangeOn,1,BarToUse+1);
      
         

        
      if (sarUp!=sarDn & macdUp!=macdDn)
         if (sarUp<sarDn & macdUp<macdDn) //buy
               doWhat = _doBuy;
         else  doWhat = _doSell;
         if (doWhat==_doNothing && !DisplayInfo) return(0);

   if (doWhat==_doBuy && openedBuys==0)
      {
         RefreshRates();
         //double BStopLossLevel   = Ask - StopLoss   *myPoint;
         //double BTakeProfitLevel = Ask + TakeProfit *myPoint;               
         double stopLossBuy   = 0; if (StopLoss>0)   stopLossBuy   =Ask - StopLoss   *myPoint; //Ask-StopLoss*Point*MathPow(10,Digits%2);
         double takeProfitBuy = 0; if (TakeProfit>0) takeProfitBuy =Ask + TakeProfit *myPoint; //Ask+TakeProfit*Point*MathPow(10,Digits%2);
         if (EcnBroker)
         {
            int ticketb = OrderSend(Symbol(),OP_BUY,LotSize,NormalizeDouble(Ask,digit),Slippage*myPoint,0,0,EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_B",MagicNumber,0,Blue);
            if (ticketb>-1)
               dummyResult = OrderModify(ticketb,OrderOpenPrice(),NormalizeDouble(stopLossBuy,digit),NormalizeDouble(takeProfitBuy,digit),0,CLR_NONE);
              
              
         }
         else dummyResult = OrderSend(Symbol(),OP_BUY,LotSize,NormalizeDouble(Ask,digit),Slippage*myPoint,NormalizeDouble(stopLossBuy,digit),NormalizeDouble(takeProfitBuy,digit),EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_B",MagicNumber,0,Blue);
          
      }
   if (doWhat==_doSell && diStcSell==true && openedSells==0)
      {
         RefreshRates();
         //double SStopLossLevel   = Bid + StopLoss   *Mypoint;
         //double STakeProfitLevel = Bid - TakeProfit *Mypoint;
         double stopLossSell   = 0; if (StopLoss>0)   stopLossSell=Bid + StopLoss   *myPoint; //Bid+StopLoss*Point*MathPow(10,Digits%2);
         double takeProfitSell = 0; if (TakeProfit>0) takeProfitSell =Bid - TakeProfit *myPoint; //Bid-TakeProfit*Point*MathPow(10,Digits%2);
         if (EcnBroker)
         {
            int tickets = OrderSend(Symbol(),OP_SELL,LotSize,NormalizeDouble(Bid,digit),Slippage*myPoint,0,0,EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_S",MagicNumber,0,Red);
            if (tickets>-1)
                dummyResult = OrderModify(tickets,OrderOpenPrice(),NormalizeDouble(stopLossSell,digit),NormalizeDouble(takeProfitSell,digit),0,CLR_NONE);
         }
         
         else dummyResult = OrderSend(Symbol(),OP_SELL,LotSize,NormalizeDouble(Bid,digit),Slippage*myPoint,NormalizeDouble(stopLossSell,digit),NormalizeDouble(takeProfitSell,digit),EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_S",MagicNumber,0,Red);
Archivos adjuntos:
 
borgesr:

Hola,

Me gustaría probar sus dos indicadores en un EA.

1 - SAR parabólico de KAMA 1_5. mq4

2 - Macd - std normalized.mq4 1_2 (Filtro)


Estoyprobando con el código de abajo para abrir órdenes .
Hice una prueba durante 3 meses en H1.
El resultado fue muy malo.

¿Hay alguna manera de mejorar la forma de apertura de las órdenes?

Por favor, lea este post : https://www.mql5.com/en/forum/186208/page3 sobre la optimización eventual. En cuanto a por qué funciona así : probablemente podría revisar las reglas que está utilizando cuando las órdenes se abren y se cierran. Pero en cualquier caso, revise las reglas que está utilizando y compruebe cuándo se cierran sus órdenes
 
ramzam:

Si no, quiero una ayuda. en este indicador alta baja se muestran con líneas amarillas cortas ... le gusta que después de que el precio de la baja del zigzag .. desde el precio en sí necesitan líneas cortas para 0,326% ,0.5%, 0.618% , 1%, 1.618%,2.27%,2.618%,3.33%, 4.236% i significa que el fibo retracement es para ese precio solo que es como (después de poner el low) low+(low*0.326/100)............ low +(low*0.5/100)........... como...

después de eso para el alto hecho significa .... mismo procedimiento como líneas cortas punteadas

alto(alto*0.326/100)........... alto -(alto*0.5/100)........

¿puede por favor alguien hacer esto por mi?

Estaré muy agradecido con ustedes.

No puedo comprobar el archivo por el momento. pero viendo el nombre, ¿estás seguro de que el uso de zigzag para las señales se puede utilizar de la manera que usted está esperando (siendo que el zigzag repinta)?
 
mladen:
Por favor, lea este post : https://www.mql5.com/en/forum/186208/page3 sobre la optimización eventual. En cuanto a por qué funciona así : probablemente podría revisar las reglas que está utilizando cuando se abren y cierran las órdenes. Pero en cualquier caso, revise las reglas que está utilizando y compruebe cuándo se cierran sus órdenes

Estimado Mladen,

La regla deapertura estaba mal.

He cambiado el código pero sigue con un rendimiento muy pobre perdiendo mucho dinero.


Para hacer el filtro junto con el Parabolic sería mejor utilizar el RSI?

      int doWhat = _doNothing;
      double sarUp = iCustom(NULL,0,"Parabolic SAR of KAMA 1_5",0,AccStep,AccLimit,AmaPeriod,AmaPrice,FastEnd,SlowEnd,SmoothPower,JurikFDAdaptive,0,BarToUse); 
      double sarDn = iCustom(NULL,0,"Parabolic SAR of KAMA 1_5",0,AccStep,AccLimit,AmaPeriod,AmaPrice,FastEnd,SlowEnd,SmoothPower,JurikFDAdaptive,1,BarToUse+1); 
      
      double macdUp= iCustom(NULL,0,"Macd - std normalized 1_2 histo",0,FastMAPeriod,SlowMAPeriod,SignalPeriod,StdPeriod,Price,Filter,FilterPeriod,ColorChangeOn,0,BarToUse);
      double macdDn= iCustom(NULL,0,"Macd - std normalized 1_2 histo",0,FastMAPeriod,SlowMAPeriod,SignalPeriod,StdPeriod,Price,Filter,FilterPeriod,ColorChangeOn,1,BarToUse+1);
      
         

        
      
         if (sarUp<sarDn & macdUp<macdDn) doWhat = _doBuy;
         if (sarUp>sarDn & macdUp>macdDn)  doWhat = _doSell;
         if (doWhat==_doNothing && !DisplayInfo) return(0);
         
  for (int i = OrdersTotal()-1; i>=0; i--)
   {
      if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
      if (OrderSymbol()      != Symbol())            continue;
      if (OrderMagicNumber() != MagicNumber)         continue;

      //
      //
      //
      //
      //
      
      if (DisplayInfo) currentProfit += OrderProfit()+OrderCommission()+OrderSwap();
         
         //
         //
         //
         //
         //
         
         if (OrderType()==OP_BUY)
            if (doWhat==_doSell )
                  { RefreshRates(); if (!OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Orange)) openedBuys++; }
            else  openedBuys++;
         if (OrderType()==OP_SELL)
            if (doWhat==_doBuy )
                  { RefreshRates(); if (!OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Green)) openedSells++; }
            else  openedSells++;            
   }
   if (DisplayInfo) Comment("Current profit : "+DoubleToStr(currentProfit,2)+" "+AccountCurrency()); if (doWhat==_doNothing) return(0);

   //
   //
   //
   //
   //
   if (doWhat==_doBuy && openedBuys==0)
      {
         RefreshRates();
         //double BStopLossLevel   = Ask - StopLoss   *myPoint;
         //double BTakeProfitLevel = Ask + TakeProfit *myPoint;               
         double stopLossBuy   = 0; if (StopLoss>0)   stopLossBuy   =Ask - StopLoss   *myPoint; //Ask-StopLoss*Point*MathPow(10,Digits%2);
         double takeProfitBuy = 0; if (TakeProfit>0) takeProfitBuy =Ask + TakeProfit *myPoint; //Ask+TakeProfit*Point*MathPow(10,Digits%2);
         if (EcnBroker)
         {
            int ticketb = OrderSend(Symbol(),OP_BUY,LotSize,NormalizeDouble(Ask,digit),Slippage*myPoint,0,0,EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_B",MagicNumber,0,Blue);
            if (ticketb>-1)
               dummyResult = OrderModify(ticketb,OrderOpenPrice(),NormalizeDouble(stopLossBuy,digit),NormalizeDouble(takeProfitBuy,digit),0,CLR_NONE);
              
              
         }
         else dummyResult = OrderSend(Symbol(),OP_BUY,LotSize,NormalizeDouble(Ask,digit),Slippage*myPoint,NormalizeDouble(stopLossBuy,digit),NormalizeDouble(takeProfitBuy,digit),EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_B",MagicNumber,0,Blue);
          
      }
   if (doWhat==_doSell & openedSells==0)
      {
         RefreshRates();
         //double SStopLossLevel   = Bid + StopLoss   *Mypoint;
         //double STakeProfitLevel = Bid - TakeProfit *Mypoint;
         double stopLossSell   = 0; if (StopLoss>0)   stopLossSell=Bid + StopLoss   *myPoint; //Bid+StopLoss*Point*MathPow(10,Digits%2);
         double takeProfitSell = 0; if (TakeProfit>0) takeProfitSell =Bid - TakeProfit *myPoint; //Bid-TakeProfit*Point*MathPow(10,Digits%2);
         if (EcnBroker)
         {
            int tickets = OrderSend(Symbol(),OP_SELL,LotSize,NormalizeDouble(Bid,digit),Slippage*myPoint,0,0,EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_S",MagicNumber,0,Red);
            if (tickets>-1)
                dummyResult = OrderModify(tickets,OrderOpenPrice(),NormalizeDouble(stopLossSell,digit),NormalizeDouble(takeProfitSell,digit),0,CLR_NONE);
         }
         
         else dummyResult = OrderSend(Symbol(),OP_SELL,LotSize,NormalizeDouble(Bid,digit),Slippage*myPoint,NormalizeDouble(stopLossSell,digit),NormalizeDouble(takeProfitSell,digit),EASHORTNAME+"_"+Symbol()+"("+GetChartTimeFrame()+")_S",MagicNumber,0,Red);
      }
   return(0);
}
 
borgesr:

Estimado Mladen,

La regla deapertura estaba mal.

He cambiado el código, pero todavía sigue con un rendimiento muy pobre perdiendo mucho dinero.


Para hacer el filtro junto con el Parabólico sería mejor usar el RSI?

Por favor, trate de optimizar su EA

 
kapoo:

Sr. Mladen, por favor mire los siguientes códigos, la flecha no aparece en vivo hasta que cambie de marco de tiempo.


Esa es una versión repintada del indicador sidus

La versión no repintada se puede descargar desde aquí: https: //www.mql5.com/en/forum/180648/page293