[Archive!] WRITING A COUNTRY TOGETHER!!!

 

I propose to write a joint advisor. I think it will help me to answer many interesting questions (about this after the project is finished), and secondly, maybe we will make a grail together:) And finally, for beginners (which I think I am in programming terms) it will be interesting to learn how to build MTS step by step. I took the simplest strategy as a base... Just open at breakout of the previous day's High/Low with a fixed TP and stop at this day's High/Low. Why exactly? Yes, because firstly, this system does not use any indicator, and secondly, the occupation factor from year 2000 up to now is 1.00 +/-0.03 (depending on historical data because it may be different), i.e. it is 50/50 and finally, I think that breaking through the previous day's High/Low is psychologically important for the market. I suggest to find other key levels or use auxiliary indices or something else, but the main thing is to get a more profitable Expert Advisor than presented below. This is a chart from 01.01.2009 up to date, you can get a more detailed report by yourself. The main idea is that other instruments should only help the system, and not build on them. I.e. we take a working system as a base and try to upgrade (improve) it. Here's what I got...

This TS is absolutely "naked", but it has potential...

I don't recommend using it for beginners... For the next 5 years it will drain ;)

So, the field is not ploughed...

Here is the code

//+-----------------------------------------------------------------------+
//|                                                     Крокодил ГЕНА.mq4 |
//|                                                         Крокодил ГЕНА |
//+-----------------------------------------------------------------------+
// Описание ТС
// 1. Открытие позиций происходит при пробитии High или Low предыдущего дня
//    SL ставиться на High или Low текущего дня, TP выставляется во внешних переменных, 
//    единственная оговорка не более 1 позиции в день в переменной LastTradeTime 
//    если в ней нет необходимост смело сносите /RomanS/
// 2.
// 3.
// 4.
// 5.
 
  // Внешние переменные
  extern double TakeProfit = 900; 
  extern double Lot        = 1;    
  extern string SYMBOL     = "EURUSD";
  
  // Глобальные переменные
  int LastTradeTime = 0;      // Время последней открытой сделки
  
  // Поехали... :)
  int start() 
  {  
     int Ticket;
  double BID,
         ASK,
         SL=0,
         TP=0;                                  
    bool Trade     = true,
         Open_Bay  = false,
         Open_Sell = false;

  // Проверяем можно ли торговать
  if ( Trade==true) 
   {
   
  // Критерии открытия позиций
    if (Bid > iHigh ( SYMBOL,PERIOD_D1,1)) Open_Bay = true; 
    if (Bid < iLow ( SYMBOL,PERIOD_D1,1)) Open_Sell = true;
        
  // Открытие позиций
      if ( Open_Bay == true && OrdersTotal()==0 && TimeDay(TimeCurrent())!= LastTradeTime)                                           
        {      
         RefreshRates(); 
         Alert("111111111111");
          ASK = MarketInfo( SYMBOL,10);                                
          SL = iLow( SYMBOL,PERIOD_D1,0);
          TP = ASK + TakeProfit*Point;
          if (( ASK- SL)/Point<MarketInfo( SYMBOL,14)) return;  // проверяем минимальный уровень стопов
          Alert("Пробуем открыть Buy ", SYMBOL, " по ", ASK, SL, TP);         
          Ticket=OrderSend( SYMBOL,OP_BUY, Lot, ASK,20, SL, TP);         
           if ( Ticket > 0)                                                  
            {            
             Alert ("Открыт ордер Buy ", Ticket);
             LastTradeTime=TimeDay(TimeCurrent()); // задаем время сделки, чтобы сегодня больше не торговать 
             return;                                                       
            }         
        }
     if ( Open_Sell == true && OrdersTotal()==0 && TimeDay(TimeCurrent())!= LastTradeTime)                                             
        {      
         RefreshRates();                                             
          BID = MarketInfo( SYMBOL,9);
          SL = iHigh ( SYMBOL,PERIOD_D1,0);
          TP = BID - TakeProfit*Point;
          if (( SL- ASK)/Point<MarketInfo( SYMBOL,14)) return; // проверяем минимальный уровень стопов
          Ticket = OrderSend( SYMBOL,OP_SELL, Lot, BID,20, SL, TP);         
           if ( Ticket > 0)                                                  
             { 
              Alert ("Открыт ордер Sell ", Ticket);
              LastTradeTime=TimeDay(TimeCurrent());  // задаем время сделки, чтобы сегодня больше не торговать
              return;                                   
             }         
          return;                                                       
        }
   
   // Закрытие позиции
   
   // Модификация ордера
   
   }
  return;       
  }



I'm not a pro... I'm an "amateur", so that it's easier to work with. Or in general... a new scheme. The main thing is that the condition







    if (Bid > iHigh ( SYMBOL,PERIOD_D1,1)) Open_Bay = true; 
    if (Bid < iLow ( SYMBOL,PERIOD_D1,1)) Open_Sell = true;

at this stage is maintained.

Thanks to all who responded.

Files:
 

Is the EA optimised across the board, and how long do the optimised parameters hold up?

 
ivandurak >> :

Is the EA optimised in all areas, and how long do the optimised parameters last?

What kind of optimisation?

>> Here (at this stage) you can only optimize the TP, of course you can run the lot, but there is no point

 

Yes, the field is not just uncultivated here, it is virgin land wherever you look, blessing that you can adjust levels as you like both in high-low and in all sorts of Camarillas and Murrays. As for the high-low, I have already built it - I can tell straight away that it is not a grail, because a decent system produces very big drawdowns. They will not appear so big if take positions are comparable to them. However for breakdown of a day one cannot take a long position - it simply will not work or will work in 6 months.

Thus I advise to use breakout systems based on narrow ranges where the take is larger than the breakout range. The most striking example is a breakout of a morning flat. It is absolutely correct in this sense.

If we want to use daybanks, we cannot do without additional reference points in the form of additional levels, tools and shaman's tambourine.

 
sayfuji >> :

Yes, the field is not just uncultivated here, it is virgin land wherever you look, blessing that you can adjust levels as you like with high-low and all sorts of Camarillas and Murrays. As for the high-low, I have already built it - I can tell straight away that it is not a grail, because a decent system produces very big drawdowns. They will not appear so big if take positions are comparable to them. However for breakdown of a day one cannot take a long position - it simply will not work or will work in 6 months.

Thus I advise to use breakout systems based on narrow ranges where the take is larger than the breakout range. The most striking example is a breakout of a morning flat. It is absolutely correct in this sense.

If we have to dance about daybanks, we cannot do without additional reference points in the form of additional levels, tools and shaman's tambourine.

Replace in the Expert Advisor

RERIOD_D1 to RERIOD_H4, maybe the result will be better.

To be honest, I haven't tried anything with this MTS... Just did it for the sake of interest...

As I said in the previous thread, on the forum of famous "A" DC, forumers have been writing together for a year...

Let us come up with something too... We have more programming potential...

 
RomanS писал(а) >>

What kind of optimisation?

Here (at this stage) only the T.Pro can be optimized, of course you can also run the lot, but there is no point

I'm referring to the virtual trading. The best parameters are chosen for real trading. If we write two EAs in one code, one works on a breakdown and the other on a bounce, the one that trades better.

 

Now I can already see the errors in our MTS

I wanted it to work for all currency pairs, but it worked only for EURUSD

I'll correct it now...

-----------------------------------------------+
//|                                                     Крокодил ГЕНА.mq4 |
//|                                                         Крокодил ГЕНА |
//+-----------------------------------------------------------------------+
// Описание ТС
// 1. Открытие позиций происходит при пробитии High или Low предыдущего дня
//    SL ставиться на High или Low текущего дня, TP выставляется во внешних переменных, 
//    единственная оговорка не более 1 позиции в день в переменной LastTradeTime 
//    если в ней нет необходимост смело сносите /RomanS/
// 2.
// 3.
// 4.
// 5.
 
  // Внешние переменные
  extern double TakeProfit = 900; 
  extern double Lot        = 1;    
  extern string SYMBOL     = "EURUSD";
  
  // Глобальные переменные
  int LastTradeTime = 0;      // Время последней открытой сделки
  
  // Поехали... :)
  int start() 
  {  
     int Ticket;
  double BID,
         ASK,
         SL=0,
         TP=0;                                  
    bool Trade     = true,
         Open_Bay  = false,
         Open_Sell = false;

  // Проверяем можно ли торговать
  if ( Trade==true) 
   {
   
   ASK = MarketInfo( SYMBOL,10);
   BID = MarketInfo( SYMBOL,9);
  
  // Критерии открытия позиций
    if ( BID > iHigh ( SYMBOL,PERIOD_D1,1)) Open_Bay = true; 
    if ( BID < iLow ( SYMBOL,PERIOD_D1,1)) Open_Sell = true;
        
  // Открытие позиций
      if ( Open_Bay == true && OrdersTotal()==0 && TimeDay(TimeCurrent())!= LastTradeTime)                                           
        {      
         RefreshRates(); 
          SL = iLow( SYMBOL,PERIOD_D1,0);
          TP = ASK + TakeProfit*Point;
          if (( ASK- SL)/Point<MarketInfo( SYMBOL,14)) return;  // проверяем минимальный уровень стопов
          Alert("Пробуем открыть Buy ", SYMBOL, " по ", ASK, SL, TP);         
          Ticket=OrderSend( SYMBOL,OP_BUY, Lot, ASK,20, SL, TP);         
           if ( Ticket > 0)                                                  
            {            
             Alert ("Открыт ордер Buy ", Ticket);
             LastTradeTime=TimeDay(TimeCurrent()); // задаем время сделки, чтобы сегодня больше не торговать 
             return;                                                       
            }         
        }
     if ( Open_Sell == true && OrdersTotal()==0 && TimeDay(TimeCurrent())!= LastTradeTime)                                             
        {      
         RefreshRates();                                             
          SL = iHigh ( SYMBOL,PERIOD_D1,0);
          TP = BID - TakeProfit*Point;
          if (( SL- ASK)/Point<MarketInfo( SYMBOL,14)) return; // проверяем минимальный уровень стопов
          Ticket = OrderSend( SYMBOL,OP_SELL, Lot, BID,20, SL, TP);         
           if ( Ticket > 0)                                                  
             { 
              Alert ("Открыт ордер Sell ", Ticket);
              LastTradeTime=TimeDay(TimeCurrent());  // задаем время сделки, чтобы сегодня больше не торговать
              return;                                   
             }         
          return;                                                       
        }
   
   // Закрытие позиции
   
   // Модификация ордера
   
   }
  return;       
  }
Files:
 
sayfuji >> :

If you're going to dance around the day, you'll need some additional guidance in the form of more levels, gimmicks and a shaman's tambourine.

So, champagne and tambourine have to go together...

Alone, less chance, you have to communicate, that's what the forum is for...

 

Good afternoon, RomanS.

This is a great idea. I very often see traders on foreign forums teaming up and creating an expert by mutual efforts. I am ready to support it.

As for your idea, it is a sinking idea. And it is not a grail. If we are going to work, let us work seriously, hoping otherwise, why start all this? My opinion: you have to build the system only for M1 EUR/USD. The algorithm should be based on the way of trend detection. Let's take, say, ....mm..... moving average with Tilson's smoothing algorithm. Then let's define the entry. We can take the crossing of two quick wands and use them to close. There are a lot of other "extras" that could be added. Suggest them :-). Plus, for sure there should be an MM with possibility to include Martin with custom settings.

In general, let's dance from here. Put your ideas for input/output. Let's do it together. But breaking through the high & low levels on D1 is a failure. sayfuji has got it right.

 

Why doesn't one branch, https://forum.mql4.com/ru/ 23917, write?

In general, people usually unite around an interesting idea, but this is a crisis of genre...

 
Alex5757000 >> :

Good afternoon, RomanS.

This is a great idea. I very often see traders on foreign forums teaming up and creating an expert by mutual efforts. I am ready to support it.

As for your idea, it is a sinking idea. And it is not a grail. If we are going to work, let us work seriously, hoping otherwise, why start all this? My opinion: you have to build the system only for M1 EUR/USD. The algorithm should be based on the way of trend detection. Let's take, say, ....mm..... moving average with Tilson's smoothing algorithm. Then let's define the entry. We can take the crossing of two quick wands and use them to close. There are a lot of other "extras" that could be added. Suggest them :-). Plus we will need an MM with possibility to include Martin with custom settings.

Anyway, let's dance around it. Come up with your ideas for the input/output. Let's do it together. But breaking through the high & low levels on D1 is a failure. sayfuji wrote it right.

The fact that so far it's not a grail (time will tell) is for sure!

The fact that it is not plum (in the long term), it is visible when you run it in the tester (50/50 sometimes works, sometimes not), but not plum... Prof.factor is about 1.00

Regarding M1, it's of course interesting, but unlikely it will interest a pro... Besides, I suggested the system not for daily trading... I tested it on M5, it generally makes no difference.

I tested it on M5 and it makes no difference.

To base the algorithm on a way of identifying a trend

You suggested a way to determine the trend, so do it.... What's the problem? We'll discuss it...

Let's take, say, ....mm..... a moving average with a Tilson smoothing algorithm.

No problem... you can put in a couple of lines of code and wollya... Prof factor's over 2.0.

That's the thing, I'm not suggesting that you should guess but do, and those who don't know how to do... should learn how others do it.

Personally, I (as an amateur) want to gain experience from the pros...

Reason: