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

 
Vitaly Muzichenko:

Can data be lost if you use 7 different pairs in one formula? Sometimes trades open where they should not open at all
 

You canNULL the current symbol

orSymbol(), _Symbol .

 
How do I use sar?

double sar;

sar=iSAR(NULL,0,0.02,0.2,0);

ends with error....


 
Sergey Porphiryev:
How do I use sar?

double sar;

sar=iSAR(NULL,0,0.02,0.2,0);

ends with error....


What terminal? MT4, MT5 ?

For MT4:

iSAR(Symbol(),PERIOD_CURRENT,sar_step,sar_max,0);
For MT5, you first need to create an iSAR() handle in OnItit() and then in OnTick() retrieve data from the handle.
 
Artyom Trishkin:

What terminal? MT4, MT5 ?

For MT4:

For MT5, you first need to create an iSAR() handle in OnItit() and then already in OnTick() get the handle data.


MT4(alpari). That's the thing, I am doing everything kosher:



 
Sergey Porphiryev:


MT4(alpari)... That's the thing, I seem to be doing everything kosher:



Where, in what part of the code do you place the iSAR() reference ?
 
Artyom Trishkin:
Where, in what place in the code do you place the iSAR() call?

In expert, in void OnTick()...
 
Sergey Porphiryev:

In Expert, in void OnTick()...
Well, miracles never happen. Shall we guess? Or will you show us more complete information?
 
Artyom Trishkin:
Where, in what place in the code do you place the iSAR() reference ?

Thank you! I figured it out, at first I was fiddling with the definition of the function of the same name...
 
Sergey Porphiryev:

Thank you! Figured it out, I was wizarding at first, with the definition of the function of the same name...

The function of the same name should not have exactly the same formal parameters.

Make them different either by number or by type. Only then will function overloading work.

Reason: