Questions from Beginners MQL5 MT5 MetaTrader 5 - page 212

 
paladin800:

By following the link to the indicator, you can see that there are 8 input parameters. Two of them string (s1 and s2) do not pass values to the indicator, but they should be included in your handler somehow. Do the following:

This works, thank you very much!
 

In the chart window in my EA, the profit is displayed where the font size is small and the colour of the font so merges with the rest of the inscriptions, in the code it looks like this

Comment(profit)

Mister programmers help me to change the font size in the code, and it would be nice to change the colour

 
rus-lot:

In the chart window in my EA, the profit is displayed where both the font size is small and the colour of the font so merges with the rest of the inscriptions, in the code it looks like this

Comment(profit)

Mister programmers help me to change the font size in the code, and it would be nice to change the colour

Text mark will not work?
 
Gentlemen, please help. Urgently needed, as at the moment there are some unclear orders hanging around... If the signal's author has some trades closed, but mine have not, it means that something is not working properly, right? Can I close trades manually in such cases, or am I misunderstanding something?
 
Silent:
Would a text mark not work?
I will try it even though I'm not very good at this, but at first glance it shows how to move the text and my text is a state of profit, so to say a changeable value.
 
rus-lot:
I will try it even though I am very far in these matters, but at first glance it shows how to move the text and my text is a state of profit so to say variable value

You make profit a string, then you put this text into a label

the script was written that way, I think there are more examples in kodobase

 
Silent:

make it a string, then put this text into a label

the script was written that way, I think there are more examples in kodobase

The thing is that my profit is calculated for 2 currency pairs
 
rus-lot:
The thing is that my profit is calculated for 2 currency pairs

Add up the profits, then convert (output the result of the operation),

or add lines (more details here) (output 2 values per line),

or two marks, respectively, profit1 and profit2)...

what difference does it make which one to output.

 
Silent:

Add up the profits, then convert (output the result of the operation),

or add lines (more details here) (output 2 values per line),

or two marks, respectively profit1 and profit2)...

What difference does it make what you output.

For a newbie, it's hard to do, but I thought, if profit is shown in the window like this

Comment(profit1+profit2

then in order to make it lower by one line, the following sign "\n" should be added

Comment("\n", profit1+profit2

That's why I thought that maybe to increase the font size it would be possible to add another sign to this line, and what you say it would be for me it would be complicated and not do it again I do not understand anything there.

 
paladin800:

By following the link to the indicator, you can see that there are 8 input parameters. Two of them string (s1 and s2) do not pass values to the indicator, but you need to include them in your handler somehow. You should do it this way:

I cannot get any market entry signals from this indicator(https://www.mql5.com/ru/code/1806) when it finds divergence.

 MACD_Divergence__Handle=iCustom(NULL,0,"MACD_Divergence",
                                "---",
                                MACD_Divergence__fastEMA,
                                MACD_Divergence__slowEMA,
                                MACD_Divergence__signalMA,
                                "---",
                                drawIndicatorTrendLines,
                                drawPriceTrendLines,
                                displayAlert);
   if(MACD_Divergence__Handle==INVALID_HANDLE)                               
     {
      Print(" Не удалось получить хендл индикатора MACD_Divergence");
      return(INIT_FAILED);
     }
......................................
void OnDeinit(const int reason)
  {
IndicatorRelease(MACD_Divergence__Handle);

......................................
void OnTick()
  {
  ArraySetAsSeries(bullishDivergenceBuffer,true);
   ArraySetAsSeries(bearishDivergenceBuffer,true);
   ArraySetAsSeries(macdBuffer,true);
   ArraySetAsSeries(signalBuffer,true);
......................................
   if(CopyBuffer(MACD_Divergence__Handle,0,0,30,bullishDivergenceBuffer)<0 || CopyBuffer(MACD_Divergence__Handle,1,0,30,bearishDivergenceBuffer)<0)
      
           {
      Alert("Ошибка копирования значений индикаторных буферов индикатора MACD_Divergence :",GetLastError(),"!!");
      return;
           }
    if(
       CopyBuffer(MACD_Divergence__Handle,2,0,3,macdBuffer)<0 ||CopyBuffer(MACD_Divergence__Handle,3,0,3,signalBuffer)<0 )
           {
      Alert("Ошибка копирования значений индикаторных буферов индикатора MACD_Divergence :",GetLastError(),"!!");
      return;
           }       
           
           
Print(" !!!!!!!!!!!!!!!! bullishDivergenceBuffer =  ",bullishDivergenceBuffer[0]);
Print(" !!!!!!!!!!!!!!!! bearishDivergenceBuffer =  ",bearishDivergenceBuffer[0]);
Print(" !!!!!!!!!!!!!!!! macdBuffer =  ",macdBuffer[0]);
Print(" !!!!!!!!!!!!!!!! signalBuffer =  ",signalBuffer[0]);

Technically, it seems to be ok, no errors likeGetLastError orINVALID_HANDLE at any stage, I tried to get the values for bullish and bearish divergence, they are empty:

2014.03.14 19:34:15 Core 1 2014.03.03 16:00:00 !!!!!!!!!!!!!!!! bullishDivergenceBuffer = 1.797693134862316e+308
2014.03.14 19:34:15 Core 1 2014.03.03 16:00:00 !!!!!!!!!!!!!!!! bearishDivergenceBuffer = 1.797693134862316e+308
2014.03.14 19:34:15 15 Core 1 2014.03.03 16:00:00 !!!!!!!!!!!!!!!! signalBuffer = 0.001566958632905211
2014.03.14 19:34:15 Core 1 2014.03.03 16:00:00 !!!!!!!!!!!!!!!! macdBuffer = 0.001471813911680497

How do I get these values? The indicator itself has the values, I tried to output them viaPrint and they show the values of extrema, why they are not passed to the EA?

I tried many variants, but the result is the same. Maybe theCopyBuffer request should look different, but how ? I haven't found anything in search.

Or the value of bar 0 in EA and [currentExtremum] in indicator do not correlate? How do I reconcile them?

MACD Divergence
MACD Divergence
  • votes: 24
  • 2013.11.04
  • Alain Verleyen
  • www.mql5.com
Индикатор выводит линии дивергенции индикатора MACD и отображает сигналы на покупку и продажу при помощи стрелок.
Reason: