Questions from Beginners MQL5 MT5 MetaTrader 5 - page 301

 
pako:

for the purchase of

 
PokrovMT5: I wrote it, the result is the same, 10013, I removed stop and TP, it doesn't help. Return removed, compiler complains with value(res.retcode)
MqlTradeRequest Req={0};
MqlTradeCheckResult Check={0}; 
MqlTradeResult Res={0};
ZeroMemory(Req);
ZeroMemory (Check);
ZeroMemory(Res);
   string TradeSmb;
   if(TradeSmb=="") TradeSmb=_Symbol;
   Req.action=TRADE_ACTION_DEAL;
   Req.symbol=TradeSmb;
   Req.volume=0.1;
   Req.type=ORDER_TYPE_BUY;
   Req.type_filling=ORDER_FILLING_RETURN;
   Req.price = sym_ask;
   Req.sl= NormalizeDouble(sym_bid - (StopLoss*sym_point),sym_digits);
   Req.tp= NormalizeDouble(sym_ask + (TakeProfit*sym_point),sym_digits);
   Req.deviation=3;
   Req.comment="777";
if(!OrderSend(Req,Res)|| Res.retcode !=TRADE_RETCODE_DONE) 
     {
      Print("Не удалось открыть BAY позицию по ",Symbol());
     } 

 
PokrovMT5:

put this script in the scripts folder, open this script in a unitor, compile it

When the exchange opens, drag this script onto the chart

Files:
test_buy.mq5  2 kb
 
pako:
that's what it says, the last extremum
as I understand it is impossible to find the next to last extremum of the zigzag using the standard functions of mql5?
 
<br / translate="no">

How do you make the scale on the chart some multiples and integers? I can't do without a calculator when I'm trying to calculate a pattern or place stops.

And how do you calculate cell differences, do you also keep a calculator nearby or is there a secret setting in MT5?

The scale is specific so they don't relax!

 
mavar:

How to make the scale on a graph with some multiples and integers? My brain boils when I'm trying to visually calculate some kind of pattern or place stops, I can't do without a calculator.

And how do you calculate cell differences, do you also keep a calculator nearby or is there a secret setting in MT5?

There is no secret setting. There are only five possible solutions:

1.Do it yourself.

2.Search the kodobase from what's available.

3. order it from one of the traders.

Buy it on the Market.

5.Wait and hope for the μl to be made in the terminal.

 
Is there any way to read the version number from #property version?
 

Cheers! Today I launched my first EA in MT5!

The right situation on the market came and the Expert Advisor started buying and buying!!! At least I managed to react in time. Can you tell me what is wrong in the code? I thought it should buy only one lot and immediately set a Stop Loss and Take Profit. As soon as he bought something, the variable Bye_opened should become true and it should not allow him to make a subsequent trade until the stops are triggered. Also, how do I know the price of the last trade to put stops on it?


But it looks like I did something wrong. Please point out my mistake.


 //--- Do we have positions opened already?
   bool Buy_opened=false;  // variable to hold the result of Buy opened position
   bool Sell_opened=false; // variables to hold the result of Sell opened position

   if(PositionSelect(_Symbol)==true) // we have an opened position
     {
      if(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
        {
         Buy_opened=true;  //It is a Buy
        }
      else if(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
        {
         Sell_opened=true; // It is a Sell
        }
     }

//+------------------------------------------------------------------+
//|   СОВЕРШАЕМ СДЕЛКУ                                               |
//+------------------------------------------------------------------+
                  
     if(last_tick.last < BBLow[2] && Buy_opened == false)
        {
        int znak = last_tick.last - BBLow[2];

      //--- 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=SymbolInfoDouble(_Symbol,SYMBOL_ASK) + 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);
   if(Trade_reslt.retcode==10016) Print("Ответ: ",Trade_reslt.bid,Trade_reslt.ask,Trade_reslt.price);
 
In the strategy tester the command MarketInfo(Symbol(),MODE_TICKVALUE) = 0 ( !) This happens in situations when, for example, the instrument is EURUSD and the balance currency is RUR .... and in other combinations. My understanding is that the balance currency must be the same as the name of the second currency in the currency pair. Otherwise, it returns zero value (in the strategy tester), which makes it impossible to perform tests with the desired combinations. How to solve this problem?
 

MT4 737 is up for review.

What's the history on MetaQuotes-Demo and how long ago?

D1 is almost like in the good old days, from May 72, but weeks from 95, months from 93, hours in general from 12.

Reason: