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

 
Valerius:

Good afternoon!

Guys, can you tell me if you can programmatically display the indicator on the chart? Or only manually?

If so, what command is given?

In mql4 you can only apply a template prepared in advance with this indicator.

 

No, what I need is a software installation of the indicator on the chart (s).

Well if you can't, you can't.... Pity.

 
Valerius:

No, what I need is a software installation of the indicator on the chart (s).

Well if you can't, you can't.... Pity.

In MT5 you can.
 

I need to be in MT4...

 
Valerius:

I need to be in MT4...


Freelance

 
Valerius: Guys, can you tell me if you can programmatically display the indicator on the chart? Or only manually?

The adviser (script) can draw on the screen like an indicator. Indicator data from iCustom function or calculation in the Expert Advisor (script) itself

 

The Expert Advisor is multi-currency. Can you imagine if the owl will draw these indicators on 20 pairs at once... in a year ))) I will wait until the owl draws the indices on the chart for me))))

OK, it is clear that we cannot run the indicator on the chart from the program. There are no more options.

 
Valerius:

The Expert Advisor is multi-currency. Can you imagine if the owl will draw these indicators on 20 pairs at once... in a year ))) I will wait until the owl draws the indices on the chart for me))))

OK, it is clear that we cannot run the indicator on the chart from the program. There are no more options.

The options are. Forget the zoo and take the answers seriously - one of them solves the problem.

 

Afternoon!

A very strange situation. The Expert Advisor calculates the direction of line MODE_SIGNAL in the MACD oscillator and position of MODE_MAIN relative to zero. It seems to be quite simple. I am using the iMACD function. I run a test and it gives me a Tester: exchange rate cannot be calculated. I thought for a long time. I decided to break it into simpler elements (as in code below). It turned out that removing the line "MyMACDMode < 0" the test runs successfully. Tried different combinations and the result remains the same. I tried a little trick and put the output MyMACDMode on the chart as text - it worked, if the line is below zero - on the screen says the number it receives (the number itself is very large in value 9.213552135, but the indicator something like 0.00123). The sign corresponds, and this is what I need. I tried to display the result of this code to the screen, it always turns out that the MACD is above zero. I don't know what's wrong with it... What should I do about it?


// Declare variables

MyMACDOld = iMACD(_Symbol, IndicatorPeriod, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, 1);
MyMACDNew = iMACD(_Symbol, IndicatorPeriod, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, 0);
MyMACDMode = iMACD(_Symbol, IndicatorPeriod, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 0);

//Execution

if ( MyMACDOld > MyMACDNew )
{
if (MyMACDMode < 0)
{
return(1);
}
}

 
RaX79:

Good afternoon!

Very strange situation. The Expert Advisor calculates the direction of line MODE_SIGNAL in the MACD oscillator and MODE_MAIN position relative to zero. It seems to be very simple. I am using the iMACD function. I run a test and it gives me a Tester: exchange rate cannot be calculated. I thought for a long time. I decided to break it into simpler elements (as in code below). It turned out that removing the line "MyMACDMode < 0" the test runs successfully. Tried different combinations and the result remains the same. I tried a little trick and put the output MyMACDMode on the chart as text - it worked, if the line is below zero - on the screen says the number it receives (the number itself is very large in value 9.213552135, but on the indicator something like 0.00123). The sign corresponds, and this is what I need. I tried to display the result of this code to the screen, it always turns out that the MACD is above zero. I don't know what's wrong with it... What should I do about it?

Perhaps, the instrument is non-tradable, so there is no data necessary to calculate the profit. The tester just doesn't know how to calculate it. Try another one.
Reason: