Is the advisor ordered on a turnkey basis or in parts? - page 6

 
Nikolay Khrushchev:

That's how you read it, not me).
Once again, I think it should be in the base, because if an EA cannot pass validation (except for exceptions), it's not ready to trade on a real / demo account.

The simplest: The code is taken from codobase and as an example mql4

//+-------------------------------------------------------------------------------------------------------------------------------------------------+
//| Функция открывает позицию по текущей цене                                                                                                       |
//+-------------------------------------------------------------------------------------------------------------------------------------------------+
void OpenPosition(int type)
{
   double price=0.0;
   if(type==OP_BUY)  price=Ask;
   if(type==OP_SELL) price=Bid;
   
   int ticket=OrderSend(_Symbol,type,fixVolume,price,0,0,0,"",magic,0);
   
   if(ticket>0)
    Print("Открылась позиция, тикет: ",ticket);
     else
    Print("Позиция не открылась, ошибка: ", GetLastError());
}
//+-------------------------------------------------------------------------------------------------------------------------------------------------+
//| Функция закрывает позицию по текущей цене                                                                                                       |
//+-------------------------------------------------------------------------------------------------------------------------------------------------+
void ClosePosition(void)
{
   for(int i=OrdersTotal()-1; i>=0; i--)
      if(OrderSelect(i,SELECT_BY_POS))
         if(OrderSymbol()==_Symbol && OrderMagicNumber()==magic)
         {
            if(OrderType()==OP_BUY)
               if(OrderClose(OrderTicket(),OrderLots(),Bid,0))
                  Print("Закрылась позиция Buy, тикет: ", OrderTicket());
               else
                  Print("Позиция Buy не закрылась, тикет: ", OrderTicket(),", ошибка: ",GetLastError());
                  
            if(OrderType()==OP_SELL)
               if(OrderClose(OrderTicket(),OrderLots(),Ask,0))
                  Print("Закрылась позиция Sell, тикет: ", OrderTicket());
               else
                  Print("Позиция Sell не закрылась, тикет: ", OrderTicket(),", ошибка: ",GetLastError());
         }
}

This code will pass the check without a single error. If the position is not opened, well, never mind, if it is not closed, it is not destiny either.

I think you can understand the consequences of this code as applied to an account.

.........................................................................................

As my brother-in-law says: If a man can do bad things for a cheap price and good for a price, he is a charlatan and you should not have anything to do with him.

Nikolay Khrushchev, do not take it personally - everything is generalized.

 
Vitaly Muzichenko:

This code will pass the test without a single error. Well, the position didn't open, so what if it didn't close, then it's no fate either.

Alas, no )
There are two errors at once.
1) The lot is wrong (I tried it both with and without the possibility to change the input, with 0.1 lot
2) The messages must be in Roman letters, you mean Print. But it's omitted, is not considered in the scope of the question, does not relate to the quality in any way.

do not underestimate the developers who made this automatic validation, there is not everything so primitive )

also do not account for child errors in the main code, such as division by 0 ) automatic validation and it is able to detect. Not guaranteed, but it can.

Files:
 

And this is the person who is commissioned to write EAs????????????

Forum on trading, automated trading systems and testing trading strategies

How to get the value of the previous high by the fifth digit.

Nikolay Khrushchev, 2019.01.27 16:20

it is not rounded.
If you use Print to see the result, that's the point.
Use Print (DoubleToString(High[1],_Digits)); to explicitly specify what you want with an accuracy of 5 digits. By default, Print rounds to 4 decimal places in most cases.


How I feel for the customers.

 
Alexey Viktorov:

And this is the person who is commissioned to write the councillors????????????


I'm so sorry for the customers.

What's wrong with it? It's not rounding, it's discarding, or what?

 
Alexey Viktorov:

And this is the person who is commissioned to write EAs????????????


How I sympathise with the customers.

don't you think you should test it before you shit on a forum? )))
If you don't know the specifics of the terminal, don't attack the developers with insults, you could easily end up making fools of yourself.

Forum on trading, automated trading systems and testing trading strategies

How to get the value of the previous high by the fifth digit.

sts141, 2019.01.27 17:57

damn. it worked. thank you so much!!!! I don't even know how to thank you)))

Files:
SNAG-0220.png  194 kb
 
Vitaly Muzichenko:

As my cousin says: If a person can do bad for cheap and good for expensive = that person is a charlatan, and you can't have anything to do with him.

I assume that your cousin wants to do well for cheap, which is particularly characteristic (even if he won't admit it). But unfortunately that's not how it works. In fact, they want to get cheap, get a bad, and then swear that the performer is a charlatan and make a good face at a bad game, as if they did not realize it from the beginning, when they wanted to get good for cheap, but got as usual ... Although a self-respecting coder wouldn't do such a thing, of course. But in business no one cares about the respect or disrespect of competitors

 
Ilya Malev:

I assume that your cousin wants to get well for cheap, which is particularly characteristic (even if he won't admit it). But unfortunately this is not the case. In fact, they want to get cheap, get a bad one, and then swear that the performer is a charlatan and make a good face at a bad game, as if they did not understand it from the beginning, when they wanted to get good for cheap, but got the same as always... Although a self-respecting coder wouldn't do such a thing, of course. But in business nobody cares about the respect or disrespect of competitors

I'm renovating a house and I've been looking for a screed contractor, and I've looked through a lot of options. Found a guy, they slammed the price immediately and promised it would be awesome, because the other to do and can not. They made such a crap, that I second month, I do not understand why I paid a lot of money.

Well, everything you have described is a theory.

There is a particular job and there are performers, so it is impossible to do for a different price different quality, we are not asking to do the job badly.
There are times when it is not the season and people do not have work, so at these moments and you can get quality work for cheap.
Like buying your wife a winter coat in early spring at a seasonal discount of 30%. Or do you think you will get a Chinese fake fur coat for that price?

 
Vitaly Muzichenko:

I'm renovating a house and I've been looking for screed guys, and I've been going through a lot of options. I found some guys, they charged me a lot of money and promised me it would be awesome, because they couldn't do it any other way. They made such a crap, that I second month, I do not understand why I paid a lot of money.

All that you have described is theory.

There are certain jobs and certain performers, so you can't do different quality for different prices, we're not asking you to do a bad job.
There are times when it is not the season and people do not have work, so at these moments and you can get quality work for cheap.
Like buying your wife a winter coat in early spring at a seasonal discount of 30%. Or do you think you will get a Chinese fake fur coat for that price?

I think the theory is just what you are writing. An experienced and in-demand specialist will almost always have orders of the quality (in terms of price and interest) that he himself wants. Even if he takes a complex job at a reduced fee, he will not be motivated to think through all the details and work on it to the best of his ability.

 
Why are you picking on the price. As far as you can see from the correspondence, the price was 80 USD, as the freeze was at 72. So it's more likely that the contractor set the price himself, or it suited him.
And the question as such is in the title of the thread. A little extended in the first post. Which has long since been answered.
 
80 for the whole thing? Well, that's not surprising.
Reason: