Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 843

 
tim2019:
So you don't think it's too much? Maybe developers should look at other freelance resources to understand how a user Friendly interface should look like. I couldn't even find that Sign Up button right away. All in all, it's terrible.

No, I don't.

You only registered here yesterday. What do you have to sell? What do you have of knowledge for execution of orders in freelance service at a decent level? Not at the level of "every how, just to bang out," but at a level that matches the level of an excellent, let's be good, developer?

Or should you hurry up before you change your mind?

 
Artyom Trishkin:

No, I don't.

You only registered here yesterday. What do you have to sell? What do you have of knowledge to execute orders in the freelance service at a decent level? Not at the level of "every how, just to bang out," but at a level on par with an excellent, let's say good, developer?

Or do you want to hurry up before you change your mind?

After all, there are some standards for the interface. If there was an error, we should at least inform the user what kind of error, rather than force the user to pound on it several times with the stubbornness of a woodpecker and download / re-fill again.

What does this have to do with knowledge or what's for sale? I haven't even gotten to that stage. Rather, unfortunately, that's what the modern world is all about. Didn't like it, closed it and walked on by. That's not who we are. And all in all, an empty conversation. I'm talking crooked and I'm being persuaded that's the way it should be. Okay.

 
tim2019:

There are, after all, some interface standards. If there is an error, it is customary to at least indicate what kind of error, rather than forcing the user to peck repeatedly with the tenacity of a woodpecker and download/refill again.

What does this have to do with knowledge or what's for sale? I haven't even got to that stage. Rather, unfortunately, that's what the modern world is all about. Didn't like it, closed it and walked on by. That's not who we are. And all in all, an empty conversation. I'm talking crooked and I'm being persuaded that's the way it should be. Okay.

I know people who have gone through seller registration literally in a day. But these people, and it shows, are inquisitive and are not in a hurry. And I have seen people who have been asking questions on the forum for months, but do nothing about what they are told and written.

And for the record, there's no human there - all registration is monitored by a robot. So you can knock on his door for a long time and slip him something wrong. But it's still worth reading his posts - everything should be there. Unfortunately, I'm long past all this, and since then a lot has changed, so that substantially I can not tell you exactly what your problem is. Read, for example, the sections in your vendor profile:


 

Help to adjust the conditions for opening positions

// открытие продаж

   if(CountSell()==0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,1,0)==Low[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,1,0)==Low[0])
     
// закрытие продаж
            if(CountSell()>0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,0,1)==High[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,0,1)==High[0])
              
// открытие покупок

   if(CountBuy()==0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,0,1)==High[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,0,1)==High[0])
     
// закрытие покупок    
            if(CountBuy()>0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,1,0)==Low[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,1,0)==Low[0])

considering that the indicator parameters are built into the robot

------------------------------------------------------------------+
//|                                       Test advisor on ZigZag.mq4 |
//|                        Copyright 2017, MetaQuotes Software Corp. |
//|                                         https:/goga342@yandex.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright c 2010, MQL для тебя."
#property link "http://mql4you.ru"
#property strict
extern double lots = 0.01; //
extern int  TakeProfit=60; //
extern int  StopLoss=100; //
extern int Magic=111111111;
extern int Slippage=3;
extern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;

datetime Today=0;
double SL,TP;
int ticket;
//±-----------------------------------------------------------------+
int OnInit()
  {
   if(Digits==3 || Digits==5)
     {
      TakeProfit *=10;
      StopLoss   *=10;
      Slippage   *=10;
     }
   return(INIT_SUCCEEDED);
  }
//±-----------------------------------------------------------------+
int deinit() {return(0);}
//±-----------------------------------------------------------------+
int start()
  {

   if(DayOfWeek()==0 || DayOfWeek()==6) return(0); // в выходные не работаем
   if(!IsTradeAllowed()) return(0); // пропустим тик если терминал занят
                                    //:проверим открытие новой свечи
   if(Time[0]==Today) return(0);
   Today=Time[0];
//:получим значение ZigZag на предыдущей свече
   double lZZ=iCustom(NULL,0,"ZigZag",ExtDepth,ExtDeviation,ExtBackstep,0,1);
  
// открытие продаж

   if(CountSell()==0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,1,0)==Low[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,1,0)==Low[0])
     {
      SL = NormalizeDouble(Bid+StopLoss*Point, Digits);
      TP = NormalizeDouble(Bid-TakeProfit*Point, Digits);
        {

         ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,Slippage,SL,TP,"macd sample",Magic,0,Red);
         if(ticket>0)
           {
            // закрытие продаж
            if(CountSell()>0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,0,1)==High[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,0,1)==High[0])
              {
               for(int i=OrdersTotal()-1; i>=0; i--)
                 {
                  if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
                    {
                     if(OrderMagicNumber()==Magic && OrderType()==OP_SELL)
                        if(OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,clrNONE))
                           Print("Ошибка открытия ордера на покупку !");
                    }
                 }
              }
           }
        }
     }
// открытие покупок

   if(CountBuy()==0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,0,1)==High[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,0,1)==High[0])
     {
      TP = NormalizeDouble(Ask+TakeProfit*Point, Digits);
      SL = NormalizeDouble(Ask-StopLoss*Point, Digits);
        {
         ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,Slippage,SL,TP,"macd sample",Magic,0,Green);
         if(ticket>0)
           {
            // закрытие покупок    
            if(CountBuy()>0 && iCustom(NULL,0,"ZigZag_Rosh",12,5,3,1,0)==Low[0] && iCustom(NULL,0,"ZigZag_Rosh",48,20,12,1,0)==Low[0])
              {
               for(int i=OrdersTotal()-1; i>=0; i--)
                 {
                  if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
                    {
                     if(OrderMagicNumber()==Magic && OrderType()==OP_BUY)
                        if(!OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,clrNONE))
                           Print("Ошибка открытия ордера на продажу!");
                    }
                 }
              }
           }
        }
     }
   return(0);
  }
//+------------------------------------------------------------------+
int CountSell()//проверкна открытие ордеров на продажу
  {
   int count=0;

   for(int trade=OrdersTotal()-1; trade>=0; trade--)
     {
      if(OrderSelect(trade,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic && OrderType()==OP_SELL)
           {
            if(OrderType()==OP_SELL)
               count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
int CountBuy()// проверкна открытие ордеров на покупку
  {
   int count=0;

   for(int trade=OrdersTotal()-1; trade>=0; trade--)
     {
      if(OrderSelect(trade,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic && OrderType()==OP_BUY)
           {
            if(OrderType()==OP_BUY)
               count++;
           }
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
 
Алексей Тарабанов:

If you can't earn, steal.

A classic phrase from a film, can't remember the title: "If you can't steal, learn how to earn.
 
Good afternoon, for some reason the EA is loading the terminal. How to detect the error? ((( Thanks.
 
rabanik:
Good afternoon, for some reason the EA is loading the terminal. How to detect the error? ((( Thanks.
Профилирование кода - Разработка программ - MetaTrader 5
Профилирование кода - Разработка программ - MetaTrader 5
  • www.metatrader5.com
Профилирование — это сбор характеристик программы во время ее выполнения. При профилировании замеряется время выполнения и количество вызовов отдельных функций и строк в коде программы. При помощи этого инструмента программист может найти наиболее медленные участки кода и провести их оптимизацию. Профилирование можно проводить на обычном...
 

Good afternoon. I have started testing the Expert Advisor on a real account. I have never seen anything like this with sell orders.

 
Lomonosov1991:

Good afternoon. I have started testing the Expert Advisor on a real account. I have never seen anything like this with sell orders.

Look in "Experts" journal

 

Good day to you all! Folks, well advise if anyone knows.

This is the code you can use to get the current prices.

void OnTick()
  {
   MqlTick last_tick;
//---
   if(SymbolInfoTick(Symbol(),last_tick))
     {
      Print(last_tick.time,": Bid = ",last_tick.bid,
            " Ask = ",last_tick.ask,"  Volume = ",last_tick.volume);
     }
   else 
      Print("SymbolInfoTick() failed, error = ",GetLastError());
//---
  }

Question:

What is the right way to attach this to it?

bool  SymbolInfoTick(
   string    symbol,     // символ
   MqlTick&  tick        // ссылка на структуру
   );

Well, that it was possible to get the current prices in one Expert Advisor for several currency pairs.

Well, I am not good at programming, so I am trying to figure it out!

Reason: