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

 
законопослушный гражданин:

I did.

Now 'Lot' is an undeclared identifier

I need: extern double dLots= 0.01; replace with: extern double Lot= 0.01; ?

better Lot to dLots

 
MakarFX:

better Lot by dLots

no it doesn't))

neither like this nor vice versa.

no trades open anyway, although no errors are shown anymore

 
законопослушный гражданин:

no it doesn't))

neither like this nor vice versa.

still no trades open, although no errors are displayed anymore

look for errors in the signal
 
законопослушный гражданин:

no it doesn't))

neither like this nor vice versa.

still no trades open, although no errors are displayed anymore

before you inserted my function, were the trades opening?
 

I'm sorry, maybe I don't understand something... But!

It's been going on here for God knows how long now about writing, correcting, etc., some kind of code. For one "questioner"! HOW does this relate to this topic?

Question is an answer. Then it's all in private. Otherwise it's already a quagmire... The vast majority of people don't give a shit about your codes! What the fuck you've done with them for already 20 pages?

 
Сергей Таболин:

I'm sorry, maybe I don't understand something... But!

It's been going on here for God knows how long now about writing, correcting, etc., some kind of code. For one "questioner"! HOW does this relate to this topic?

Question is an answer. Then it's all in private. Otherwise it's already a quagmire... The vast majority of people don't give a shit about your codes! Why are you soiled with them already 20 pages?

1) Topic.

Any questions from newbies on MQL4 and MQL5, help and discussion on algorithms and codes.


2) You may clean it up.

 
MakarFX:

1)Topic

Any questions from newbies on MQL4 and MQL5, help and discussion on algorithms and codes


2)You can clean it up.

I can't clean it.

If you are so interested in helping someone, let this person at least attach the source code, instead of posting his code half a page long! And then you reply as well.... It's just a bunch of bollocks! Interesting only to you and one other person!

Don't you have to respect the rest of us? Or does the PM not work?

 
MakarFX:
before you inserted my function, were the trades opening?

of course. it was an old working EA.

I have a suspicion that there is no connection between the functions:

//+-----------------------------------------------------------------------------------------------+
//|                                                            Функция открытия ордера на покупку |
//+-----------------------------------------------------------------------------------------------+
void vOrderOpenBuy()
  {
   int iOTi = 0;   // Тикет ордера

   iOTi = OrderSend(Symbol(), OP_BUY, Lots(), Ask, iSlippage, 0, 0, "", iMagic, 0, clrNONE);

// Проверим открылся ли ордер
   if(iOTi > 0)
      // Есди да, то выставим уровни убытка и прибыли
      vOrderModify(iOTi);
   else
      // Если нет, то получим ошибку
      vError(GetLastError());
  }

и

//| Расчет лота                                                      |
//+------------------------------------------------------------------+
double Lots()
  {
   double L=0;
   // если последняя закрытая сделка убыточная и лот равен стартовому
   // включаем Мартин
   if(GetInfoLastPos(2)<0&&GetInfoLastPos(1)==dLots) 
     {
      Martin=true;
     }
   // если последняя закрытая сделка убыточная и лот больше или равен максимальному
   // выключаем Мартин
   if(GetInfoLastPos(2)<0&&GetInfoLastPos(1)>=MaxMartinLot)
     {
      Martin=false;
     }
   // если последняя закрытая сделка убыточная и Мартин включен, умножаем лот
   if(Martin==true)
     {
      L=NormalizeDouble(GetInfoLastPos(1)*K_Martin,DigitsLot);
     }
   // если последняя закрытая сделка убыточная и Мартин выключен, делим лот
   if(Martin==false)
     {
      L=NormalizeDouble(GetInfoLastPos(1)/K_Martin,DigitsLot);
     }

   if(L>MAXLOT) L = MAXLOT;
   if(L<MINLOT) L = MINLOT;
   return(L);
  }

I can't understand what's wrong.

it was in the old version:

//|                                                            Функция открытия ордера на продажу |
//+-----------------------------------------------------------------------------------------------+
void vOrderOpenSell()
  {
   int iOTi = 0;   // Тикет ордера

   iOTi = OrderSend(Symbol(), OP_SELL, LOT(), Bid, iSlippage, 0, 0, "", iMagic, 0, clrNONE);

// Проверим открылся ли ордер
   if(iOTi > 0)
      // Есди да, то выставим уровни убытка и прибыли
      vOrderModify(iOTi);
   else
      // Если нет, то получим ошибку
      vError(GetLastError());

и

double LOT()
{
   int n=0;
   double OL=dLots;
   for (int j = OrdersHistoryTotal()-1; j >= 0; j--)
   {
      if (OrderSelect(j, SELECT_BY_POS,MODE_HISTORY))
      {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == iMagic)
         {
            if (OrderProfit()<0) 
            {
               if (n==0) OL=NormalizeDouble(OrderLots()*K_Martin,DigitsLot);
               n++;
               if (n>=OrdersClose) {Comment("1");return(dLots);}
            }
            else
            {
               if (n==0) {Comment("2");return(dLots);}
               else {Comment("3");return(OL);}
            }
         }
      }
   }
   return(OL);
}
 
Сергей Таболин:

Can't clean it up.

If you're so interested in helping someone, at least have them attach the source code instead of posting half a page of their own code! And then you reply as well.... It's just a bunch of bollocks! Interesting only to you and one other person!

Don't you have to respect the rest of us? Or does the PM not work?

I treat everyone with respect. Except for you, no one's bothered by the "Tidbits".

In the PM the code is not inserted in a readable way and the person is not addressing me personally, I just replied to him.

If I made you uncomfortable with my posts, I'm sorry, but there's no other way.

 
законопослушный гражданин:

of course. it was an old working EA.

I have a suspicion that there is no connection between the functions:

и

I can't figure out what's wrong.

it was in the old version:

и

If it was a matter of lot calculation, there would be an error, but if there is no error, it means that we have no conditions for opening an order.

Attach the old working version and I will take a look

Reason: