Questions from Beginners MQL5 MT5 MetaTrader 5 - page 299

 
ArkFatalist:
Can you tell me how to make an EA in an already open position increase the lot ? MQL5. Thanks already.

:-)

If I were sultan.........

Keep in mind that your profit of 0.1 lot will not turn into a profit of 100 lots as you want.

 
What is the correct way to refer to the indicator that draws the arrows in the EA?

 

Help me deal with the strategy tester. It buys at a price that just isn't there!

What to do and how to fix the bug?

Strategy tester error

The bidding code is as follows:

//--- 1. Создать запрос
         MqlTradeRequest Trade_reqst={0};            // Инициализация структуры торгового запроса
         Trade_reqst.action=TRADE_ACTION_DEAL;       // Тип: немедленное совершение сделки
         Trade_reqst.symbol=_Symbol;                 // Инструмент: текущий
         Trade_reqst.volume=Lot;                     // Объём: 1 лот
         //Trade_reqst.price=SymbolInfoDouble(_Symbol,SYMBOL_ASK)-TakeProfit*_Point; // Цена исполнения
         Trade_reqst.type=ORDER_TYPE_BUY;            // Тип ордера: на продажу
         Trade_reqst.type_filling=ORDER_FILLING_RETURN; // Политика исполнения 
         Trade_reqst.sl=last_tick.last - StopLoss * _Point;  // Stop Loss
         Trade_reqst.tp=last_tick.last + TakeProfit * _Point; // Take Profit
      // Trade_reqst.tp=Trade_reqst.price + TakeProfit * 2 * _Point; // Take Profit
      //--- 2. Отправить торговый приказ
         MqlTradeResult Trade_reslt={0};             // Инициализация структуры результата торгового запроса
         OrderSend(Trade_reqst,Trade_reslt);         // Отправка торгового запроса на сервер
   //--- выведем в лог ответ сервера  
   Print(__FUNCTION__," - : - ",Trade_reslt.comment);
 
mavar:

Help me deal with the strategy tester. It's buying at a price that just isn't there!

What to do and how to fix the bug?

There's just a big spread stuffed into the historical data.
 
Dima_S:
There's just a big spread stuffed in the historical data.

So what to do about this problem? How do you get around it properly?

I cannot test the EA correctly. A lot of trades are erroneous.

 

Also, gentlemen, why is the scale on the chart not based on whole numbers (round numbers) or even multiples. My brain boils when I visually try to calculate some kind of pattern or put stops.

Wrong scale

How do you calculate cell differences, keep a calculator nearby?

 
mavar:

So what to do about this problem? What is the right way around it?

I can't test the EA correctly. A lot of trades are erroneous.

To make up your own exchange and write your own terminal for it
 
sergeev:
To come up with your own exchange and write your own terminal for it

Sergey, you can see that the problem is not with the exchange.

The strategy tester takes orders and executes them past market prices.

 
mavar:

Sergey, you can see that the problem is not with the exchange.

The strategy tester takes orders and executes them past market prices.

Nazar, I can see that you are not a trader.

The buy orders are executed by asc.

 
mavar:

So what to do about this problem? What is the right way around it?

I can't test the EA correctly. A lot of trades are erroneous.

You open at market opening - there is almost always a gap with a sharp price movement. You can trust the result of testing more than the hypothetical zero spread. Skip the first 5-10min at least.
Reason: