Experts: NirvamanImax - page 2

 
telerater:

Hello Nirvaman, I guess the idea of 'trailing stop' kind of appealed you. I hope you dont mind of my suggestions. Since trading at such a short period like M1, SL&TP has to be dynamic. As long as the entry points are 51 % positive than keeping loses at the min level is crutiualy important. As an example, after the entry point surfing at the positive side has to be ended definately with a result of plus. Either its 0 pip 1pip. While forwardtesting with your code, unfortunately, many time I have experienced trades that couple of times turned from plus to minus then plus again and 50% of time ended minus. For dynamic exiting appliying 20 LWMA (or EMA) Low and High both on the same chart and use long exit at cross of a 20 LWMA Low period, for the short exit at the cross of a 20 LWMA High period. Therefore, once we are at the positive territory depending on the slope (speed) after cople of munites trade becomes safe from minus result.For the profit target may be placed three choices depending on the trade period average of the optimized results. If you like we can discuss more over via mail.. thanks again in advance for your nice work and precious time.

ok. I will code that. Meanhile here goes a version of NirvamanImax with trailing stoploss. I will put it as an attachment up here. it makes a smoother curve of profits in backtesting. Now i will code your idea with dynamic exit. I am looking for an idea like that. it seems that you are doing your homework, so i like to accept the suggestions of people who do their homework like you do.

 

Hello again, I guess this is a life style rather than a homework; we like to achieve our targets with love and passion and your are one of them. It would be wise to code MA with options of Time Frame, Applied Price and Ma. Method. This will give us a wide range of opportunity to test for the optimum result. If you don’t have MTF MA.mq4 ind. (with all features above), I can mail it to you. My point of view, the best side of your code is dynamic and this logic has to be kept unique as any code added on to it. However, have you ever considered to smooth the HA a little bit? Thanks.

 
telerater:

Hello again, I guess this is a life style rather than a homework; we like to achieve our targets with love and passion and your are one of them. It would be wise to code MA with options of Time Frame, Applied Price and Ma. Method. This will give us a wide range of opportunity to test for the optimum result. If you don’t have MTF MA.mq4 ind. (with all features above), I can mail it to you. My point of view, the best side of your code is dynamic and this logic has to be kept unique as any code added on to it. However, have you ever considered to smooth the HA a little bit? Thanks.

ok. my email is nirvaman@gmail.com you can send that to my email. (note for people in the forum: please send your questions to my user in this forum and not to my email)

 
nirvaman:
telerater:

Hello again, I guess this is a life style rather than a homework; we like to achieve our targets with love and passion and your are one of them. It would be wise to code MA with options of Time Frame, Applied Price and Ma. Method. This will give us a wide range of opportunity to test for the optimum result. If you don’t have MTF MA.mq4 ind. (with all features above), I can mail it to you. My point of view, the best side of your code is dynamic and this logic has to be kept unique as any code added on to it. However, have you ever considered to smooth the HA a little bit? Thanks.

ok. my email is nirvaman@gmail.com you can send that to my email. (note for people in the forum: please send your questions to my user in this forum and not to my email)



I already tryed a smoth HA some time ago. I will do it again just to check results again

 
nirvaman:
nirvaman:
telerater:

Hello again, I guess this is a life style rather than a homework; we like to achieve our targets with love and passion and your are one of them. It would be wise to code MA with options of Time Frame, Applied Price and Ma. Method. This will give us a wide range of opportunity to test for the optimum result. If you don’t have MTF MA.mq4 ind. (with all features above), I can mail it to you. My point of view, the best side of your code is dynamic and this logic has to be kept unique as any code added on to it. However, have you ever considered to smooth the HA a little bit? Thanks.

ok. my email is nirvaman@gmail.com you can send that to my email. (note for people in the forum: please send your questions to my user in this forum and not to my email)



I already tryed a smoth HA some time ago. I will do it again just to check results again


seems that it earns less money with smooth HA but it is more stable in the longer time. is interesting. if you want it pm me.

 

Hi dear nirvaImax, excuse me for asking my basic question :

Please do me a favor and tell me How can I optimize the expert ?

Which variable must have check mark during optimization ?

Please describe Optimization process that I have to do it every weekend .

Thank you, Regards : Ost

 
nirvaman:
telerater:

Hello Nirvaman, I guess the idea of 'trailing stop' kind of appealed you. I hope you dont mind of my suggestions. Since trading at such a short period like M1, SL&TP has to be dynamic. As long as the entry points are 51 % positive than keeping loses at the min level is crutiualy important. As an example, after the entry point surfing at the positive side has to be ended definately with a result of plus. Either its 0 pip 1pip. While forwardtesting with your code, unfortunately, many time I have experienced trades that couple of times turned from plus to minus then plus again and 50% of time ended minus. For dynamic exiting appliying 20 LWMA (or EMA) Low and High both on the same chart and use long exit at cross of a 20 LWMA Low period, for the short exit at the cross of a 20 LWMA High period. Therefore, once we are at the positive territory depending on the slope (speed) after cople of munites trade becomes safe from minus result.For the profit target may be placed three choices depending on the trade period average of the optimized results. If you like we can discuss more over via mail.. thanks again in advance for your nice work and precious time.

ok. I will code that. Meanhile here goes a version of NirvamanImax with trailing stoploss. I will put it as an attachment up here. it makes a smoother curve of profits in backtesting. Now i will code your idea with dynamic exit. I am looking for an idea like that. it seems that you are doing your homework, so i like to accept the suggestions of people who do their homework like you do.


trailing strategy is working nice in backtesting, but the strategy that uses LWMA is not working better. if you want me can chat and may be we can explore ideas.

 
Ost:

Hi dear nirvaImax, excuse me for asking my basic question :

Please do me a favor and tell me How can I optimize the expert ?

Which variable must have check mark during optimization ?

Please describe Optimization process that I have to do it every weekend .

Thank you, Regards : Ost

You have to optimize all variables. the only 2 variables that must not be optimized are lots and Mn. I recomendo you to optimize it all the weekends. if you dont understand the optimization process I recomend you to read http://articles.mql4.com/361 the range of optimization could be 2 weeks. here goes a file of the optimization setting you should use. plase save it as a .set file and load those settings in the tester properties.


lots=0.10000000
lots,F=0
lots,1=0.10000000
lots,2=0.00000000
lots,3=0.00000000
mn=555
mn,F=0
mn,1=555
mn,2=0
mn,3=0
tp=44.00000000
tp,F=1
tp,1=0.00000000
tp,2=2.00000000
tp,3=50.00000000
sl=276.00000000
sl,F=1
sl,1=0.00000000
sl,2=2.00000000
sl,3=500.00000000
periodos=183.00000000
periodos,F=1
periodos,1=0.00000000
periodos,2=1.00000000
periodos,3=200.00000000
tiempoCierre=23700
tiempoCierre,F=1
tiempoCierre,1=0
tiempoCierre,2=300
tiempoCierre,3=28800
TrailingStop=40
TrailingStop,F=1
TrailingStop,1=0
TrailingStop,2=1
TrailingStop,3=50

 

Hello, nirvaman, congratulation to your EA which handle with Laguerre Data Distribution. One question please: is it necessary to adjust some parameter of HA or imax3..? You wrote that you plan to put TS on the EA. That is a good idea. The list above listed

TrailingStop=40
TrailingStop,F=1
TrailingStop,1=0
TrailingStop,2=1
TrailingStop,3=50

but there ist no parameter entry in the EA. Can you please put in on?

When I think about popular Distributions of Data I found the Bernoulli Data Distribution. I will test to bring this concept to course moving.

 
//+------------------------------------------------------------------+
//|                                 NirvamanImax.mq4                 |
//|                      Copyright © 2008, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Gabriel Jaime Mejía Arbelaez"
#property link      "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//|                                                   e-Trailing.mq4 |
//|                                           Êèì Èãîðü Â. aka KimIV |
//|                                              http://www.kimiv.ru |
//|***   Trailing-Stop   ***                                         |
//| 12.09.2005 Àâòîìàòè÷åñêèé Trailing Stop âñåõ îòêðûòûõ ïîçèöèé    |
//|            Âåøàòü òîëüêî íà îäèí ãðàôèê                          |
//+------------------------------------------------------------------+
#property copyright "Êèì Èãîðü Â. aka KimIV"
#property link      "http://www.kimiv.ru"
//------- Âíåøíèå ïàðàìåòðû ------------------------------------------
extern bool   ProfitTrailing = True;  // Òðàëèòü òîëüêî ïðîôèò
extern int    TrailingStop   = 8;     // Ôèêñèðîâàííûé ðàçìåð òðàëà
extern int    TrailingStep   = 2;     // Øàã òðàëà
extern bool   UseSound       = True;  // Èñïîëüçîâàòü çâóêîâîé ñèãíàë
extern string NameFileSound  = "expert.wav";  // Íàèìåíîâàíèå çâóêîâîãî ôàéëà
//---- input parameters
extern double       lots = 0.1;
extern int          mn = 555;
static int          prevtime = 0;
extern double       tp = 100;
extern double       sl = 50;
extern double       periodos=13;
extern int          tiempoCierre=15000;
//extern int          TrailingStop=10;   //add
int StartHour=22;
int EndHour=2;
int BrokerTimeZone=0;
int start()
{
   if (Time[0] == prevtime) return(0);
   prevtime = Time[0];
   if (! IsTradeAllowed()) {
      again();
      return(0);
   }
   
   //----------------------------------------cerrando orden abierta despues de la primera barra
   
   
   int total = OrdersTotal();
   for (int i = 0; i < total; i++) {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == mn)
      {
          if(TimeCurrent()-OrderOpenTime()>=tiempoCierre)
          {
             
              OrderClose(OrderTicket(),lots,MarketInfo(Symbol(),MODE_BID),3,GreenYellow);
          }
          else
          {
               return(0);
          }
      }
   }
  //----------------------------------------------------------------------------------------
   int ticket = -1;
   int perceptron = Supervisor();
   int ha=0;
   
   double buff0=0;
   double buff1=0;
   
  
   
   buff0=iCustom(NULL, 0, "HA",2,0);
   buff1=iCustom(NULL, 0, "HA",3,0);
   
   
   
   if(buff0>buff1)
    ha=-1;
   
   if(buff0<buff1)
    ha=1;
   //-----------------------------------------------------------------------------------------
   
   
    double  promedioEMA=iCustom(NULL, 0, "Moving Averages2",periodos,0,0);
   
   
   //----------------------------------------------------------No operar en este rango de horas
   int h=TimeHour(TimeCurrent()-BrokerTimeZone);
       
    if(!(h> StartHour && h<EndHour))
    {
    
    
     
   
   
   if ( perceptron > 0 && ha > 0 && Close[1]>promedioEMA) {
      ticket = OrderSend(Symbol(), OP_BUY, lots, Ask,2, Bid - sl * Point, Bid + tp * Point, WindowExpertName(), mn, 0, Blue);
      Alert("SEÑAL:"+Symbol());
      if (ticket < 0) {
         again();    
      }
   }
   if (perceptron < 0 && ha <0  && Close[1]<promedioEMA) {
      ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, 2, Ask + sl * Point, Ask - tp * Point, WindowExpertName(), mn, 0, Red);
      Alert("SEÑAL:"+Symbol());
      if (ticket < 0) {
         again();
      }
   }   
   
   }
    
   return(0);
      
   //------------------------------------------------------------------------------                       
}
void again() {
   prevtime = Time[1];
   Sleep(30000);
}
/*+-------------------------------------------------------------------+
  | supervisor encargado de determinar si se hace long o short        |
  +-------------------------------------------------------------------+*/
double Supervisor()
{
    double iMAX0=iCustom(NULL, 0, "iMAX3alert1",4,0);
    double iMAX1=iCustom(NULL, 0, "iMAX3alert1",5,0);
    
    double iMAX01=iCustom(NULL, 0, "iMAX3alert1",4,1);
    double iMAX11=iCustom(NULL, 0, "iMAX3alert1",5,1);
    
    double b0=0;
    double b1=0;
    double r0=0;
    double r1=0;
    
    b0 = iMAX0;
    b1 = iMAX01;
    r0 = iMAX1;
    r1 = iMAX11;
    
    if(b0 > r0 && b1 < r1)
         return(1);
         
    if(b0 < r0 && b1 > r1)
         return(-1);   
    
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
if(OrderMagicNumber() == mn)
  for (int i=0; i<OrdersTotal(); i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      TrailingPositions();
    }
  }
}
//+------------------------------------------------------------------+
//| Ñîïðîâîæäåíèå ïîçèöèè ïðîñòûì òðàëîì                             |
//+------------------------------------------------------------------+
void TrailingPositions() {
  double pBid, pAsk, pp;
  pp = MarketInfo(OrderSymbol(), MODE_POINT);
  if (OrderType()==OP_BUY) {
    pBid = MarketInfo(OrderSymbol(), MODE_BID);
    if (!ProfitTrailing || (pBid-OrderOpenPrice())>TrailingStop*pp) {
      if (OrderStopLoss()<pBid-(TrailingStop+TrailingStep-1)*pp) {
        ModifyStopLoss(pBid-TrailingStop*pp);
        return;
      }
    }
  }
  if (OrderType()==OP_SELL) {
    pAsk = MarketInfo(OrderSymbol(), MODE_ASK);
    if (!ProfitTrailing || OrderOpenPrice()-pAsk>TrailingStop*pp) {
      if (OrderStopLoss()>pAsk+(TrailingStop+TrailingStep-1)*pp || OrderStopLoss()==0) {
        ModifyStopLoss(pAsk+TrailingStop*pp);
        return;
      }
    }
  }
}
//+------------------------------------------------------------------+
//| Ïåðåíîñ óðîâíÿ StopLoss                                          |
//| Ïàðàìåòðû:                                                       |
//|   ldStopLoss - óðîâåíü StopLoss                                  |
//+------------------------------------------------------------------+
void ModifyStopLoss(double ldStopLoss) {
  bool fm;
  fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldStopLoss,OrderTakeProfit(),0,CLR_NONE);
  if (fm && UseSound) PlaySound(NameFileSound);
}
//+------------------------------------------------------------------+
         
    
telerater
wrote:

Hello Nirvaman, I guess the idea of 'trailing stop' kind of appealed you. I hope you dont mind of my suggestions. Since trading at such a short period like M1, SL&TP has to be dynamic. As long as the entry points are 51 % positive than keeping loses at the min level is crutiualy important. As an example, after the entry point surfing at the positive side has to be ended definately with a result of plus. Either its 0 pip 1pip. While forwardtesting with your code, unfortunately, many time I have experienced trades that couple of times turned from plus to minus then plus again and 50% of time ended minus. For dynamic exiting appliying 20 LWMA (or EMA) Low and High both on the same chart and use long exit at cross of a 20 LWMA Low period, for the short exit at the cross of a 20 LWMA High period. Therefore, once we are at the positive territory depending on the slope (speed) after cople of munites trade becomes safe from minus result.For the profit target may be placed three choices depending on the trade period average of the optimized results. If you like we can discuss more over via mail.. thanks again in advance for your nice work and precious time.


Hubexde
wrote:

Hello, nirvaman, congratulation to your EA which handle with Laguerre Data Distribution. One question please: is it necessary to adjust some parameter of HA or imax3..? You wrote that you plan to put TS on the EA. That is a good idea. The list above listed

TrailingStop=40
TrailingStop,F=1
TrailingStop,1=0
TrailingStop,2=1
TrailingStop,3=50

but there ist no parameter entry in the EA. Can you please put in on?

When I think about popular Distributions of Data I found the Bernoulli Data Distribution. I will test to bring this concept to course moving.


Hello, Nirvaman, I tested your EA with trailingstop but it does not work. Therefore I put one functionable EA on it and you can see the result: during my testings I optimize the parameter and got a smaller profit but less risk. That I can see: optimizing for a small period will not give good results for long periods and vice versa. If we use TS and optimizing for a short period that can be one way ...

I enclose your EA with one TS: NirvamanImaxTS

Reason: