Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 699

 

Dear programmers, I need your help.

I tried to compile CloseAllOrders EA, but I get the following entry:

------------------------------------------

CloseAllOrders_v5.mq4'
'WinUser32.mqh'
function must return a value CloseAllOrders_v5.mq4 30 22
function must return a value CloseAllOrders_v5.mq4 79 41
0 error(s), 2 warning(s)

--------------------------------------------------

What do I need to do to make my EA work?

The EA is attached.

Thanks in advance for your help.

Regards,

Files:
 
Geowind64:

Dear programmers, I need your help.

I tried to compile the CloseAllOrders EA, but I get the following entry:

------------------------------------------

'CloseAllOrders_v5.mq4'.
WinUser32.mqh'
function must return a value CloseAllOrders_v5.mq4 30 22
function must return a value CloseAllOrders_v5.mq4 79 41
0 error(s), 2 warning(s)

--------------------------------------------------

What should I do to make my EA work?

Expert Advisor attached.

Thank you in advance for your help.

Regards,


The function must return the value of

if (ret==IDCANCEL)return(0);

и

if (ret1==IDCANCEL)return(0);

Something like this.

 

Question for you:

The Expert Advisor has a setting that determines on which candle to enter. The EA opens a trade on the signal of the indicator, on the 3rd candle after the signal. On the 2nd candle after the signal, there is a signal in the opposite direction. How do I write the condition so we do not enter when there is a signal to the opposite side?

extern int sdvig=3;//На какой свече заходим

 double pokupaem=iCustom(Symbol(),Per,"super-signals-channel",4,500,3,sdvig);

 double prodaem=iCustom(Symbol(),Per,"super-signals-channel",4,500,2,sdvig);

 if(OrdersTotal()==0)

 {

  double lot=(AccountBalance()/ MinLot)*0.01;

  if(center>Ask && pokupaem>0 && prodaem<1 && prodaem1<1 &&SelBuyDaily==Vhodim1)

  {

   x=OrderSend(Symbol(),OP_BUY,lot,Ask,3,0,0,Komment,Magic,0,Blue);

  }

  if(center<Bid && prodaem>0 && pokupaem<1 && pokupaem1<1 && SelBuyDaily==Vhodim2)

  {

   y=OrderSend(Symbol(),OP_SELL,lot,Bid,3,0,0,Komment,Magic,0,Red);

  }

 }

 

Solved the problem by using additional variables. We prescribe indicators with the signal on the current candle. When the first signal appears we assign one digit to the variable, when the opposite signal appears we assign another digit.

 ////////////////////////////////////////////////////////////////////////////////////////

 //                       Проверка на наличие обратного сигнала                       //

 //////////////////////////////////////////////////////////////////////////////////////

  double pokup=iCustom(Symbol(),Period(),"super-signals-channel",4,500,3,0);

  double prod=iCustom(Symbol(),Period(),"super-signals-channel",4,500,2,0);

 if(pokup>0){

  proverka=1;

  }

 if(prod>0){

  proverka=2;

  }

/////////////////////////////////////////////////////////////////////////////////////////////////////

//                  Блок открытия зделок при отключённых стоп-лосс и тейк-профит                  //

///////////////////////////////////////////////////////////////////////////////////////////////////

 if(OrdersTotal()==0)

 {

  double lot=(AccountBalance()/ MinLot)*0.01;

  if(center>Ask && pokupaem>0 && prodaem<1 && prodaem1<1 && SelBuyDaily==Vhodim1 && proverka==1)

  {

   x=OrderSend(Symbol(),OP_BUY,lot,Ask,3,0,0,Komment,Magic,0,Blue);

  }

  if(center<Bid && prodaem>0 && pokupaem<1 && pokupaem1<1 && SelBuyDaily==Vhodim2 && proverka==2)

  {

   y=OrderSend(Symbol(),OP_SELL,lot,Bid,3,0,0,Komment,Magic,0,Red);

  }

 }

 

Hello, why is the EA opening... ...or even opens orders above the price? I am trying the EA in the strategy tester in Metatrader.

I open orders like this:

   RefreshRates();
   switch(send)
      {
      case 1: ticked = OrderSend(Symbol(), OP_BUY, lot, Ask, 4, NormalizeDouble(Bid-SL*Point, Digits), NormalizeDouble(Ask+TP*Point, Digits), "Buy_", magik, 0, clrBlue); break;
      case 2: ticked = OrderSend(Symbol(), OP_SELL, lot, Bid, 4, NormalizeDouble(Ask+SL*Point, Digits), NormalizeDouble(Bid-TP*Point, Digits), "Sell_", magik, 0, clrRed); break;
      default : ticked = 0;
      }



 
nr72:

Hello, why is the EA opening... ...or even opens orders above the price? I am trying the EA in the strategy tester in Metatrader.

I open orders like this:



Buy opens at Ask as well. Press F8 on the visualisation chart, check the "Show Ask line" box in the "General" tab. All questions will disappear on their own.
 
artmedia70:
Buy opens on Ask same. Press F8 on the visualisation chart, check the "Show Ask line" box in the "General" tab. All questions will disappear on their own.


Thank you! Got it now...
 
alexey1979621:
Hi all, I can't get an owl turkey attached, help from knowledgeable people.
The euro line (green) crosses the pound line (light brown) from top to bottom opens a sell order for the euro pound. If the pound crosses the euro line from below upwards, we buy the euro pound.
My log says that it does not see the indicator.
I attach the adviser and the indicator.

Thanks in advance.


I do not advise to decompile. It's only a little way to the bath.
 

1.Can you tell me if it is possible to programmatically collapse the quick trade bar, which is located in the upper left corner of the chart?

2. Is it possible to programmatically disable fast trading?

 
Vinin:

I wouldn't advise posting the decompiled one. It's not far from the bathhouse.

A friend of mine gave me a turkey. I don't know whether it's decompiled or not. How do I know? The author seems to be there, so is his email address...

And the open source code on the Internet is full of everything.

Reason: