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

 

Hello.


I've seen many solutions for sending signals to Telegram through a bot. Is it possible to do the reverse? Receive the signals from Telegram to be executed on MT4? Please send me the link if there is something similar.

 
sahsa-777:
And a related question - is there any way to attach the parabolic to the new version, perhaps as a filter?

Please show me the new version of the parabolic.

 
Can the drawdown be made as a function?
   prosadka=AccountProfit()*100/AccountBalance()*-1;
   if(prosadka>0) prosadka1=prosadka;
   else prosadka1=0;
 
What is error #1 when modifying an order? In the help, it says "no error, but the result is not known". I cannot understand what I should correct
 
Alexandr Sokolov:
What is error #1 when modifying an order? Help says "there is no error but the result is unknown". I cannot understand what I should correct

this error occurs if during order modification you have sent to the server the same values as the order, i.e. ТР new = ТР set and SL new = SL set

Remember that if you compare non-normalized real values on equality, you may get not quite the result you expected ;)

 
Igor Makanu:

this error occurs if during order modification you have sent to the server the same values as the order, i.e. ТР new = ТР set and SL new = SL set

HH: don't forget that if you compare non-normalized real values for equality, you may not get quite the result you expected ;)

what if it's just one of them? or do you need to change both of them at once?

 
Alexandr Sokolov:

what if it's just one of them? or do you need to change both at once?

at least one parameter needs to be changed when modifying an order, error #1 - if nothing needs to be changed after sending a request to the server

Please print out what you have sent to the server and you will see at once

 
Igor Makanu:

at least one parameter needs to be changed when modifying an order, error #1 - if nothing needs to be changed after sending a request to the server

unprint what you are sending to the server, you will see it right away.

Thank you

 

Good afternoon Experts.

There is a problem, there is an Indicator(modified Envelopes). It is inserted in Expert Advisor.

I cannot make it show rendering.

I have prescribed the values for the Indicator:

//************************************************************************************************/
#property indicator_chart_window
#property  indicator_buffers 4

#property  indicator_color1  Red
#property  indicator_color2  Blue
#property  indicator_color3  Red
#property  indicator_color4  Blue

#property  indicator_width1  2
#property  indicator_width2  2
#property  indicator_width3  1
#property  indicator_width4  1

#property  indicator_style1  0
#property  indicator_style2  0
#property  indicator_style3  1
#property  indicator_style4  1

double ExtSell_Buffer[];
double ExtBuy_Buffer[];
double ExtSell_2_Buffer[];
double ExtBuy_2_Buffer[];
//************************************************************************************************/

I have done Initialization:

//************************************************************************************************/
int OnInit()
{
  //--- drawing settings-----------
   IndicatorBuffers(4);
   IndicatorDigits(Digits);
//--- 
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtSell_Buffer);
   SetIndexShift(0,Ma_Shift);
   SetIndexLabel(0,"Line_Sell");
//--- 
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtBuy_Buffer);
   SetIndexShift(1,Ma_Shift);
   SetIndexLabel(1,"Line_Buy");
   //------------------------------
//--- 
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,ExtSell_2_Buffer);
   SetIndexShift(2,Ma_Shift);
   SetIndexLabel(2,"Line_Sell_2");
//--- 
   SetIndexStyle(3,DRAW_LINE);
   SetIndexBuffer(3,ExtBuy_2_Buffer);
   SetIndexShift(3,Ma_Shift);
   SetIndexLabel(3,"Line_Buy_2");
//------------------------------
   return(INIT_SUCCEEDED);
}
//************************************************************************************************/

Then I try to fill buffers in the code:

//************************************************************************************************/
void OnTick()
{
Paint ();
}

//************************************************************************************************/
void Paint()
{
//-----------------------------------------------
int limit; 
int counted_bars=IndicatorCounted(); 
//---- последний посчитанный бар будет пересчитан 
if(counted_bars>0) counted_bars--; 
limit=Bars-counted_bars; 
//---- основной цикл 
for(int i=0; i<limit; i++) 
   { 
      ExtSell_Buffer[i]=iEnvelopes(Symbol(), TimeFrames, Ma_Period, Ma_Method, Ma_Shift, Applied_Price, Deviation, 1, i); 
      ExtBuy_Buffer[i]=iEnvelopes(Symbol(), TimeFrames, Ma_Period, Ma_Method, Ma_Shift, Applied_Price, Deviation, 2, i);

      ExtSell_2_Buffer[i]=iEnvelopes(Symbol(), TimeFrames, Ma_Period, Ma_Method, Ma_Shift, Applied_Price, Deviation_2, 1, i); 
      ExtBuy_2_Buffer[i]=iEnvelopes(Symbol(), TimeFrames, Ma_Period, Ma_Method, Ma_Shift, Applied_Price, Deviation_2, 2, i);
   }
   return;
}
//-----------------------------------------------

Compiling goes without errors, but on startup gives error "array out of range" and stops (Testing pass stopped due to a critical error in the EA).

Help to fix ...

p.s. Separately Indicator works without errors.

 
Alexander Layzerevich:

Good afternoon Experts.

There is a problem, there is an Indicator (modified Envelopes). It is inserted in Expert Advisor.

I cannot make it show drawing.

Expert Advisors do not have indicator buffers and do not draw in the terminal

read in the help what is the difference between Expert Advisors and scripts and indicators

Reason: