Someone scribble a script for 5 wmz. - page 15

 

In commodity markets, there are instruments where the price often moves with surprising intraday consistency day in and day out! It is on such instruments that this methodology will work (in my opinion) very well!

For example, look at yesterday's and today's price movement of NGV0 (natural gas) and as they say - "find 10 differences" ...

 

Leonid. I don't mind anyone thriving. You're welcome! I only have one question: where were these winners two years ago? Why wasn't anyone chopping 1000% with their left thumb in 2008?

 

As for the signs of a trend, it's been discussed here for a long time and even something useful has been done. For example here https://www.mql5.com/ru/articles/1508#6586. However, they suggest to use some obscure indicator (which I don't like). Perhaps it is better to look at the colour of a candle (like Leonid's). But still the methodology of the author does not correspond to the honest determination of time-patterns! It starts some kind of numerology here... I think that's why many people perceive it ironically.

 

Can you please tell me why a normally compiled EA with no pre and error is not tested, there are no trades, what is it missing?

extern double Lots          = 0.1;
extern double StopLoss      = 120;
extern double TakeProfit    = 120;

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  int cnt, ticket, total;
  static int prevtime = 0;
   
        total=OrdersTotal();
if(total<1){  //если  нет открытых позиций
//+------------------------------------------------------------------+
//|               Открытие позиций понедельника                      |
//+------------------------------------------------------------------+
if ( DayOfWeek()==5){//если сегодня вечер пятницы
if ( Hour() == 23)  {//если - 22 часа терминального времени
// BUY
       if ( Close[1]<= Open[24] && Close[23]<=Open[48] && Close[47]<=Open[72]) {    
        
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask+StopLoss*Point,3,0,Ask+TakeProfit*Point,"Regulest",0,0,Green);}
         if(ticket < 0) {
            Print("Ошибка открытия ордера BUY #", GetLastError()); 
            Sleep(10000);  prevtime = Time[1];  return (0); }}
// SELL
if ( DayOfWeek()==5){//если сегодня вечер пятницы
if ( Hour() == 23)  {//если - 22 часа терминального времени
    if ( Close[1]>= Open[24] && Close[23]<=Open[48] && Close[47]<=Open[72]) {
    
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid-StopLoss*Point,3,0,Bid-TakeProfit*Point,"Regulest",0,0,Red);
         if(ticket < 0) {
            Print("Ошибка открытия ордера SELL #", GetLastError()); 
            Sleep(10000);  prevtime = Time[1];  return (0); }
          } 
        }
      return(0);
     }}}
//+------------------------------------------------------------------+
//|                     Закрытие позиций                             |
//+------------------------------------------------------------------+
      if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())  
        {
         if(OrderType()==OP_BUY)   // long position is opened
           {
            // should it be closed?
            if ( DayOfWeek()==1  && Hour() == 22)
                {
                 OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
                 return(0); // exit
                }
              }
           }
         else // go to short position
           {
            // should it be closed?
            if ( DayOfWeek()==1  && Hour() == 22)
              {
               OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
               return(0); // exit
              }      
           }  
   return(0);
  }  
//+------------------------------------------------------------------+
 
Profitabl:

Can you please tell me why a normally compiled EA with no pre and error is not tested, there are no trades, what is it missing?

Maybe a condition is not fulfilled. At Alpari, for example, there are no bars with the hour value of 23 on Friday. Put 22, as you have in your comment

if ( Hour() == 23)  {//если - 22 часа терминального времени
 

No, that's not the reason. I need it to recompile the whole CHF EA, which is perfectly tested in the tester, but does not trade with option "allow EA to trade" on. As a specialist, what do you think about the EA tuning? By the way, on Tuesday the EA was making trades, but then I did something to the code and it stopped making trades. What are the reasons for a normal EA to stop working?

 
Post a report including all ticks. Such a crude method of testing on such a large timeframe does not give a completely objective result. By the way, it is very interesting, how this code gives any result at all, because instead of the opening price in the opening function there is an attempt to set a stop loss))) this is a kindergarten, for God's sake :))
 
lasso:

Maybe the condition is not met. At Alpari, for example, there are no bars with an hour value of 23 on Friday. Put 22, as you have in your comment


I removed StopLosses "Ask-StopLoss*Point", "Bid-StopLoss*Point" and it started testing, but what should I do to make it test with them too?

       if ( Close[1]<= Open[24] && Close[23]<=Open[48] && Close[47]<=Open[72]) {    
        
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"Regulest",0,0,Green);}
         if(ticket < 0) {
            Print("Ошибка открытия ордера BUY #", GetLastError()); 
            Sleep(10000);  prevtime = Time[1];  return (0); }}
// SELL
if ( DayOfWeek()==5){//если сегодня вечер пятницы
if ( Hour() == 23)  {//если - 22 часа терминального времени
    if ( Close[1]>= Open[24] && Close[23]<=Open[48] && Close[47]<=Open[72]) {
    
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"Regulest",0,0,Red);
 
Techno:
Post a report with all ticks taken into account. Such a crude method of testing on such a large timeframe does not give a completely objective result. By the way, it is very interesting, how this code gives any result at all, because instead of an opening price in the opening function you try to set a stop loss))) it is kind of a kindergarten, for God's sake :))


I moved the StopLoss through one comma, I remember what I haven't done for two years, everything is tested. Ticks are not needed, conditions see very simple "the day before yesterday, yesterday, today"="tomorrow", NNN=BUY, NNV=SELL, trades coincide with what is needed. Due to impossibility to open positions for 30M periods prediction accuracy is lower, about 69% of deals are profitable, and manually more accurate, for example 327% annual chart is based on 254 deals, moreover 72% of deals are profitable.

Advisor's adjustment is painstaking, each of 40 forecasts has its own S\L and T\P, some forecasts with total -700ps were just replaced as undefined but refined in the tester, and block of lots calculation is 10% of the deposit, 1070% in 136 weeks turns into 8422476% profit if you start with a hundred of them. The risk of losses is comparatively low, maximum 8 consecutive losing trades at a fixed margin level of 1000% is easily tolerated; the critical point is somewhere between 14-16 consecutive losing trades, which is almost impossible with this system of theanalysis.

Positions in the tester can already be duplicated manually, but it would be better for the Expert Advisor to trade on its own, to hook it up to a rented server.

You will not help me to identify what in its code prevents the trades, because I cannot show the code or give you the EA - it is a psychological weapon, which can cause financial crises and defaults, in forex opening is harmless and serves only for profit, but this pattern is everywhere in all branches of science.

By the same token, get a prediction table and you will make the same EA in a week.

 

First, correct the main error.

You have the option to close positions inside a condition

  
        total=OrdersTotal();
if(total<1){  //если  нет открытых позиций

Where do you see the logic here? How can a position be closed if it is not there?

Reason: