MQL5: Validation :-( I've already racked my brain to find out what it is and how it's solved. - page 6

 
Все непросто, все совсем просто. При открытии короткой позиции Вы проверяете наличие денег для открытия длинной. 
//+-----------------------------------------------------------------------------------------------+
//| Функция открывает позицию Sell                                                                |
//+-----------------------------------------------------------------------------------------------+
void OpenSell(void)
{
   double volume=CalculateVolume(ORDER_TYPE_SELL);
   //volume=CheckVolumeValue(volume);
   //volume=NormalizeDouble(volume,DigitsLots());
   volume=LotCheck(volume,symb);
   if(!CheckMoneyForTrade(volume,ORDER_TYPE_BUY))
 
Vladimir Karputov:

It says: huge log file. Doesn't fit on disk, so testing is interrupted. Use the translator.

I know how it is translated. My logs only outputs opening and closing. How is the testing done there?

 
Алексей Тарабанов:

The question is closed. Thank you.


 

EA Doesn't pass validation. no trade action.

I have added to the code opening of order without conditions. (This violates the idea of trading, but does not affect the result, as they say, "to the delight of inspectors")

But still no trades. Something is wrong with validation...

please help me understand

in the Strategy Tester it works...

MT4

Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Типы торговых операций
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Типы торговых операций
  • www.mql5.com
Торговля осуществляется посредством отправки с помощью функции OrderSend() приказов на открытие позиций, а также приказов на установку, модификацию и удаление отложенных ордеров. Каждый торговый приказ содержит указание на тип запрашиваемой торговой операции. Торговые операции описаны в перечислении ENUM_TRADE_REQUEST_ACTIONS...
 
VOLODYMYR MARYNCHENKO:

EA Doesn't pass validation. no trade action.

I have added to the code opening of order without conditions. (This violates the idea of trading, but does not affect the result, as they say, "to the delight of inspectors")

But still no trades. Something is wrong with validation...

please help me understand

everything works in the tester...

All telepaths are on holiday. And ordinary people without a code can't help.

 
Vladimir Karputov:

All the telepaths are on holiday. And ordinary people without code can't give you any tips.

if(b == 0)

if(OrderSend(Symbol(), OP_BUY, BuyLot, Ask, iSlippage, 0, 0, "," iMagicNumber, 0, clrGreen) < 0)

Print("OrderSend error #", GetLastError();

 
VOLODYMYR MARYNCHENKO:

if(b == 0)

if(OrderSend(Symbol(), OP_BUY, BuyLot, Ask, iSlippage, 0, 0, ", ", iMagicNumber, 0, clrGreen) < 0)

Print("OrderSend error #", GetLastError());

Bare code without a single check. For such things Market usually beats hands down (doesn't pass Validation).

 
Vladimir Karputov:

Bare code without a single validation. For this kind of thing, Market usually slaps its hands down (does not pass Validation).

maybe there is a "correct" template with validation? everyone would add themselves and the question would go away

 
VOLODYMYR MARYNCHENKO:

Is there a "correct" template with checks? Everyone would add one for themselves and the question would go away

They want to sell that too :) .
 
Aliaksandr Hryshyn:
And that's what they want to sell :) .
The main thing is the result