Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 164

 
Forexman77:
I think mql5 has a very powerful strategy tester, without it it it is impossible to check forward tests in details. I optimize Expert Advisors on mql4 and start forward analysis, each profitable run takes a lot of time, but in mql5 I set optimization and see all profitable forwards. The question is whether this in-depth analysis will help to make a profitable EA stable. It will be a shame to waste time studying mql5 and then discover that it's all for nothing.

If you learn mql5 only for the sake of optimization, it's nonsense...

No, it is not.

 
Forexman77:
I think mql5 has a very powerful strategy tester, without it it it is impossible to check forward tests in details. I optimize Expert Advisors on mql4 and start forward analysis, each profitable run takes a lot of time, but in mql5 I set optimization and see all profitable forwards. The question is whether this in-depth analysis will help to make a profitable EA stable. It will be a shame to waste time studying mql5 and then discover that it's all for nothing.

I agree completely, the tester is powerful, especially if you use clouds and do not skimp on paying a bit of money, it will be even faster)). In any case, learning something new will not hurt. I tried the MQL5 MARKET to download demo versions of the most expensive EAs, and with the given parameters they are leaking in the tester even as)))). Holy crap, write a basic EA, tweak the report in Photoshop and sell)))))
 
I have made a simple Expert Advisor based on Ichimoku indicator. I need to open only one deal with one signal. i.e. when we make a sell deal, the black candle closes below the cloud - we open sell deal. The next sell trade is possible only if the price enters the cloud again and the black candle closes below the cloud. Currently, a trade opens if the black candle closes below the cloud and at
   double Red_Line = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_TENKANSEN,1); // красная линия 
   double Blue_Line = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_KIJUNSEN,1); // синяя линия 
   double UpO = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_SENKOUSPANA,1); // верхняя граница облака 
   double DounO = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_SENKOUSPANB,1); // нижняя граница облака 

     
   if(Volume[0]>1) return;

    // продажа
   if (Open[1]>Close[1] && Close[1] < DounO && Close[1] < Red_Line && Close[1] < Blue_Line) // продажа
   {
     Price = NormalizeDouble(Bid, Digits); // округляем до нужного нам числа цифр после запятой
     if(StopLoss >= STOPLEVEL)
      {
       SL = iHigh(Symbol(),0,1)+200*Point; // вычисляем стоплос
       SL = NormalizeDouble(SL, Digits); // округляем до нужного нам числа цифр после запятой
      }
       else SL = 0;
      if(TakeProfit > 0)
      {
       TP = Price - TakeProfit*Point;
       TP = NormalizeDouble(TP, Digits); 
      }
       else TP = 0;

      { 
      ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,"Pattern_1",Magic,0,Red);
      return;
      }
    }

Another sell transaction is made. You need to implement the principle: one signal - one trade.

I am grateful in advance for the help.

 

Look at the faq, it's there.

 
looked at the faq but couldn't find it, if you don't mind a link.
 

Professionals, please advise, there is a code like this

   double MA_M15_1 = iMA(NULL, PERIOD_M15, 14, 0, 0, 0, 1);
   double MA_M15_2 = iMA(NULL, PERIOD_M15, 28, 0, 0, 0, 1);
   
   int CmdType = -1;
   if (MA_M15_1 < MA_M15_2){
      CmdType = OP_BUY;
   }
   if (MA_M15_1 < MA_M15_2){
      CmdType = OP_SELL;
   }
   
   if (CmdType >= OP_BUY){
      
      for (i_try = 1; i_try <= 3; i_try++) {
            if (CmdType == OP_BUY) CurrPriceForOpen = NormalizeDouble(Ask, Digits);
            if (CmdType == OP_SELL) CurrPriceForOpen = NormalizeDouble(Bid, Digits);

            iTicket = _OrderSend(Symbol(), CmdType, LotOpen, CurrPriceForOpen, Slippage * (iDigitPoint / Point), 0, 0, EA_Comment, Magic, 0, CLR_NONE);

            if (iTicket >= 0) break;
            Sleep(1000);

         }
   }

Periodically gives error 4008 - what could it be?

 
T-G:

Pro tell me, there's a code like this

Periodically gives error 4008 - what could it be?



ERR_NOT_INITIALIZED_STRING 4008 Uninitialized string. To be honest, I haven't encountered such an error. Is EA_Comment declared somehow? The only line in the code...

So, what's this ????

 iTicket = _OrderSend(Symbol(), CmdType, LotOpen
 
Sepulca:


ERR_NOT_INITIALIZED_STRING 4008 Uninitialized string. To be honest, I haven't encountered such an error. Is EA_Comment declared somehow? The only line in the code...

So, what's this ????


This variable is set at the beginning and I don't touch it anymore.

extern string EA_Comment = "";

 
T-G:

This variable is set at the beginning and I don't touch it anymore.

extern string EA_Comment = "";


If the error occurs periodically, it might be that your DC attributes something abnormal to the string. The DC can and has the right to do so.

What's it say to me?

 
Sepulca:


If the error occurs from time to time, maybe your brokerage company attributes something abnormal to the line. You do not have to worry about it.

I have what it says.


Probably also a brokerage company - on a demo no errors, I have set an order on a real account, it won't open again and writes error!


The other EAs just work fine and this one periodically gives errors, what else could it be?

Reason: