Questions from Beginners MQL5 MT5 MetaTrader 5 - page 190

 
paladin800:

How to insert the code correctly in the forum.

Ctrl+Alt+M or click on the "SRC" icon in the toolbar
 
C-4:

I understand all this very well. But can we at least show unused private variables like in VisualStudio?

The point is that classes are designed during the development process. You simply cannot take into account everything before creation. That's why frame classes with the least possible functionality are created. While interacting with these framework classes, the overall architecture starts to be elaborated. Some methods are simply deleted, others are moved to the private section, and others are migrated from one class to another. In the process, forgotten variables, methods and even entire classes inevitably appear. This is normal because this is something else like the Okama principle in action - first we write bad, redundant code. Then we formalize the task more clearly and some of the entities simply disappear. Redundancy comes to naught. And it is in this process, the compiler's help would be very useful - to see unused variables and at least private methods would be very useful.

I agree about private fields and methods. Sometimes you create them just in case, and then, after modifying the class, it turns out that they are not useful.
 
barabashkakvn:

Note the error:

Use:

Also read the article"How to write an indicator in MQL5".



I can't understand it yet, I can't show the processed data as text on a chart in mql5
 
Vikon:
I can't seem to get it right - in mql5 I can't show the processed data as text on a chart
   if(MACD[1]<0)
     {
      high_low=true;
      while(MACD[barUP]<0)
        {barUP++;}
      barDown=barUP;
      while(MACD[barDown]>0)
        {barDown++;}
      CopyHigh(NULL,period_macd,0,barDown,high_nachalo);
      shift_nachalo=ArrayMaximum(high_nachalo,barUP-1,barDown-(barUP-1));
     }
barDown - invalid value (i.e. MACD array has no index equal to barDown). Check the algorithm and look at the "Experts" tab in the terminal - error messages appear in this tab.
 
Hello all, could you please tell a newbie how to make a Dinapoli condition for robots? It is described in the Dinapoli trading system and is as follows: The closer to 90 degrees is the angle between the MACD indicator zero line and the signal line, the stronger is the trend. I am wondering how to express this angle between these lines in an EA?
 
Pinochet78:
Hello to all! Please advise a newbie how to make a Dinapoli condition for robots. It is described in Dinapoli trading system and it is as follows: The closer to 90 degrees is the angle between the MACD indicator zero line and the signal line, the stronger is the trend. I am wondering how to express this angle between these lines in an EA?
  1. No way. Trigonometry cannot be applied, because charts have different units: price and time or indicator value and time. When you change the scale of the indicator window, the angles will change.
  2. From the algorithmic point of view, the ToR "The closer to 90 degrees the angle between the zero and the signal lines of the MACD indicator, the stronger the trend" is unformalizable, even if angles in degrees could be calculated.

Better take the OSMa oscillator, because it shows the difference between the main and signal MACD lines. The bigger the difference, the bigger will be the angle at the same scale.

 
Hello! Faced with a problem installing elwave 9.5c after upgrading MT4, can you tell me how to install it?
 
Hi, can you tell me how to use MT5 to mark entry/exit points and stops on a chart using graphical labels, to test the result?
Files:
Si-3_14M15.png  36 kb
 
fenixstorm:
Hi, can you tell me how to use MT5 to mark entry/exit points and stops on a chart using chart marks to test the result?
You can put a put with stops and test it. You will not be able to set other marks in the future without a time machine.
 
Reshetov:
Set the marks with stops and test them. No other marks can be set in the future without a time machine.
technically how? in the program itself ... You mean on the history
Reason: