Questions from Beginners MQL5 MT5 MetaTrader 5 - page 295

 
server:
You do not need to distinguish anything, no, the account does not need to be activated, it should connect to an empty one as well. You probably do not enter your broker's server correctly (or rather it is the default - you also traded on a demo account) click on the server window and select another server - real
I have attached everything, as written in the accompanying letter. I have chosen the server, as recommended, the standard. When I copy the password, then writes 8 characters, but in reality they are 7. Also writes that in order to activate the account, you have to recharge it within 30 days. Maybe that's the reason? Thank you.
 
Mitiay71:
I have connected everything as described in the accompanying information. The server has been selected as recommended - standard. When I copy the password, it says 8 characters, but in reality there are 7. Also writes that in order to activate the account, I need to recharge it within 30 days. Maybe that's the reason? Thank you.
Sounds strange, you should wait for Monday and write to your broker's support, let them explain.
 
gnawingmarket:

Hi all. Here's what's going on:

I've saved a post with this HTML-compressed image via Google Chrome browserhttps://c.mql5.com/3/47/EURUSDH1__6.png

For some reason, I start editing this post-cut out the old picture, save the new one, and update it.

I click on the image and enlarge the new tab.......... enlarges some old left options (???) https://c.mql5.com/3/47/EURUSDH1__3.png

I went to another browser (Mozilla)-everything is ok, such compressed and enlarged.

Maybe someone will tell me. I'll be glad to help.

It's probably caused by the browser cache, right? That is, it is assumed that the picture URL is somewhere stored in the cache and is not updated as necessary?

I had a similar problem on a personal site. But there it turned out to be not the browser's cache but the site's cache to blame. Cleaned the cache and the images were updated.

 
Reshetov:

Most likely the cause is in the browser cache? That is, presumably the picture URL is stored in the cache somewhere and is not updated as needed?

I had a similar problem on a personal site. But there it turned out that it was not the browser's cache but the site's cache that was to blame. Cleaned the cache and the images were updated.

I cleaned my computer with CCleaner. I think my cache(s) were on the list but I'm not sure......... I will try to clean only my browser. Thank you.
 
Reshetov:

Most likely the cause is in the browser cache? ....................

Yeah, that's right. Cleaned out my chrome cache and everything is fine. Thank you.
 
Silen
Silent:

Вы нарушили главное правило трейдера (или одно из главных, как угодно) - торговать только на те деньги, которые трейдер может позволить себе потерять.

Вы в шаге от нарушения второго правила: не пытаться "отбить" убыток. Тем более на занятые деньги.

Уходите с рынка. Разбирайтесь со своими проблемами и, если есть желание, параллельно учитесь. Рынок - это годы обучения и работы, а не курсы и халява.

t
:

You have broken the main rule of a trader (or one of the main rules, as the case may be) - to trade only with the money that a trader can afford to lose.

You are one step away from breaking the second rule: don't try to "beat back" a loss. Especially with borrowed money.

Get out of the market. Deal with your problems and, if you want to

If you want to, you have to learn at the same time. The market is the years of training and work, not the courses and freebies.

 
I realised that after everything that had already happened, and I wanted to recover the loss...what can I say? Thank you for your advice.
 
server:
I can answer for her - 3 hours of theory, 5 hours of practice. broker's minimum lot 1.0, while the initial deposit was filled with $ 2.825, and then she had time to add only up to $ 8,000 - it did not help (given that the spread is floating, and expanding as he likes). With such a minimum lot 1.0 - even $10,000 would not be enough for the initial deposit.

They are tough when you train them, it's the first time I've seen such conditions at brokers that the minimum lot is one lot.

I understand it, I had a good loss, I still remember it and I have fear when trading, the volumes are small.

I can give you my personal experience in trading. Good luck, I apologize, I can not help you financially, but believe me, I sincerely sympathize.

 

I'm writing an EA based on a zig zag indicator, but it won't even open a position, so I think it's because of a warning:

Here's the full EA code.

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
input double  Lots       =0.2;
input double  maxLot     = 0.3; 
input double  minLot     = 0.2;
input int     TakeProfit = 500;
input int     StopLose   = 500;
input int     Slippage   = 50;
input int     magicc     = 1111;
input int     NumExtr    = 4;   //Number of extremums ZIG_ZAG for analysis 
input double  buster     = 3;   //Modifier handle ATR for takeProfit 
input int     PATR       = 10; 
input double  indent     =100;  //indent sl
 double  lots       = Lots; //starting lots
  bool tr=false;  
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   MqlTick last_tick;
   MqlTradeRequest mqlreq;
   MqlTradeResult  mqlresult;
   double Extr;
   
   for(int i=1;i < NumExtr;i++)
         {
           Extr =  GetExtremumZZPrice("", 0,i); //расчет экстремумов зигзага
           if(SignalBuy(Extr)== true /*&& OrdersTotal()==0*/)//если есть сигнал на бай и открытых ордеров нету
           {
             mqlreq.action = TRADE_ACTION_DEAL;                                              // немедленное исполнение
             mqlreq.price  = NormalizeDouble(last_tick.ask,_Digits);                               // последняя цена ask
             mqlreq.sl     = NormalizeDouble(Extr-indent*Point(),Digits());// Stop Loss
             mqlreq.tp     = NormalizeDouble(last_tick.bid +(iATR(Symbol(),0,PATR))*buster,Digits()); //расчитывается исходя из атр // Take Profit
             mqlreq.symbol = _Symbol;                                                               // символ
             mqlreq.volume = lots;                                                                  // количество лотов для торговли
             mqlreq.magic  = magicc;                                                                // Magic Number
             mqlreq.type   =ORDER_TYPE_BUY;                                                         // ордер на покупку
             mqlreq.type_filling =ORDER_FILLING_FOK;                                                // тип исполнения ордера - все или ничего
             mqlreq.deviation    = Slippage;                                                        // проскальзывание от текущей цены
             if(OrderSend(mqlreq,mqlresult))
                {
                  Print("false");
                }
             
             tr=true;
           }
           if(SignalSell(Extr)==true /*&& OrdersTotal()==0*/ )
           {
             mqlreq.action = TRADE_ACTION_DEAL;
             mqlreq.price  = NormalizeDouble(last_tick.bid,_Digits);
             mqlreq.sl     = NormalizeDouble(Extr+indent*Point(),Digits());
             mqlreq.tp     = NormalizeDouble(last_tick.bid -(iATR(Symbol(),0,PATR))*buster,Digits()); //расчитывается исходя из атр
             mqlreq.symbol = _Symbol;
             mqlreq.volume = lots;
             mqlreq.magic  = magicc;
             mqlreq.type   = ORDER_TYPE_SELL;
             mqlreq.type_filling =ORDER_FILLING_FOK;
             mqlreq.deviation = Slippage;
             if(OrderSend(mqlreq,mqlresult))
                {
                  Print("false");
                }
             
             tr=true;
           }
         }
  }

void OnTrade()
  {   
  }
double OnTester()
  {
//---
   double ret=0.0;
//---

//---
   return(ret);
  }
//+------------------------------------------------------------------+
double GetExtremumZZPrice(string sym="", ENUM_TIMEFRAMES tf=PERIOD_CURRENT, int ne=0, int dp=12, int dv=5, int bc=3)
{
  if (sym=="") sym=Symbol();
  double zz;
  int    i, k=Bars(sym, tf), ke=0;
 
  for (i=1; i<k; i++) {
    zz=iCustom(sym, tf, "Examples\\ZigZag", dp, dv, bc, 0, i);
    if (zz!=0) {
      ke++;
      if (ke>ne) return(zz);
    }
  }
  Print("GetExtremumZZPrice(): Экстремум ЗигЗага номер ",ne," не найден");
  return(0);
}
//+----------------------------------------------------------------------------+
bool SignalBuy(double Extremum)
{
  MqlRates candle[];
  CopyRates(Symbol(),PERIOD_CURRENT,0,2,candle);
  double low   = candle[1].low,
         high  = candle[1].high,
         close = candle[1].close,
         open  = candle[1].open,
         diff = NormalizeDouble(Extremum - low,_Digits),
         diff1 = NormalizeDouble(high - Extremum,_Digits);
  if(open < close)//если бар восходящий
   {
     if((Extremum < close && Extremum > open /*&&  // если есть пробитие
        diff < diff1*/) ||                      // если свечка намного выше уровня
        (low < Extremum && close > Extremum && open > Extremum ) ) 
       {
        return(true);
       }
   }  
  return(false);
  
}
//+----------------------------------------------------------------------------+
bool SignalSell(double Extremum)
{
  MqlRates candle[];
  CopyRates(Symbol(),PERIOD_CURRENT,0,2,candle);
  double low   = candle[1].low,
         high  = candle[1].high,
         close = candle[1].close,
         open  = candle[1].open,
        diff = NormalizeDouble(Extremum - low,_Digits),
        diff1 = NormalizeDouble(high - Extremum,_Digits);
  if(open > close)//если бар низходщий
   {
     if((Extremum < open && Extremum > close/* &&  //если есть пробитие
        diff > diff1*/) ||                        //если свечка намного ниже уровня
        (high > Extremum && close < Extremum && open < Extremum ))                         
       {
        return(true);
       }
   }  
  return(false);
  
}

How do I get my EA to trade, please?

 

Gentlemen, please advise how to program the opening of an order with a given income. How to correctly calculate the number of lots?

I.e. suppose we need (given the right set of circumstances of course) to get a profit of $ 68 on the currency pair eur/usd.

my reasoning is as follows:

we derive a formula for calculating the financial result of the trade:

financial result (buy) = trade volume * (close price - open price)

trade volume = number of lots * standard contract

number of lots will be -X

standard contract (1 lot)=100000 usd

open price = 1.1345

Close price = 1.1395

In other words, the formula will be

financial result = X*standard contract*(1.1395-1.345)

thereof

X=(standard contract*(1.1345-1.1395))/financial result

or X=(100,000*(1.1395-1.1345))/68$=7.35 lots

RIGHT?

Reason: