[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 231

 
orb:

Good evening!

I have my Expert Advisor, it has been optimised (let us not speak about the fact that optimisation is water). The question is, I want to put it for real, do I need to upgrade my EA, in other words, do I need to write something in my code additionally, to make my EA work correctly for real?

Yes, we do. There is a lot of stuff in there. Handling possible errors returned by the server with the necessary checks - first of all.
 
Roman.:
Yeah. I do. There's a lot of stuff in there. Handling possible errors returned by the server with the necessary checks - first of all.

Oh, man, where can I see it? Can you give me a link...

 
orb:

Where the hell can I see it? Can you give me a link...a topic?

Prepare a request like this yourself .

+ here see that all checks are included in the owls when opening or modifying orders.

 
Got it, thanks.
 
dzhini:

Did this check

Alert(DoubleToStr(0.000000004,15));

DoubleToStr () only works up to 8 digits. You can only check it through constants. This has already been shown to you.

MikeM:
We are talking about updating indicator buffers and redrawing indicator charts, not objects.

Then it can be done only from a parallel thread. I.e., from a script or an Expert Advisor.

There is such a library. There is a section there for emulating ticks. Also, there are functions for offline updating of charts without scripts and experts. You can start the function from any MQL4-program once, and the library will update the specified charts by itself, even after the program that started it is finished.

 
orb:

Where the hell can I see it? Can you give me a link...the topic?

In my EA, which works on real, I put such conditions at the beginning of start(), before closing orders/positions.
int start() 
{ 
// ...
   if (!IsExpertEnabled())
      {Comment("Expert is NOT working. Check the reason."); return(0);}
   if (!IsConnected())
      {Comment("No connection!"); return(0);}
   if (IsTradeContextBusy())
      {Comment("Trade flow is busy. Wait..."); Sleep(5*1000); return(0);}
   if (AccountFreeMargin()<1000*Lot_super)
      {Comment("No money to trade. Free Margin = ",AccountFreeMargin()); Sleep(20*1000); return(0);}
// ...
return(0);
}
 

Comrades. Can you tell me if it is possible to solve the following taskin MQL:

Define a certain number of bars with every tick and calculate the average, maximum and minimum price values within them. Defining a price corridor. And revealing a rectangle. If yes. How will it approximately look in the code? Thank you in advance.

 
TiG_DSRC:

Comrades. Can you tell me if it is possible to solve the following taskin MQL:

Define a certain number of bars with every tick and calculate the average, maximum and minimum price values within them. Defining a price corridor. And revealing a rectangle. If yes. How will it approximately look in the code? Thank you in advance.

"Define a given number of bars" is X3, and any calculations are no problem
 

Please, help me to find MT4 oscillator like a standard AO, but with custom settings (like aligator):

- independent choice of periods for the MA

- МА method selection (simple,exponential,smoothed,linear weighted)

- price type selection (close,open,high,low,median,type...,weig...)

- How to choose a shift value

Scrolled through https://www.mql5.com/ru/code/mt4/indicators from 1 to 188, but unfortunately I couldn't find it, maybe I wasn't looking hard enough :(

I understand that it can simply be blinded from the codes of the two indicators AO and Aligatro, but I do not know how.

Thanks in advance to everyone who responded.

 
kiroyama:


The MACD has it all (and even has an extra one)
Reason: