Questions from Beginners MQL5 MT5 MetaTrader 5 - page 455

 
Leo59:
Thank you. What I really need is code to calculate the MA directly in the Expert Advisor, rather than using indicators with their recalculation of 1 and 0 bars. For most tasks it is suitable (less resource consuming and other advantages), but not for my purposes. I am writing in MQL4

iMAReturnsthe valueof the Moving Average technical indicator.

iMA - Документация на MQL4
  • docs.mql4.com
iMA - Документация на MQL4
 

Helpcreate a signal which is given when Stochastic is above 80, below 20 and RSI is above 70, below 30.

The signal should be given when both Indicators are above or below the upper or lower values.

 

Hello. Please help me with this problem. I want to use custom indicator in my Expert Advisor using iCustom function.

double Ind_Blue=iCustom(NULL, 0, "_MTF_ADX3",1,0);

double Ind_Red=iCustom(NULL, 0, "_MTF_ADX3",2,0);

Alert(" Ind_Blue= " , Ind_Blue , " Ind_Red= " , Ind_Red);

But when I test it in Strategy Tester, the Expert Advisor receives wrong data from the indicator. That is, when I press stop in the tester and the indicator lines appear, the line values are different from the values in Alert. But indicator parameters are the same.

Please advise what may be the cause of this problem? How can it be solved?

Thanks in advance.

 
E_Ghazaryan:

Hello. Please help me with this problem. I want to use iCustom indicator in my EA.

double Ind_Blue=iCustom(NULL, 0, "_MTF_ADX3",1,0);

double Ind_Red=iCustom(NULL, 0, "_MTF_ADX3",2,0);

Alert(" Ind_Blue= " , Ind_Blue , " Ind_Red= " , Ind_Red);

But when I test it in Strategy Tester, the Expert Advisor receives wrong data from the indicator. That is, when I press stop in the tester and the indicator lines appear, the line values are different from the values in Alert. But indicator parameters are the same.

Please advise what may be the cause of this problem? How can it be solved?

Thanks in advance.

MQL4 ? What are the indicator parameters? Please show a screenshot of its settings.
 
get the close price of the last bar number 1 on the current chart
x=CopyClose(0,0,1,1,close_array[0]);

error messages on compilation

close_array -array required

double close_array[10] declared in global variables

where is the error ?

EA works on demo account, tested in tester, it worked...


 
pr0gre5:
get the close price of the last bar number 1 on the current chart
x=CopyClose(0,0,1,1,close_array[0]);

error messages on compilation

close_array -array required

double close_array[10] declared in global variables

where is the error ?

The Expert Advisor works on a demo account, I checked in the Strategy Tester, it worked...


The array must be written in the function without square brackets:

x=CopyClose(0,0,1,1,close_array);
 

Здравствуйте! 2015.10.07_11:05МСК. Can't figure it out. The compiler gave 0

errors and 0 warnings, and in the strategy tester the advisor does not open

trades. Checked and corrected several times but nothing has changed.

My Expert Advisor has not opened trades. Please advise what is wrong. I attach a file

A fragment of the Expert Advisor code and a log file from the strategy tester. 11:10AMSC.

Files:
Sovetnik.mq5  6 kb
20151007.log  16 kb
 
Artyom Trishkin:
MQL4 ? What are the indicator parameters? Please show a screenshot of its settings.

Thanks for the kickback.

Here is a screenshot of the standard settings. But when I press stop button in the tester, the indicator appears with standard settings, and line values do not coincide with those that EA shows with Alert.

What may be the problem?

 
E_Ghazaryan:

Thanks for the kickback.

Here is a screenshot of the standard settings. But when I press stop button in the tester, the indicator appears with standard settings, and line values do not coincide with those that EA shows with Alert.

What may be the problem?

Very detailed and most importantly - divinely beautiful screenshot :))))
 
Artyom Trishkin:
Very detailed and most importantly - divinely beautiful screenshot :))))
Yeah, right =D ))) Already attached.)))
Reason: